From cb90dabb95b908c3e76c0616ac201106199e200a Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 3 Feb 2016 20:06:43 -0700 Subject: [PATCH] Make privacy_mode.xml green. --- app/src/main/assets/about_text.html | 4 ++-- .../com/stoutner/privacybrowser/MainWebView.java | 16 ++++++++-------- ...{javascript_on.xml => javascript_enabled.xml} | 2 +- app/src/main/res/drawable/privacy_mode.xml | 2 +- .../res/drawable/{warning_on.xml => warning.xml} | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) rename app/src/main/res/drawable/{javascript_on.xml => javascript_enabled.xml} (87%) rename app/src/main/res/drawable/{warning_on.xml => warning.xml} (88%) diff --git a/app/src/main/assets/about_text.html b/app/src/main/assets/about_text.html index 89d2ab9b..0995c3df 100644 --- a/app/src/main/assets/about_text.html +++ b/app/src/main/assets/about_text.html @@ -6,10 +6,10 @@

Privacy Browser is released under the GPLv3+ license. The full text of the license is below.

-

/app/src/main/res/drawable/javascript_on.xml is part of the Android Material icon set, where it is named ic_visibility. +

/app/src/main/res/drawable/javascript_enabled.xml is part of the Android Material icon set, where it is named ic_visibility. It is released under the CC-BY license. Changes to fill color were made by Soren Stoutner in 2016.

-

/app/src/main/res/drawable/warning_on.xml is part of the Android Material icon set, where it is named ic_visibility. +

/app/src/main/res/drawable/warning.xml is part of the Android Material icon set, where it is named ic_visibility. It is released under the CC-BY license. Changes to fill color were made by Soren Stoutner in 2016.

/app/src/main/res/drawable/privacy_mode.xml is part of the Android Material icon set, where it is named ic_visibility_off. diff --git a/app/src/main/java/com/stoutner/privacybrowser/MainWebView.java b/app/src/main/java/com/stoutner/privacybrowser/MainWebView.java index 0b9c117a..f58f1a2b 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/MainWebView.java +++ b/app/src/main/java/com/stoutner/privacybrowser/MainWebView.java @@ -332,10 +332,10 @@ public class MainWebView extends AppCompatActivity implements CreateHomeScreenSh // Set the initial icon for toggleJavaScript if (javaScriptEnabled) { - toggleJavaScript.setIcon(R.drawable.javascript_on); + toggleJavaScript.setIcon(R.drawable.javascript_enabled); } else { if (domStorageEnabled || cookiesEnabled) { - toggleJavaScript.setIcon(R.drawable.warning_on); + toggleJavaScript.setIcon(R.drawable.warning); } else { toggleJavaScript.setIcon(R.drawable.privacy_mode); } @@ -398,7 +398,7 @@ public class MainWebView extends AppCompatActivity implements CreateHomeScreenSh // Update the toggleJavaScript icon and display a toast message. if (domStorageEnabled || cookiesEnabled) { - menuItem.setIcon(R.drawable.warning_on); + menuItem.setIcon(R.drawable.warning); if (domStorageEnabled && cookiesEnabled) { Toast.makeText(getApplicationContext(), "JavaScript disabled, DOM Storage and Cookies still enabled", Toast.LENGTH_SHORT).show(); } else { @@ -414,7 +414,7 @@ public class MainWebView extends AppCompatActivity implements CreateHomeScreenSh } } else { javaScriptEnabled = true; - menuItem.setIcon(R.drawable.javascript_on); + menuItem.setIcon(R.drawable.javascript_enabled); mainWebView.getSettings().setJavaScriptEnabled(true); mainWebView.reload(); Toast.makeText(getApplicationContext(), "JavaScript enabled", Toast.LENGTH_SHORT).show(); @@ -434,7 +434,7 @@ public class MainWebView extends AppCompatActivity implements CreateHomeScreenSh Toast.makeText(getApplicationContext(), "Privacy Mode", Toast.LENGTH_SHORT).show(); } else { if (cookiesEnabled) { - toggleJavaScript.setIcon(R.drawable.warning_on); + toggleJavaScript.setIcon(R.drawable.warning); Toast.makeText(getApplicationContext(), "Cookies still enabled", Toast.LENGTH_SHORT).show(); } // Else Do nothing because JavaScript is enabled. } @@ -446,7 +446,7 @@ public class MainWebView extends AppCompatActivity implements CreateHomeScreenSh // Update the toggleJavaScript icon if appropriate. if (!javaScriptEnabled) { - toggleJavaScript.setIcon(R.drawable.warning_on); + toggleJavaScript.setIcon(R.drawable.warning); } // Else Do nothing because JavaScript is enabled. Toast.makeText(getApplicationContext(), "DOM Storage enabled", Toast.LENGTH_SHORT).show(); @@ -482,7 +482,7 @@ public class MainWebView extends AppCompatActivity implements CreateHomeScreenSh Toast.makeText(getApplicationContext(), "Privacy Mode", Toast.LENGTH_SHORT).show(); } else { if (domStorageEnabled) { - toggleJavaScript.setIcon(R.drawable.warning_on); + toggleJavaScript.setIcon(R.drawable.warning); Toast.makeText(getApplicationContext(), "DOM Storage still enabled", Toast.LENGTH_SHORT).show(); } // Else Do nothing because JavaScript is enabled. } @@ -494,7 +494,7 @@ public class MainWebView extends AppCompatActivity implements CreateHomeScreenSh // Update the toggleJavaScript icon if appropriate. if (!javaScriptEnabled) { - toggleJavaScript.setIcon(R.drawable.warning_on); + toggleJavaScript.setIcon(R.drawable.warning); } // Else Do nothing because JavaScript is enabled. Toast.makeText(getApplicationContext(), "Cookies enabled", Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/res/drawable/javascript_on.xml b/app/src/main/res/drawable/javascript_enabled.xml similarity index 87% rename from app/src/main/res/drawable/javascript_on.xml rename to app/src/main/res/drawable/javascript_enabled.xml index 306bf042..5dc5dfc7 100644 --- a/app/src/main/res/drawable/javascript_on.xml +++ b/app/src/main/res/drawable/javascript_enabled.xml @@ -1,5 +1,5 @@ diff --git a/app/src/main/res/drawable/privacy_mode.xml b/app/src/main/res/drawable/privacy_mode.xml index 8fb3beee..58101898 100644 --- a/app/src/main/res/drawable/privacy_mode.xml +++ b/app/src/main/res/drawable/privacy_mode.xml @@ -9,6 +9,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/warning_on.xml b/app/src/main/res/drawable/warning.xml similarity index 88% rename from app/src/main/res/drawable/warning_on.xml rename to app/src/main/res/drawable/warning.xml index 2de87737..9415215f 100644 --- a/app/src/main/res/drawable/warning_on.xml +++ b/app/src/main/res/drawable/warning.xml @@ -1,5 +1,5 @@ -- 2.45.2