|
|
@ -46,7 +46,6 @@ class ProxyFragment : BaseFragment() { |
|
|
|
|
|
|
|
|
|
|
|
override fun initData(savedInstanceState: Bundle?) { |
|
|
|
override fun initData(savedInstanceState: Bundle?) { |
|
|
|
enableProxy = SharedPreUtils.getInstance().getBoolean("enableProxy") |
|
|
|
enableProxy = SharedPreUtils.getInstance().getBoolean("enableProxy") |
|
|
|
Log.d("ProxyFragment", "enableProxy=$enableProxy") |
|
|
|
|
|
|
|
proxyType = SharedPreUtils.getInstance().getInt("proxyType") |
|
|
|
proxyType = SharedPreUtils.getInstance().getInt("proxyType") |
|
|
|
proxyHost = SharedPreUtils.getInstance().getString("proxyHost") |
|
|
|
proxyHost = SharedPreUtils.getInstance().getString("proxyHost") |
|
|
|
proxyPort = SharedPreUtils.getInstance().getString("proxyPort") |
|
|
|
proxyPort = SharedPreUtils.getInstance().getString("proxyPort") |
|
|
@ -69,7 +68,6 @@ class ProxyFragment : BaseFragment() { |
|
|
|
enableProxy = !enableProxy |
|
|
|
enableProxy = !enableProxy |
|
|
|
binding.scEnableProxy.isChecked = enableProxy |
|
|
|
binding.scEnableProxy.isChecked = enableProxy |
|
|
|
SharedPreUtils.getInstance().putBoolean("enableProxy", enableProxy) |
|
|
|
SharedPreUtils.getInstance().putBoolean("enableProxy", enableProxy) |
|
|
|
Log.d("ProxyFragment", "putBoolean=$enableProxy") |
|
|
|
|
|
|
|
binding.llContent.visibility = if (enableProxy) View.VISIBLE else View.GONE |
|
|
|
binding.llContent.visibility = if (enableProxy) View.VISIBLE else View.GONE |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -79,7 +77,7 @@ class ProxyFragment : BaseFragment() { |
|
|
|
.setOnMenuItemClickListener { _: BottomMenu?, _: CharSequence?, which: Int -> |
|
|
|
.setOnMenuItemClickListener { _: BottomMenu?, _: CharSequence?, which: Int -> |
|
|
|
proxyType = which |
|
|
|
proxyType = which |
|
|
|
SharedPreUtils.getInstance().putInt("proxyType", which) |
|
|
|
SharedPreUtils.getInstance().putInt("proxyType", which) |
|
|
|
binding.tvProxyType.text = proxyTypeArr[which] |
|
|
|
initWidget(null) |
|
|
|
false |
|
|
|
false |
|
|
|
}.setCancelButton(R.string.cancel) |
|
|
|
}.setCancelButton(R.string.cancel) |
|
|
|
} |
|
|
|
} |
|
|
@ -91,8 +89,8 @@ class ProxyFragment : BaseFragment() { |
|
|
|
{ text: String -> tem = text } |
|
|
|
{ text: String -> tem = text } |
|
|
|
) { dialog: DialogInterface, _: Int -> |
|
|
|
) { dialog: DialogInterface, _: Int -> |
|
|
|
proxyHost = tem |
|
|
|
proxyHost = tem |
|
|
|
binding.tvProxyHost.text = proxyHost |
|
|
|
|
|
|
|
SharedPreUtils.getInstance().putString("proxyHost", proxyHost) |
|
|
|
SharedPreUtils.getInstance().putString("proxyHost", proxyHost) |
|
|
|
|
|
|
|
initWidget(null) |
|
|
|
dialog.dismiss() |
|
|
|
dialog.dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -110,7 +108,7 @@ class ProxyFragment : BaseFragment() { |
|
|
|
.setPositiveButton(R.string.confirm) { _: DialogInterface?, _: Int -> |
|
|
|
.setPositiveButton(R.string.confirm) { _: DialogInterface?, _: Int -> |
|
|
|
proxyPort = threadPick.value.toString() |
|
|
|
proxyPort = threadPick.value.toString() |
|
|
|
SharedPreUtils.getInstance().putString("proxyPort", proxyPort) |
|
|
|
SharedPreUtils.getInstance().putString("proxyPort", proxyPort) |
|
|
|
binding.tvProxyPort.text = proxyPort |
|
|
|
initWidget(null) |
|
|
|
}.setNegativeButton(R.string.cancel, null) |
|
|
|
}.setNegativeButton(R.string.cancel, null) |
|
|
|
.show() |
|
|
|
.show() |
|
|
|
} |
|
|
|
} |
|
|
@ -122,8 +120,8 @@ class ProxyFragment : BaseFragment() { |
|
|
|
{ text: String -> tem = text } |
|
|
|
{ text: String -> tem = text } |
|
|
|
) { dialog: DialogInterface, _: Int -> |
|
|
|
) { dialog: DialogInterface, _: Int -> |
|
|
|
proxyUsername = tem |
|
|
|
proxyUsername = tem |
|
|
|
binding.tvProxyUsername.text = proxyUsername |
|
|
|
|
|
|
|
SharedPreUtils.getInstance().putString("proxyUsername", proxyUsername) |
|
|
|
SharedPreUtils.getInstance().putString("proxyUsername", proxyUsername) |
|
|
|
|
|
|
|
initWidget(null) |
|
|
|
dialog.dismiss() |
|
|
|
dialog.dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -135,8 +133,8 @@ class ProxyFragment : BaseFragment() { |
|
|
|
{ text: String -> tem = text } |
|
|
|
{ text: String -> tem = text } |
|
|
|
) { dialog: DialogInterface, _: Int -> |
|
|
|
) { dialog: DialogInterface, _: Int -> |
|
|
|
proxyPassword = tem |
|
|
|
proxyPassword = tem |
|
|
|
binding.tvProxyPassword.text = proxyPassword |
|
|
|
|
|
|
|
SharedPreUtils.getInstance().putString("proxyPassword", proxyPassword) |
|
|
|
SharedPreUtils.getInstance().putString("proxyPassword", proxyPassword) |
|
|
|
|
|
|
|
initWidget(null) |
|
|
|
dialog.dismiss() |
|
|
|
dialog.dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|