From cdf3b4cd5297d035d01ce4f714f9f5d9cfd17913 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 18 Mar 2021 18:01:26 +0100 Subject: [PATCH] Correctly show validated option --- .../eu/faircode/email/FragmentOptionsConnection.java | 7 ++++++- .../main/res/layout/fragment_options_connection.xml | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java b/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java index 69a8fce86d..a00077c047 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java @@ -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) { diff --git a/app/src/main/res/layout/fragment_options_connection.xml b/app/src/main/res/layout/fragment_options_connection.xml index 6ba74799fe..5e16b0b8fd 100644 --- a/app/src/main/res/layout/fragment_options_connection.xml +++ b/app/src/main/res/layout/fragment_options_connection.xml @@ -175,7 +175,7 @@ app:switchPadding="12dp" /> + app:layout_constraintTop_toBottomOf="@id/tvValidatedHint" /> + +