}
// Google's documentation says the following line is required for `firebase-ads` but things work correctly without it. I have no interest in applying the Google Mobile Services plugin in the standard flavor if I don't have to.
-// I suspect that in the free flavor `firebase-ads` applies it even when not specified. https://firebase.google.com/docs/admob/android/quick-start
+// I suspect that in the free flavor `firebase-ads` applies it even when not specified. <https://firebase.google.com/docs/admob/android/quick-start>.
// apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
\r
<body>\r
<h3>2.0 (version code 19)</h3>\r
- <p>16 March 2017 - minimum API 19, target API 25\r
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8f1c15606ef8cd277f51cc837c2c39667c48d0d4">16. März 2017</a> - Mindest-API, Ziel-API 24</p>\r
<ul>\r
<li>Implement <a href="https://redmine.stoutner.com/issues/7">custom domain settings</a>.</li>\r
<li>When proxying through Tor, <a href="https://redmine.stoutner.com/issues/90">wait until Orbot is ready</a> before attempting to load a page.</li>\r
</ul>\r
\r
<h3>1.15 (version code 18)</h3>\r
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8f4d6373a35a43a36050ed383f58c4074143b264">11 February 2017</a> - minimum API 19, target API 25</p>\r
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8f4d6373a35a43a36050ed383f58c4074143b264">11. Februar 2017</a> - Mindest-API 19, Ziel-API 24</p>\r
<ul>\r
<li>Delete the <a href="https://redmine.stoutner.com/issues/84">secret, undocumented WebView cache</a> on Clear and Exit.</li>\r
<li><a href="https://redmine.stoutner.com/issues/83">Automatically start Orbot</a> when proxying through Orbot is enabled.</li>\r
</ul>\r
\r
<h3>1.14.1 (version code 17)</h3>\r
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=5bd318993ebf675433f514dd04fc3e29545c9312">4 January 2017</a> - minimum API 19, target API 25</p>\r
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=5bd318993ebf675433f514dd04fc3e29545c9312">4. Januar 2017</a> - Mindest-API 19, Ziel-API 24</p>\r
<ul>\r
<li>Fix a bug that caused Privacy Browser to <a href="https://redmine.stoutner.com/issues/80">crash on some websites</a> when ad blocking was enabled.</li>\r
</ul>\r
\r
<h3>1.14 (version code 16)</h3>\r
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=6d3d23ab62cfdd6ef142dbdb764a6bac8fc38ce1">26 December 2016</a> - minimum API 19, target API 25</p>\r
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=6d3d23ab62cfdd6ef142dbdb764a6bac8fc38ce1">26. Dezember 2016</a> - Mindest-API 19, Ziel-API 24</p>\r
<ul>\r
<li>Implement <a href="https://redmine.stoutner.com/issues/31">ad blocking</a>.</li>\r
<li>Change the default user agent to PrivacyBrowser/1.0 <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=7f0fda47dbd040262a8149e1e6d27f7abe9043ea">for real this time</a>.</li>\r
</ul>\r
\r
<h3>1.13 (version code 15)</h3>\r
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=5a9cabddff240061fe521f01df3025b037e9da9e">28 November 2016</a> - minimum API 19, target API 24</p>\r
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=5a9cabddff240061fe521f01df3025b037e9da9e">28. November 2016</a> - Mindest-API 19, Ziel-API 24</p>\r
<ul>\r
<li>Double-tap for <a href="https://redmine.stoutner.com/issues/46">full screen browsing mode</a>.</li>\r
<li>Change the default user agent to <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=b0ddee839c666ba339e374749588f910070658ee">PrivacyBrowser/1.0</a>.</li>\r
<body>
<h3>2.0 (version code 19)</h3>
- <p>16 March 2017 - minimum API 19, target API 25
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8f1c15606ef8cd277f51cc837c2c39667c48d0d4">16 March 2017</a> - minimum API 19, target API 25</p>
<ul>
<li>Implement <a href="https://redmine.stoutner.com/issues/7">custom domain settings</a>.</li>
<li>When proxying through Tor, <a href="https://redmine.stoutner.com/issues/90">wait until Orbot is ready</a> before attempting to load a page.</li>
<body>
<h3>2.0 (código de versión 19)</h3>
- <p>16 de marzo de 2017 - API mínimo 19, API dirigido 25
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8f1c15606ef8cd277f51cc837c2c39667c48d0d4">16 de marzo de 2017</a> - API mínimo 19, API dirigido 25</p>
<ul>
<li>Implementar <a href="https://redmine.stoutner.com/issues/7">configuración de dominio personalizado</a>.</li>
<li>Cuando se usa proxy a través de Tor, <a href="https://redmine.stoutner.com/issues/90">esperar hasta que Orbot esté listo</a> antes de intentar cargar una página.</li>
<body>
<h3>2.0 (versione codice 19)</h3>
- <p>16 Marzo 2017 - minima API 19, target API 25
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8f1c15606ef8cd277f51cc837c2c39667c48d0d4">16 Marzo 2017</a> - minima API 19, target API 25</p>
<ul>
<li>Implementazione delle <a href="https://redmine.stoutner.com/issues/7">impostazioni personalizzate per i domini</a>.</li>
<li>Nel caso di collegamento tramite Tor, <a href="https://redmine.stoutner.com/issues/90">attende che Orbot sia pronto</a> prima di tentare il caricamento di una pagina web.</li>
// `orbotStatus` is public static so it can be accessed from `OrbotProxyHelper`. It is also used in `onCreate()`.
public static String orbotStatus;
+ // `webViewTitle` is public static so it can be accessed from `CreateHomeScreenShorcutDialog`. It is also used in `onCreate()`.
+ public static String webViewTitle;
+
// `navigatingHistory` is used in `onCreate()` and `onNavigationItemSelected()`.
private boolean navigatingHistory;
// Set the favorite icon when it changes.
@Override
public void onReceivedIcon(WebView view, Bitmap icon) {
- // Save a copy of the favorite icon for use if a shortcut is added to the home screen.
+ // Save a copy of the favorite icon.
favoriteIcon = icon;
// Place the favorite icon in the appBar.
imageViewFavoriteIcon.setImageBitmap(Bitmap.createScaledBitmap(icon, 64, 64, true));
}
+ // Save a copy of the title when it changes.
+ @Override
+ public void onReceivedTitle(WebView view, String title) {
+ // Save a copy of the title.
+ webViewTitle = title;
+ }
+
// Enter full screen video
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {
// We need to show the `AlertDialog` before we can call `setOnKeyListener()` below.
alertDialog.show();
- // Allow the `enter` key on the keyboard to create the bookmark from `create_bookmark_name_edittext`.
+ // Get a handle for `create_bookmark_name_edittext`.
EditText createBookmarkNameEditText = (EditText) alertDialog.findViewById(R.id.create_bookmark_name_edittext);
- assert createBookmarkNameEditText != null; // Remove the warning below that `createBookmarkNameEditText` might be `null`.
+
+ // Set the current `WebView` title as the text for `create_bookmark_name_edittext`.
+ createBookmarkNameEditText.setText(MainWebViewActivity.webViewTitle);
+
+ // Allow the `enter` key on the keyboard to create the bookmark from `create_bookmark_name_edittext`.
createBookmarkNameEditText.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View view, int keyCode, KeyEvent event) {
// If the event is a key-down on the `enter` key, select the `PositiveButton` `Create`.
// Set the formattedUrlString as the initial text of `create_bookmark_url_edittext`.
EditText createBookmarkUrlEditText = (EditText) alertDialog.findViewById(R.id.create_bookmark_url_edittext);
- assert createBookmarkUrlEditText != null;// Remove the warning below that `createBookmarkUrlEditText` might be `null`.
createBookmarkUrlEditText.setText(MainWebViewActivity.formattedUrlString);
// Allow the `enter` key on the keyboard to create the bookmark from `create_bookmark_url_edittext`.
// Allow the `enter` key on the keyboard to create the folder from `create_folder_name_edittext`.
EditText createFolderNameEditText = (EditText) alertDialog.findViewById(R.id.create_folder_name_edittext);
- assert createFolderNameEditText != null; // Remove the warning below that `createFolderNameEditText` might be `null`.
createFolderNameEditText.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
// If the event is a key-down on the `enter` key, select the `PositiveButton` `Create`.
// Display the current favorite icon.
ImageView webPageIconImageView = (ImageView) alertDialog.findViewById(R.id.create_folder_web_page_icon);
- assert webPageIconImageView != null; // Remove the warning that `webPageIconImageView` may be null.
webPageIconImageView.setImageBitmap(MainWebViewActivity.favoriteIcon);
// `onCreateDialog()` requires the return of an `AlertDialog`.
// We need to show `alertDialog` before we can call `setOnKeyListener()` below.
alertDialog.show();
- // Allow the "enter" key on the keyboard to create the shortcut.
+ // Get a handle for `shortcut_name_edittext`.
EditText shortcutNameEditText = (EditText) alertDialog.findViewById(R.id.shortcut_name_edittext);
- assert shortcutNameEditText != null; // Remove the warning below that shortcutNameEditText might be null.
+
+ // Set the current `WebView` title as the text for `shortcutNameEditText`.
+ shortcutNameEditText.setText(MainWebViewActivity.webViewTitle);
+
+ // Allow the "enter" key on the keyboard to create the shortcut.
shortcutNameEditText.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
// If the event is a key-down on the "enter" button, select the PositiveButton "Create".
// Set the text for `downloadFileSizeTextView`.
TextView downloadFileSizeTextView = (TextView) alertDialog.findViewById(R.id.download_file_size);
- assert downloadFileSizeTextView != null; // Remove the warning on the following line that `downloadFileSizeTextView` might be `null`.
downloadFileSizeTextView.setText(fileSize);
// Set the text for `downloadFileNameTextView`.
EditText downloadFileNameTextView = (EditText) alertDialog.findViewById(R.id.download_file_name);
- assert downloadFileNameTextView != null; // Remove the warning on the following line that `downloadFileNameTextView` might be `null`.
downloadFileNameTextView.setText(downloadFileName);
// Allow the `enter` key on the keyboard to save the file from `downloadFileNameTextView`.
// Set the text for `downloadImageNameTextView`.
EditText downloadImageNameTextView = (EditText) alertDialog.findViewById(R.id.download_image_name);
- assert downloadImageNameTextView != null; // Remove the warning on the following line that `downloadImageNameTextView` might be `null`.
downloadImageNameTextView.setText(imageFileName);
// Allow the `enter` key on the keyboard to save the file from `downloadImageNameTextView`.
Bitmap currentIconBitmap = BitmapFactory.decodeByteArray(currentIconByteArray, 0, currentIconByteArray.length);
// Display `currentIconBitmap` in `edit_bookmark_current_icon`.
ImageView currentIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_bookmark_current_icon);
- assert currentIconImageView != null; // Remove the warning below that `currentIconImageView` might be null;
currentIconImageView.setImageBitmap(currentIconBitmap);
// Get a `Bitmap` of the favorite icon from `MainWebViewActivity` and display it in `edit_bookmark_web_page_favorite_icon`.
ImageView newFavoriteIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_bookmark_web_page_favorite_icon);
- assert newFavoriteIconImageView != null; // Remove the warning below that `newFavoriteIcon` might be null.
newFavoriteIconImageView.setImageBitmap(MainWebViewActivity.favoriteIcon);
// Load the text for `edit_bookmark_name_edittext`.
EditText bookmarkNameEditText = (EditText) alertDialog.findViewById(R.id.edit_bookmark_name_edittext);
- assert bookmarkNameEditText != null; // Remove the warning below that `bookmarkNameEditText` might be null.
bookmarkNameEditText.setText(bookmarkCursor.getString(bookmarkCursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_NAME)));
// Allow the `enter` key on the keyboard to save the bookmark from `edit_bookmark_name_edittext`.
// Load the text for `edit_bookmark_url_edittext`.
EditText bookmarkUrlEditText = (EditText) alertDialog.findViewById(R.id.edit_bookmark_url_edittext);
- assert bookmarkUrlEditText != null;// Remove the warning below that `bookmarkUrlEditText` might be null.
bookmarkUrlEditText.setText(bookmarkCursor.getString(bookmarkCursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_URL)));
// Allow the "enter" key on the keyboard to save the bookmark from `edit_bookmark_url_edittext`.
Bitmap currentIconBitmap = BitmapFactory.decodeByteArray(currentIconByteArray, 0, currentIconByteArray.length);
// Display `currentIconBitmap` in `edit_folder_current_icon`.
ImageView currentIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_folder_current_icon);
- assert currentIconImageView != null; // Remove the warning below that `currentIconImageView` might be null.
currentIconImageView.setImageBitmap(currentIconBitmap);
// Get a `Bitmap` of the favorite icon from `MainWebViewActivity` and display it in `edit_folder_web_page_favorite_icon`.
ImageView webPageFavoriteIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_folder_web_page_favorite_icon);
- assert webPageFavoriteIconImageView != null; // Remove the warning below that `webPageFavoriteIcon` might be null.
webPageFavoriteIconImageView.setImageBitmap(MainWebViewActivity.favoriteIcon);
// Load the text for `edit_folder_name_edittext`.
EditText folderNameEditText = (EditText) alertDialog.findViewById(R.id.edit_folder_name_edittext);
- assert folderNameEditText != null; // Remove the warning below that `bookmarkNameEditText` might be null.
folderNameEditText.setText(bookmarkCursor.getString(bookmarkCursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_NAME)));
// Allow the `enter` key on the keyboard to save the bookmark from `edit_bookmark_name_edittext`.
Bitmap folderIconBitmap = BitmapFactory.decodeByteArray(folderIconByteArray, 0, folderIconByteArray.length);
// Display `folderIconBitmap` in `move_to_folder_icon`.
ImageView folderIconImageView = (ImageView) view.findViewById(R.id.move_to_folder_icon);
- assert folderIconImageView != null; // Remove the warning below that `currentIconImageView` might be null;
folderIconImageView.setImageBitmap(folderIconBitmap);
// Get the folder name from `cursor` and display it in `move_to_folder_name_textview`.
Bitmap folderIconBitmap = BitmapFactory.decodeByteArray(folderIconByteArray, 0, folderIconByteArray.length);
// Display `folderIconBitmap` in `move_to_folder_icon`.
ImageView folderIconImageView = (ImageView) view.findViewById(R.id.move_to_folder_icon);
- assert folderIconImageView != null; // Remove the warning below that `currentIconImageView` might be null;
folderIconImageView.setImageBitmap(folderIconBitmap);
// Get the folder name from `cursor` and display it in `move_to_folder_name_textview`.
// Display the ListView
ListView foldersListView = (ListView) alertDialog.findViewById(R.id.move_to_folder_listview);
- assert foldersListView != null; // Remove the warning below that `foldersListView` might be null.
foldersListView.setAdapter(foldersCursorAdapter);
// `onCreateDialog` requires the return of an `AlertDialog`.
// Get a handle for `listView`.
ListView listView = (ListView) alertDialog.findViewById(R.id.history_listview);
- // Remove the warning below that `listView` might be `null`.
- assert listView != null;
-
// Set the adapter on `listView`.
listView.setAdapter(historyArrayAdapter);
// Convert the `long` `id` to an `int`.
int itemId = (int) id;
- // Only enable the click if it is not on the `currentPageId`.
+ // Only consume the click if it is not on the `currentPageId`.
if (itemId != currentPageId) {
- // Get the history entry for this `itemId`.
- History historyEntry = historyArrayAdapter.getItem(itemId);
-
- // Remove the lint warning below that `historyEntry` might be `null`.
- assert historyEntry != null;
-
- // Send the history entry URL to be loaded in `mainWebView`.
+ // Go forward or back to `itemId`.
urlHistoryListener.onUrlHistoryEntrySelected(currentPageId - itemId);
// Dismiss the `Dialog`.
android:layout_width="match_parent"
android:hint="@string/bookmark_name"
android:imeOptions="actionGo"
- android:inputType="textUri" />
+ android:inputType="textUri"
+ android:selectAllOnFocus="true" />
</android.support.design.widget.TextInputLayout>
<!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
`android:inputType="textUri"` disables spell check in the `EditText`. -->
<android.support.design.widget.TextInputEditText
android:id="@+id/shortcut_name_edittext"
- android:layout_height="wrap_content"
android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:hint="@string/shortcut_name"
android:imeOptions="actionGo"
- android:inputType="textUri" />
+ android:inputType="textUri"
+ android:selectAllOnFocus="true" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
\ No newline at end of file