diff --git a/app/app.iml b/app/app.iml index 46791fe3..24419a26 100644 --- a/app/app.iml +++ b/app/app.iml @@ -42,12 +42,6 @@ - - - - - - @@ -56,6 +50,12 @@ + + + + + + @@ -64,14 +64,6 @@ - - - - - - - - @@ -80,6 +72,14 @@ + + + + + + + + diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java index 34945595..34a3178a 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java @@ -273,12 +273,27 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences } }); + // Hint white listing + final LinearLayout llWhitelist = (LinearLayout) findViewById(R.id.llWhitelist); + Button btnWhitelist = (Button) findViewById(R.id.btnWhitelist); + boolean whitelist_wifi = prefs.getBoolean("whitelist_wifi", false); + boolean whitelist_other = prefs.getBoolean("whitelist_other", false); + boolean hintWhitelist = prefs.getBoolean("hint_whitelist", true); + llWhitelist.setVisibility(!(whitelist_wifi || whitelist_other) && hintWhitelist ? View.VISIBLE : View.GONE); + btnWhitelist.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + prefs.edit().putBoolean("hint_whitelist", false).apply(); + llWhitelist.setVisibility(View.GONE); + } + }); + // Hint system applications final LinearLayout llSystem = (LinearLayout) findViewById(R.id.llSystem); Button btnSystem = (Button) findViewById(R.id.btnSystem); boolean system = prefs.getBoolean("manage_system", false); - boolean hint = prefs.getBoolean("hint_system", true); - llSystem.setVisibility(!system && hint ? View.VISIBLE : View.GONE); + boolean hintSystem = prefs.getBoolean("hint_system", true); + llSystem.setVisibility(!system && hintSystem ? View.VISIBLE : View.GONE); btnSystem.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -531,12 +546,19 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences "show_nointernet".equals(name) || "show_disabled".equals(name) || "sort".equals(name) || - "imported".equals(name)) + "imported".equals(name)) { updateApplicationList(null); - else if ("manage_system".equals(name)) { + final LinearLayout llWhitelist = (LinearLayout) findViewById(R.id.llWhitelist); + boolean whitelist_wifi = prefs.getBoolean("whitelist_wifi", false); + boolean whitelist_other = prefs.getBoolean("whitelist_other", false); + boolean hintWhitelist = prefs.getBoolean("hint_whitelist", true); + llWhitelist.setVisibility(!(whitelist_wifi || whitelist_other) && hintWhitelist ? View.VISIBLE : View.GONE); + + } else if ("manage_system".equals(name)) { invalidateOptionsMenu(); updateApplicationList(null); + LinearLayout llSystem = (LinearLayout) findViewById(R.id.llSystem); boolean system = prefs.getBoolean("manage_system", false); boolean hint = prefs.getBoolean("hint_system", true); diff --git a/app/src/main/res/layout/main.xml b/app/src/main/res/layout/main.xml index d1bb9952..09a29e8d 100644 --- a/app/src/main/res/layout/main.xml +++ b/app/src/main/res/layout/main.xml @@ -41,6 +41,33 @@ android:scrollbars="vertical" /> + + + + +