compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:24.2.1'
// Only compile `com.google.android.gms:play-services-ads` for the free flavor.
- freeCompile 'com.google.android.gms:play-services-ads:9.6.1'
+ freeCompile 'com.google.android.gms:play-services-ads:9.8.00'
}
<p><img class="icon" src="../en/images/ic_vertical_align_top.png"> ic_vertical_align_top.</p>
<p><img class="icon" src="../en/images/ic_web.png"> ic_web.</p>
+
+<p><img class="icon" src="../en/images/ic_expand_less.png"> ic_expand_less.</p>
+
+<p><img class="icon" src="../en/images/ic_expand_more.png"> ic_expand_more.</p>
+
+<p><img class="icon" src="../en/images/ic_close.png"> ic_close.</p>
+
<hr/>
<h3>GNU General Public License</h3>
<p><img class="icon" src="images/ic_web.png"> ic_web.</p>
+<p><img class="icon" src="images/ic_expand_less.png"> ic_expand_less.</p>
+
+<p><img class="icon" src="images/ic_expand_more.png"> ic_expand_more.</p>
+
+<p><img class="icon" src="images/ic_close.png"> ic_close.</p>
+
<br/>
<p><img class="left" src="images/cookie.png"> cookie was created by Google.
It is released under the <a href ="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>
and can be downloaded from <a href="https://materialdesignicons.com/icon/cookie">Material Design Icons</a>.</p>
+
<hr/>
<h3>GNU General Public License</h3>
SslCertificateError.SslCertificateErrorListener, DownloadFile.DownloadFileListener {
// `appBar` is public static so it can be accessed from `OrbotProxyHelper`.
- // It is also used in `onCreate()`.
+ // It is also used in `onCreate()` and `onOptionsItemSelected()`.
public static ActionBar appBar;
// `favoriteIcon` is public static so it can be accessed from `CreateHomeScreenShortcut`, `BookmarksActivity`, `CreateBookmark`, `CreateBookmarkFolder`, and `EditBookmark`.
// `sslErrorHandler` is used in `onCreate()`, `onSslErrorCancel()`, and `onSslErrorProceed`.
private SslErrorHandler sslErrorHandler;
+ private MenuItem toggleJavaScript;
+
@Override
// Remove Android Studio's warning about the dangers of using SetJavaScriptEnabled. The whole premise of Privacy Browser is built around an understanding of these dangers.
@SuppressLint("SetJavaScriptEnabled")
// This is needed to get rid of the Android Studio warning that appBar might be null.
assert appBar != null;
- // Add the custom url_bar layout, which shows the favoriteIcon, urlTextBar, and progressBar.
- appBar.setCustomView(R.layout.url_bar);
+ // Add the custom url_app_bar layout, which shows the favoriteIcon, urlTextBar, and progressBar.
+ appBar.setCustomView(R.layout.url_app_bar);
appBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
// Set the "go" button on the keyboard to load the URL in urlTextBox.
updatePrivacyIcons();
// Get handles for the menu items.
+ toggleJavaScript = menu.findItem(R.id.toggleJavaScript);
MenuItem toggleFirstPartyCookies = menu.findItem(R.id.toggleFirstPartyCookies);
MenuItem toggleThirdPartyCookies = menu.findItem(R.id.toggleThirdPartyCookies);
MenuItem toggleDomStorage = menu.findItem(R.id.toggleDomStorage);
mainWebView.getSettings().setTextZoom(200);
return true;
+ case R.id.find_on_page:
+ appBar.setCustomView(R.layout.find_on_page_app_bar);
+ toggleJavaScript.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+ appBar.invalidateOptionsMenu();
+ return true;
+
case R.id.share:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
adView = findViewById(R.id.adView);
// `invalidateOptionsMenu` should recalculate the number of action buttons from the menu to display on the app bar, but it doesn't because of the this bug: https://code.google.com/p/android/issues/detail?id=20493#c8
- invalidateOptionsMenu();
+ // invalidateOptionsMenu();
}
@Override
--- /dev/null
+<!-- close.xml comes from the Android Material icon set, where it is called ic_close.
+ It is released under the Apache License 2.0. -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- We have to use a hard coded color code until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
+</vector>
--- /dev/null
+<!-- next.xml comes from the Android Material icon set, where it is called ic_expand_more.
+ It is released under the Apache License 2.0. -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- We have to use a hard coded color code until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M16.59,8.59L12,13.17 7.41,8.59 6,10l6,6 6,-6z"/>
+</vector>
--- /dev/null
+<!-- previous.xml comes from the Android Material icon set, where it is called ic_expand_less.
+ It is released under the Apache License 2.0. -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- We have to use a hard coded color code until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M12,8l-6,6 1.41,1.41L12,10.83l4.59,4.58L18,14z"/>
+</vector>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright 2016 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/find_on_page_relativelayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <ImageView
+ android:id="@+id/close_find"
+ android:src="@drawable/close"
+ android:layout_alignParentEnd="true"
+ android:layout_width="30dp"
+ android:layout_height="30dp"
+ android:layout_centerVertical="true"
+ android:contentDescription="@string/close" />
+
+ <ImageView
+ android:id="@+id/find_next"
+ android:src="@drawable/next"
+ android:layout_toStartOf="@id/close_find"
+ android:layout_width="30dp"
+ android:layout_height="30dp"
+ android:layout_centerVertical="true"
+ android:contentDescription="@string/next" />
+
+ <ImageView
+ android:id="@+id/find_previous"
+ android:src="@drawable/previous"
+ android:layout_toStartOf="@id/find_next"
+ android:layout_width="30dp"
+ android:layout_height="30dp"
+ android:layout_centerVertical="true"
+ android:contentDescription="@string/previous" />
+
+ <!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key. -->
+ <EditText
+ android:id="@+id/find_on_page_edittext"
+ android:layout_toStartOf="@id/find_previous"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:hint="@string/find_on_page"
+ android:imeOptions="actionGo" />
+
+
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright 2015-2016 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- `FrameLayout` lets the `ProgressBar` float on top of `urlTextBox`. -->
+<FrameLayout
+ xmlns:tools="http://schemas.android.com/tools"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <!-- `RelativeLayout` is used instead of a `LinearLayout` because `supportAppBar` does not let `android:layout_weight="1"` cause `urlTextBox` to fill all the available space. -->
+ <RelativeLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <!-- Set the program icon as the initial `favoriteIcon`.
+ `layout_height` and `layout_width` of 26dp matches the `AppBar` icons. -->
+ <ImageView
+ android:id="@+id/favoriteIcon"
+ android:src="@drawable/world"
+ android:layout_height="26dp"
+ android:layout_width="26dp"
+ android:layout_centerVertical="true"
+ android:onClick="viewSslCertificate"
+ android:contentDescription="@string/favorite_icon" />
+
+ <!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key.
+ `android:inputType="textUri"` disables spell check in the `EditText`. -->
+ <EditText
+ android:id="@+id/urlTextBox"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_toEndOf="@id/favoriteIcon"
+ android:hint="@string/url_or_search_terms"
+ android:imeOptions="actionGo"
+ android:inputType="textUri" />
+ </RelativeLayout>
+
+ <!-- `android:max` changes the maximum `ProgressBar` value from 10000 to 100 to match progress percentage.
+ `android:layout_height="2dp"` works best for API 23 Marshmallow, but `3dp` is required for visibility on API <= 22.
+ `tools:ignore="UnusedAttribute"` removes the lint waring about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
+ <ProgressBar
+ android:id="@+id/progressBar"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="3dp"
+ android:layout_gravity="bottom"
+ android:max="100"
+ android:progressTint="@color/blue_700"
+ android:progressBackgroundTint="@color/white"
+ android:visibility="gone"
+ tools:ignore="UnusedAttribute" />
+</FrameLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright 2015-2016 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
-
- Privacy Browser is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Privacy Browser is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-
-<!-- FrameLayout lets the ProgressBar float on top of `urlTextBox`. -->
-<FrameLayout
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/addressBarFrameLayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <!-- RelativeLayout is used instead of a LinearLayout because supportAppBar does not let android:layout_weight="1" to cause urlTextBox to fill all the available space. -->
- <RelativeLayout
- android:id="@+id/addressBarRelativeLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <!-- Set the program icon as the initial favoriteIcon.
- `layout_height` and `layout_width` and of 26dp matches the AppBar icons. -->
- <ImageView
- android:id="@+id/favoriteIcon"
- android:src="@drawable/world"
- android:layout_height="26dp"
- android:layout_width="26dp"
- android:layout_centerVertical="true"
- android:onClick="viewSslCertificate"
- android:contentDescription="@string/favorite_icon" />
-
- <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
- `android:inputType="textUri"` disables spell check in the EditText.
- We can't use `android:imeOptions=flagNoExtractUi"` because it disables tapping to select in landscape orientation on small devices. -->
- <EditText
- android:id="@+id/urlTextBox"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_toEndOf="@id/favoriteIcon"
- android:hint="@string/url_or_search_terms"
- android:imeOptions="actionGo"
- android:inputType="textUri" />
- </RelativeLayout>
-
- <!-- android:max changes the maximum ProgressBar value from 10000 to 100 to match progress percentage.
- android:layout_height="2dp" works best for API 23 "Marshmallow", but "3dp" is required for visibility on API <= 22.
- `tools:ignore="UnusedAttribute"` removes the lint waring about `progressTint` and `progressBackgroundTint`
- not applying to API < 21.-->
- <ProgressBar
- android:id="@+id/progressBar"
- style="?android:attr/progressBarStyleHorizontal"
- android:layout_width="fill_parent"
- android:layout_height="3dp"
- android:layout_gravity="bottom"
- android:max="100"
- android:progressTint="@color/blue_700"
- android:progressBackgroundTint="@color/white"
- android:visibility="gone"
- tools:ignore="UnusedAttribute" />
-</FrameLayout>
\ No newline at end of file
</menu>
</item>
+ <item
+ android:id="@+id/find_on_page"
+ android:title="@string/find_on_page"
+ android:orderInCategory="100"
+ app:showAsAction="never|collapseActionView" />
+
<item
android:id="@+id/share"
android:title="@string/share"
- android:orderInCategory="100"
+ android:orderInCategory="110"
app:showAsAction="never" />
<item
android:id="@+id/addToHomescreen"
android:title="@string/add_to_home_screen"
- android:orderInCategory="110"
+ android:orderInCategory="120"
app:showAsAction="never" />
<item
android:id="@+id/print"
android:title="@string/print"
- android:orderInCategory="120"
+ android:orderInCategory="130"
app:showAsAction="never" />
<item
android:id="@+id/refresh"
android:title="@string/refresh"
- android:orderInCategory="120"
+ android:orderInCategory="140"
app:showAsAction="never" />
</menu>
<string name="one_hundred_fifty_percent">150%</string>
<string name="one_hundred_seventy_five_percent">175%</string>
<string name="two_hundred_percent">200%</string>
+ <string name="find_on_page">Find on Page</string>
<string name="share">Share</string>
<string name="add_to_home_screen">Add to Home Screen</string>
<string name="print">Print</string>
<string name="privacy_browser_web_page">Privacy Browser Web Page</string>
<string name="refresh">Refresh</string>
+ <!-- Find on Page. -->
+ <string name="previous">Previous</string>
+ <string name="next">Next</string>
+
<!-- Create Home Screen Shortcut Alert Dialog. -->
<string name="create_shortcut">Create shortcut</string>
<string name="shortcut_name">Shortcut name</string>
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.1'
+ classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files