pull/21/head
fengyuecanzhu 3 years ago
parent 6a10102b7a
commit e52aeb1c15
  1. 1
      app/src/main/java/xyz/fycz/myreader/model/third3/http/HttpHelper.kt
  2. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/MoreSettingActivity.java
  3. 6
      app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
  4. 12
      app/src/main/java/xyz/fycz/myreader/ui/fragment/ProxyFragment.kt

@ -72,7 +72,6 @@ val globalProxy: String
fun getProxyClient(proxy0: String? = null, noProxy: Boolean = false): OkHttpClient {
var proxy = proxy0
if (proxy.isNullOrEmpty()) proxy = globalProxy
Log.d("getProxyClient", "proxy=$proxy")
if (proxy.isNullOrBlank() || noProxy) {
return okHttpClient
}

@ -206,7 +206,7 @@ public class MoreSettingActivity extends BaseActivity<ActivityMoreSettingBinding
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
if (curFragment == null || curFragment != mProxyFragment) {
if (curFragment == null || curFragment == mProxyFragment) {
menu.findItem(R.id.action_tip).setVisible(false);
} else {
menu.findItem(R.id.action_tip).setVisible(true);

@ -140,7 +140,6 @@ public class MyAlertDialog {
.show();
}
Button posBtn = inputDia.getButton(AlertDialog.BUTTON_POSITIVE);
posBtn.setEnabled(false);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@ -155,11 +154,6 @@ public class MyAlertDialog {
@Override
public void afterTextChanged(Editable s) {
String text = editText.getText().toString();
if (editText.getText().length() > 0 && editText.getText().length() <= maxLen && !text.equals(initText)) {
posBtn.setEnabled(true);
} else {
posBtn.setEnabled(false);
}
oic.onChange(text);
}
});

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

Loading…
Cancel
Save