Correctly show validated option

This commit is contained in:
M66B
2021-03-18 18:01:26 +01:00
parent 854ee05571
commit cdf3b4cd52
2 changed files with 14 additions and 3 deletions

View File

@@ -51,6 +51,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager;
@@ -71,6 +72,8 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private TextView tvNetworkRoaming;
private TextView tvNetworkInfo;
private Group grpValidated;
private final static String[] RESET_OPTIONS = new String[]{
"metered", "download", "roaming", "rlah",
"require_validated", "timeout", "prefer_ip4", "standalone_vpn", "tcp_keep_alive", "ssl_harden"
@@ -103,6 +106,8 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
tvNetworkRoaming = view.findViewById(R.id.tvNetworkRoaming);
tvNetworkInfo = view.findViewById(R.id.tvNetworkInfo);
grpValidated = view.findViewById(R.id.grpValidated);
setOptions();
// Wire controls
@@ -144,7 +149,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}
});
swValidated.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? View.GONE : View.VISIBLE);
grpValidated.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? View.GONE : View.VISIBLE);
swValidated.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {