Hide keep alive option

This commit is contained in:
M66B
2020-11-18 08:25:20 +01:00
parent bcbdf6dfdb
commit 42f27ccf03
2 changed files with 17 additions and 9 deletions

View File

@@ -62,6 +62,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private EditText etTimeout;
private SwitchCompat swPreferIp4;
private SwitchCompat swTcpKeepAlive;
private TextView tvTcpKeepAliveHint;
private SwitchCompat swSslHarden;
private Button btnManage;
private TextView tvNetworkMetered;
@@ -89,6 +90,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
etTimeout = view.findViewById(R.id.etTimeout);
swPreferIp4 = view.findViewById(R.id.swPreferIp4);
swTcpKeepAlive = view.findViewById(R.id.swTcpKeepAlive);
tvTcpKeepAliveHint = view.findViewById(R.id.tvTcpKeepAliveHint);
swSslHarden = view.findViewById(R.id.swSslHarden);
btnManage = view.findViewById(R.id.btnManage);
@@ -168,6 +170,10 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}
});
boolean debug = prefs.getBoolean("debug", false);
swTcpKeepAlive.setVisibility(debug || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
tvTcpKeepAliveHint.setVisibility(debug || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
swTcpKeepAlive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {