<p>Privacy Browser is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>. The full text of the license is below.</p>
-<p>/app/src/main/res/mipmap-*/privacy_browser.png, /app/src/main/res/privacy-browser-web.png, /app/src/free/mipmap-*/privacy_browser.png, and /app/src/free/res/privacy_browser-web.png
- are derived from ic_security and ic_language, which are part of the Android Material icon set.
- They are released under the <a href=https://creativecommons.org/licenses/by/4.0/>CC-BY license</a>. Modification were made by Soren Stoutner in 2016.</p>
+<p>app/src/main/res/mipmap-*/privacy_browser.png and app/src/free/mipmap-*/privacy_browser.png are derived from ic_security and ic_language, which are part of the Android Material icon set.
+ They are released under the <a href=https://creativecommons.org/licenses/by/4.0/>CC-BY license</a>. Modifications were made by Soren Stoutner in 2016.</p>
-<p>/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 <a href=https://creativecommons.org/licenses/by/4.0/>CC-BY license</a>. Changes to fill color and size were made by Soren Stoutner in 2016.</p>
-
-<p>/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 <a href=https://creativecommons.org/licenses/by/4.0/>CC-BY license</a>. Changes to fill color and size were made by Soren Stoutner in 2016.</p>
-
-<p>/app/src/main/res/drawable/privacy_mode.xml is part of the Android Material icon set, where it is named ic_visibility_off.
- It is released under the <a href=https://creativecommons.org/licenses/by/4.0/>CC-BY license</a>. Changes to fill color and size were made by Soren Stoutner in 2016.</p>
+<p>app/src/main/res/drawable/javascript_enabled.xml, app/src/main/res/drawable/warning.xml, and app/src/main/res/drawable/privacy_mode.xml are derived from ic_security,
+ which is part of the Android Material icon set. It is released under the <a href=https://creativecommons.org/licenses/by/4.0/>CC-BY license</a>.
+ Modifications were made by Soren Stoutner in 2016.</p>
<p>/app.src/main/res/drawable/world.xml is part of the Android Material icon set, where it is named ic_language.
It is released under the <a href=https://creativecommons.org/licenses/by/4.0/>CC-BY license</a>. Changes to fill color and size were made by Soren Stoutner in 2016.</p>
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
+import android.support.design.widget.Snackbar;
import android.support.v4.app.DialogFragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
setSupportActionBar(supportAppBar);
final FrameLayout fullScreenVideoFrameLayout = (FrameLayout) findViewById(R.id.fullScreenVideoFrameLayout);
- final Activity mainWebViewActivity = this;
+
// We need to use the SupportActionBar from android.support.v7.app.ActionBar until the minimum API is >= 21.
final ActionBar appBar = getSupportActionBar();
return true;
}
- /* These errors do not provide any useful information and clutter the screen.
- public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
- Toast.makeText(mainWebViewActivity, "Error loading " + request + " Error: " + error, Toast.LENGTH_SHORT).show();
- }
- */
-
// Update the URL in urlTextBox when the page starts to load.
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
}
downloadManager.enqueue(requestUri);
- Toast.makeText(mainWebViewActivity, R.string.download_started, Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.download_started, Snackbar.LENGTH_SHORT).show();
}
});
mainWebView.getSettings().setJavaScriptEnabled(false);
mainWebView.reload();
- // Update the toggleJavaScript icon and display a toast message.
+ // Update the toggleJavaScript icon and display a snackbar.
if (domStorageEnabled || cookiesEnabled) {
menuItem.setIcon(R.drawable.warning);
if (domStorageEnabled && cookiesEnabled) {
- Toast.makeText(getApplicationContext(), "JavaScript disabled, DOM Storage and Cookies still enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.both_still_enabled, Snackbar.LENGTH_SHORT).show();
} else {
if (domStorageEnabled) {
- Toast.makeText(getApplicationContext(), "JavaScript disabled, DOM Storage still enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.dom_storage_still_enabled, Snackbar.LENGTH_SHORT).show();
} else {
- Toast.makeText(getApplicationContext(), "JavaScript disabled, Cookies still enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.cookies_still_enabled, Snackbar.LENGTH_SHORT).show();
}
}
} else {
menuItem.setIcon(R.drawable.privacy_mode);
- Toast.makeText(getApplicationContext(), R.string.privacy_mode, Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.privacy_mode, Snackbar.LENGTH_SHORT).show();
}
} else {
javaScriptEnabled = true;
menuItem.setIcon(R.drawable.javascript_enabled);
mainWebView.getSettings().setJavaScriptEnabled(true);
mainWebView.reload();
- Toast.makeText(getApplicationContext(), "JavaScript enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.javascript_enabled, Snackbar.LENGTH_SHORT).show();
}
return true;
mainWebView.getSettings().setDomStorageEnabled(false);
mainWebView.reload();
- // Update the toggleJavaScript icon and display a toast message if appropriate.
+ // Update the toggleJavaScript icon and display a snackbar if appropriate.
if (!javaScriptEnabled && !cookiesEnabled) {
toggleJavaScript.setIcon(R.drawable.privacy_mode);
- Toast.makeText(getApplicationContext(), R.string.privacy_mode, Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.privacy_mode, Snackbar.LENGTH_SHORT).show();
} else {
if (cookiesEnabled) {
toggleJavaScript.setIcon(R.drawable.warning);
- Toast.makeText(getApplicationContext(), "Cookies still enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.cookies_still_enabled, Snackbar.LENGTH_SHORT).show();
} // Else Do nothing because JavaScript is enabled.
}
} else {
toggleJavaScript.setIcon(R.drawable.warning);
} // Else Do nothing because JavaScript is enabled.
- Toast.makeText(getApplicationContext(), "DOM Storage enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.dom_storage_enabled, Snackbar.LENGTH_SHORT).show();
}
return true;
cookieManager.setAcceptCookie(false);
mainWebView.reload();
- // Update the toggleJavaScript icon and display a toast message if appropriate.
+ // Update the toggleJavaScript icon and display a snackbar if appropriate.
if (!javaScriptEnabled && !domStorageEnabled) {
toggleJavaScript.setIcon(R.drawable.privacy_mode);
- Toast.makeText(getApplicationContext(), R.string.privacy_mode, Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.privacy_mode, Snackbar.LENGTH_SHORT).show();
} else {
if (domStorageEnabled) {
toggleJavaScript.setIcon(R.drawable.warning);
- Toast.makeText(getApplicationContext(), "DOM Storage still enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.dom_storage_enabled, Snackbar.LENGTH_SHORT).show();
} // Else Do nothing because JavaScript is enabled.
}
} else {
toggleJavaScript.setIcon(R.drawable.warning);
} // Else Do nothing because JavaScript is enabled.
- Toast.makeText(getApplicationContext(), "Cookies enabled", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.cookies_enabled, Snackbar.LENGTH_SHORT).show();
}
return true;
case R.id.clearDomStorage:
WebStorage webStorage = WebStorage.getInstance();
webStorage.deleteAllData();
- Toast.makeText(getApplicationContext(), "DOM storage deleted", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.dom_storage_deleted, Snackbar.LENGTH_SHORT).show();
return true;
case R.id.clearCookies:
} else {
cookieManager.removeAllCookies(null);
}
- Toast.makeText(getApplicationContext(), "Cookies deleted", Toast.LENGTH_SHORT).show();
+ Snackbar.make(findViewById(R.id.mainWebView), R.string.cookies_deleted, Snackbar.LENGTH_SHORT).show();
return true;
case R.id.addToHomescreen:
<!--
- 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 <https://creativecommons.org/licenses/by/4.0/>.
- Changes to fill color were made by Soren Stoutner in 2016. -->
+ javascript_enabled.xml is derived from ic_security, which is part of the Android Material icon set.
+ It is released under the CC-BY license <https://creativecommons.org/licenses/by/4.0/>. Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016. -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="26dp"
- android:height="26dp"
- android:viewportWidth="26.0"
- android:viewportHeight="26.0">
-
- <!-- The fillColor must be hardcoded in this file until the minimum API is >= 22. Then the resources in colors.xml may be used instead. -->
- <path
- android:fillColor="#FFD50000"
- android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zm0,-8c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
+<vector android:height="26dp" android:viewportHeight="256.0"
+ android:viewportWidth="256.0" android:width="26dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillAlpha="1" android:fillColor="#b71c1c"
+ android:pathData="m128,12.8 l-94.25,41.89 0,62.84c0,58.12 40.22,112.48 94.25,125.67 54.04,-13.2 94.25,-67.55 94.25,-125.67l0,-62.84z" android:strokeColor="#00000000"/>
+ <path android:fillAlpha="1" android:fillColor="#d32f2f"
+ android:pathData="m128,0 l-104.73,46.55 0,69.82C23.27,180.95 67.96,241.34 128,256 188.04,241.34 232.73,180.95 232.73,116.36l0,-69.82L128,0ZM128,127.88 L209.45,127.88C203.29,175.83 171.29,218.53 128,231.91l0,-103.91 -81.45,0 0,-66.33L128,25.48l0,102.4z" android:strokeColor="#00000000"/>
</vector>
<!--
- privacy_mode.xml is part of the Android Material icon set, where it is named ic_visibility_off.
- It is released under the CC-BY license <https://creativecommons.org/licenses/by/4.0/>.
- Changes to fill color and size were made by Soren Stoutner in 2016. -->
+ privacy_mode.xml is derived from ic_security, which is part of the Android Material icon set.
+ It is released under the CC-BY license <https://creativecommons.org/licenses/by/4.0/>. Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016. -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="26dp"
- android:height="26dp"
- android:viewportWidth="26.0"
- android:viewportHeight="26.0">
-
- <!-- The fillColor must be hardcoded in this file until the minimum API is >= 22. Then the resources in colors.xml may be used instead. -->
- <path
- android:fillColor="#FF64DD17"
- android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zm4.31,-0.78l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z"/>
+<vector android:height="26dp" android:viewportHeight="256.0"
+ android:viewportWidth="256.0" android:width="26dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillAlpha="1" android:fillColor="#0d4781"
+ android:pathData="m128,12.8 l-94.25,41.89 0,62.84c0,58.12 40.22,112.48 94.25,125.67 54.04,-13.2 94.25,-67.55 94.25,-125.67l0,-62.84z" android:strokeColor="#00000000"/>
+ <path android:fillAlpha="1" android:fillColor="#1976d2"
+ android:pathData="m128,0 l-104.73,46.55 0,69.82C23.27,180.95 67.96,241.34 128,256 188.04,241.34 232.73,180.95 232.73,116.36l0,-69.82L128,0ZM128,127.88 L209.45,127.88C203.29,175.83 171.29,218.53 128,231.91l0,-103.91 -81.45,0 0,-66.33L128,25.48l0,102.4z" android:strokeColor="#00000000"/>
</vector>
<!--
- warning.xml is part of the Android Material icon set, where it is named ic_visibility.
- It is released under the CC-BY license <https://creativecommons.org/licenses/by/4.0/>.
- Changes to fill color and size were made by Soren Stoutner in 2016. -->
+ warning.xml is derived from ic_security, which is part of the Android Material icon set.
+ It is released under the CC-BY license <https://creativecommons.org/licenses/by/4.0/>. Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016. -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="26dp"
- android:height="26dp"
- android:viewportWidth="26.0"
- android:viewportHeight="26.0">
-
- <!-- The fillColor must be hardcoded in this file until the minimum API is >= 22. Then the resources in colors.xml may be used instead. -->
- <path
- android:fillColor="#FFFFD600"
- android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zm0,-8c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
+<vector android:height="26dp" android:viewportHeight="256.0"
+ android:viewportWidth="256.0" android:width="26dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillAlpha="1" android:fillColor="#f57f17"
+ android:pathData="m128,12.8 l-94.25,41.89 0,62.84c0,58.12 40.22,112.48 94.25,125.67 54.04,-13.2 94.25,-67.55 94.25,-125.67l0,-62.84z" android:strokeColor="#00000000"/>
+ <path android:fillAlpha="1" android:fillColor="#fbc02d"
+ android:pathData="m128,0 l-104.73,46.55 0,69.82C23.27,180.95 67.96,241.34 128,256 188.04,241.34 232.73,180.95 232.73,116.36l0,-69.82L128,0ZM128,127.88 L209.45,127.88C203.29,175.83 171.29,218.53 128,231.91l0,-103.91 -81.45,0 0,-66.33L128,25.48l0,102.4z" android:strokeColor="#00000000"/>
</vector>
<!--
world.xml is part of the Android Material icon set, where it is named ic_language.
It is released under the CC-BY license <https://creativecommons.org/licenses/by/4.0/>.
- Changes to fill color and size were made by Soren Stoutner in 2016. -->
+ Changes to fill color and size were made by Soren Stoutner <soren@stoutner.com> in 2016. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
<string name="privacy_browser_settings">Privacy Browser Settings</string>
<!-- MainWebViewActivity. -->
- <string name="privacy_mode">Privacy Mode</string>
<string name="download_started">Download started</string>
+ <string name="privacy_mode">Privacy Mode</string>
+ <string name="javascript_enabled">JavaScript enabled</string>
+ <string name="dom_storage_enabled">DOM Storage enabled</string>
+ <string name="cookies_enabled">Cookies enabled</string>
+ <string name="dom_storage_still_enabled">JavaScript disabled, DOM Storage still enabled</string>
+ <string name="cookies_still_enabled">Cookies still enabled</string>
+ <string name="both_still_enabled">JavaScript disabled, DOM Storage and Cookies still enabled</string>
+ <string name="dom_storage_deleted">DOM Storage deleted</string>
+ <string name="cookies_deleted">Cookies deleted</string>
<!-- Custom App Bar. -->
<string name="favorite_icon">Favorite Icon</string>