]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Display the bookmark opened in background snackbar in from of the bookmark drawer...
authorSoren Stoutner <soren@stoutner.com>
Fri, 27 May 2022 21:20:31 +0000 (14:20 -0700)
committerSoren Stoutner <soren@stoutner.com>
Fri, 27 May 2022 21:20:31 +0000 (14:20 -0700)
app/build.gradle
app/src/main/AndroidManifest.xml
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.kt
app/src/main/res/layout/bare_webview.xml
build.gradle
gradle/wrapper/gradle-wrapper.properties

index 954739380799fadcfb1ec467cfea4f9bde53f2c0..1abaa0e30c71e55e5a550a913af9a0f0f5dd94ef 100644 (file)
@@ -62,6 +62,8 @@ android {
             dimension "basic"
         }
     }
             dimension "basic"
         }
     }
+
+    namespace 'com.stoutner.privacybrowser'
 }
 
 dependencies {
 }
 
 dependencies {
@@ -79,8 +81,8 @@ dependencies {
     implementation 'androidx.webkit:webkit:1.4.0'
 
     // Include the Kotlin standard library.  This should be the same version number listed in project build.gradle.
     implementation 'androidx.webkit:webkit:1.4.0'
 
     // Include the Kotlin standard library.  This should be the same version number listed in project build.gradle.
-    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20'
+    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21'
 
     // Include the Google material library.
 
     // Include the Google material library.
-    implementation 'com.google.android.material:material:1.5.0'
+    implementation 'com.google.android.material:material:1.6.0'
 }
\ No newline at end of file
 }
\ No newline at end of file
index a9747840ad8b4a7a82bf33dba365f16cb2b59ef0..5bd0bbf0e1946e48d77acaaa685a9bb3f527b095 100644 (file)
@@ -22,7 +22,6 @@
 <manifest
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
 <manifest
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    package="com.stoutner.privacybrowser"
     android:installLocation="auto" >
 
     <!-- Required to load websites. -->
     android:installLocation="auto" >
 
     <!-- Required to load websites. -->
index 8344d5c4e168a4f15adfe9a581a92edc0ed9fcd3..9bea7991873988a291707cced7e440ccb7c40fbf 100644 (file)
@@ -3448,7 +3448,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                 addNewTab(bookmarkCursor.getString(bookmarkCursor.getColumnIndexOrThrow(BookmarksDatabaseHelper.BOOKMARK_URL)), false);
 
                 // Display a snackbar.
                 addNewTab(bookmarkCursor.getString(bookmarkCursor.getColumnIndexOrThrow(BookmarksDatabaseHelper.BOOKMARK_URL)), false);
 
                 // Display a snackbar.
-                Snackbar.make(currentWebView, R.string.bookmark_opened_in_background, Snackbar.LENGTH_SHORT).show();
+                Snackbar.make(drawerLayout, R.string.bookmark_opened_in_background, Snackbar.LENGTH_SHORT).show();
             }
 
             // Consume the event.
             }
 
             // Consume the event.
index 13abb32a63c8e8e6edbe7776a2c5e14c5cc75af4..1e2ea1583da731bd7efe0e87a8fdd24ff1e64eaf 100644 (file)
@@ -151,8 +151,8 @@ class ImportExportDatabaseHelper {
             // Upgrade from schema version 3, first used in Privacy Browser 2.15, to schema version 4, first used in Privacy Browser 2.16.
             if (importDatabaseVersion < 4) {
                 // Add the Pinned IP Addresses columns to the domains table.
             // Upgrade from schema version 3, first used in Privacy Browser 2.15, to schema version 4, first used in Privacy Browser 2.16.
             if (importDatabaseVersion < 4) {
                 // Add the Pinned IP Addresses columns to the domains table.
-                importDatabase.execSQL("ALTER TABLE " + DomainsDatabaseHelper.DOMAINS_TABLE + " ADD COLUMN " + DomainsDatabaseHelper.PINNED_IP_ADDRESSES + " BOOLEAN")
-                importDatabase.execSQL("ALTER TABLE " + DomainsDatabaseHelper.DOMAINS_TABLE + " ADD COLUMN " + DomainsDatabaseHelper.IP_ADDRESSES + " TEXT")
+                importDatabase.execSQL("ALTER TABLE ${DomainsDatabaseHelper.DOMAINS_TABLE} ADD COLUMN ${DomainsDatabaseHelper.PINNED_IP_ADDRESSES}  BOOLEAN")
+                importDatabase.execSQL("ALTER TABLE ${DomainsDatabaseHelper.DOMAINS_TABLE} ADD COLUMN ${DomainsDatabaseHelper.IP_ADDRESSES} TEXT")
             }
 
             // Upgrade from schema version 4, first used in Privacy Browser 2.16, to schema version 5, first used in Privacy Browser 2.17.
             }
 
             // Upgrade from schema version 4, first used in Privacy Browser 2.16, to schema version 5, first used in Privacy Browser 2.17.
@@ -202,7 +202,7 @@ class ImportExportDatabaseHelper {
             // Upgrade from schema version 6, first used in Privacy Browser 3.0, to schema version 7, first used in Privacy Browser 3.1.
             if (importDatabaseVersion < 7) {
                 // Add the wide viewport column to the domains table.
             // Upgrade from schema version 6, first used in Privacy Browser 3.0, to schema version 7, first used in Privacy Browser 3.1.
             if (importDatabaseVersion < 7) {
                 // Add the wide viewport column to the domains table.
-                importDatabase.execSQL("ALTER TABLE " + DomainsDatabaseHelper.DOMAINS_TABLE + " ADD COLUMN " + DomainsDatabaseHelper.WIDE_VIEWPORT + " INTEGER")
+                importDatabase.execSQL("ALTER TABLE ${DomainsDatabaseHelper.DOMAINS_TABLE} ADD COLUMN ${DomainsDatabaseHelper.WIDE_VIEWPORT} INTEGER")
 
                 // Add the Google Analytics, Facebook Click IDs, Twitter AMP redirects, and wide viewport columns to the preferences table.
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $GOOGLE_ANALYTICS BOOLEAN")
 
                 // Add the Google Analytics, Facebook Click IDs, Twitter AMP redirects, and wide viewport columns to the preferences table.
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $GOOGLE_ANALYTICS BOOLEAN")
@@ -250,7 +250,7 @@ class ImportExportDatabaseHelper {
             // Upgrade from schema version 7, first used in Privacy Browser 3.1, to schema version 8, first used in Privacy Browser 3.2.
             if (importDatabaseVersion < 8) {
                 // Add the UltraList column to the tables.
             // Upgrade from schema version 7, first used in Privacy Browser 3.1, to schema version 8, first used in Privacy Browser 3.2.
             if (importDatabaseVersion < 8) {
                 // Add the UltraList column to the tables.
-                importDatabase.execSQL("ALTER TABLE " + DomainsDatabaseHelper.DOMAINS_TABLE + " ADD COLUMN " + DomainsDatabaseHelper.ULTRALIST + " BOOLEAN")
+                importDatabase.execSQL("ALTER TABLE ${DomainsDatabaseHelper.DOMAINS_TABLE} ADD COLUMN ${DomainsDatabaseHelper.ULTRALIST} BOOLEAN")
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $ULTRALIST BOOLEAN")
 
                 // Get the current preference values.
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $ULTRALIST BOOLEAN")
 
                 // Get the current preference values.
@@ -260,10 +260,10 @@ class ImportExportDatabaseHelper {
                 // This can switch to using the variables directly once the API >= 30.  <https://www.sqlite.org/datatype3.html#boolean_datatype>
                 // <https://developer.android.com/reference/android/database/sqlite/package-summary>
                 if (ultraList) {
                 // This can switch to using the variables directly once the API >= 30.  <https://www.sqlite.org/datatype3.html#boolean_datatype>
                 // <https://developer.android.com/reference/android/database/sqlite/package-summary>
                 if (ultraList) {
-                    importDatabase.execSQL("UPDATE " + DomainsDatabaseHelper.DOMAINS_TABLE + " SET " + DomainsDatabaseHelper.ULTRALIST + " = " + 1)
+                    importDatabase.execSQL("UPDATE ${DomainsDatabaseHelper.DOMAINS_TABLE} SET ${DomainsDatabaseHelper.ULTRALIST}  =  1")
                     importDatabase.execSQL("UPDATE $PREFERENCES_TABLE SET $ULTRALIST = 1")
                 } else {
                     importDatabase.execSQL("UPDATE $PREFERENCES_TABLE SET $ULTRALIST = 1")
                 } else {
-                    importDatabase.execSQL("UPDATE " + DomainsDatabaseHelper.DOMAINS_TABLE + " SET " + DomainsDatabaseHelper.ULTRALIST + " = " + 0)
+                    importDatabase.execSQL("UPDATE ${DomainsDatabaseHelper.DOMAINS_TABLE} SET ${DomainsDatabaseHelper.ULTRALIST} = 0")
                     importDatabase.execSQL("UPDATE $PREFERENCES_TABLE SET $ULTRALIST = 0")
                 }
             }
                     importDatabase.execSQL("UPDATE $PREFERENCES_TABLE SET $ULTRALIST = 0")
                 }
             }
@@ -325,7 +325,7 @@ class ImportExportDatabaseHelper {
                 }
 
                 // Add the WebView theme to the domains table.  This defaults to 0, which is `System default`, so a separate step isn't needed to populate the database.
                 }
 
                 // Add the WebView theme to the domains table.  This defaults to 0, which is `System default`, so a separate step isn't needed to populate the database.
-                importDatabase.execSQL("ALTER TABLE " + DomainsDatabaseHelper.DOMAINS_TABLE + " ADD COLUMN " + DomainsDatabaseHelper.WEBVIEW_THEME + " INTEGER")
+                importDatabase.execSQL("ALTER TABLE ${DomainsDatabaseHelper.DOMAINS_TABLE} ADD COLUMN ${DomainsDatabaseHelper.WEBVIEW_THEME} INTEGER")
 
                 // Add the WebView theme to the preferences table.
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $WEBVIEW_THEME TEXT")
 
                 // Add the WebView theme to the preferences table.
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $WEBVIEW_THEME TEXT")
@@ -367,11 +367,11 @@ class ImportExportDatabaseHelper {
                 // In the meantime, a new column must be created with the new name.  There is no need to delete the old column on the temporary import database.
 
                 // Create the new cookies columns.
                 // In the meantime, a new column must be created with the new name.  There is no need to delete the old column on the temporary import database.
 
                 // Create the new cookies columns.
-                importDatabase.execSQL("ALTER TABLE " + DomainsDatabaseHelper.DOMAINS_TABLE + " ADD COLUMN " + DomainsDatabaseHelper.COOKIES + " BOOLEAN")
+                importDatabase.execSQL("ALTER TABLE ${DomainsDatabaseHelper.DOMAINS_TABLE} ADD COLUMN ${DomainsDatabaseHelper.COOKIES} BOOLEAN")
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $COOKIES BOOLEAN")
 
                 // Copy the data from the old cookies columns to the new ones.
                 importDatabase.execSQL("ALTER TABLE $PREFERENCES_TABLE ADD COLUMN $COOKIES BOOLEAN")
 
                 // Copy the data from the old cookies columns to the new ones.
-                importDatabase.execSQL("UPDATE " + DomainsDatabaseHelper.DOMAINS_TABLE + " SET " + DomainsDatabaseHelper.COOKIES + " = enablefirstpartycookies")
+                importDatabase.execSQL("UPDATE ${DomainsDatabaseHelper.DOMAINS_TABLE} SET ${DomainsDatabaseHelper.COOKIES} = enablefirstpartycookies")
                 importDatabase.execSQL("UPDATE $PREFERENCES_TABLE SET $COOKIES = first_party_cookies")
 
                 // Create the new download with external app and bottom app bar columns.
                 importDatabase.execSQL("UPDATE $PREFERENCES_TABLE SET $COOKIES = first_party_cookies")
 
                 // Create the new download with external app and bottom app bar columns.
@@ -400,7 +400,7 @@ class ImportExportDatabaseHelper {
             }
 
             // Get a cursor for the bookmarks table.
             }
 
             // Get a cursor for the bookmarks table.
-            val importBookmarksCursor = importDatabase.rawQuery("SELECT * FROM " + BookmarksDatabaseHelper.BOOKMARKS_TABLE, null)
+            val importBookmarksCursor = importDatabase.rawQuery("SELECT * FROM ${BookmarksDatabaseHelper.BOOKMARKS_TABLE}", null)
 
             // Delete the current bookmarks database.
             context.deleteDatabase(BookmarksDatabaseHelper.BOOKMARKS_DATABASE)
 
             // Delete the current bookmarks database.
             context.deleteDatabase(BookmarksDatabaseHelper.BOOKMARKS_DATABASE)
@@ -437,7 +437,7 @@ class ImportExportDatabaseHelper {
 
 
             // Get a cursor for the domains table.
 
 
             // Get a cursor for the domains table.
-            val importDomainsCursor = importDatabase.rawQuery("SELECT * FROM " + DomainsDatabaseHelper.DOMAINS_TABLE + " ORDER BY " + DomainsDatabaseHelper.DOMAIN_NAME + " ASC", null)
+            val importDomainsCursor = importDatabase.rawQuery("SELECT * FROM ${DomainsDatabaseHelper.DOMAINS_TABLE} ORDER BY ${DomainsDatabaseHelper.DOMAIN_NAME} ASC", null)
 
             // Delete the current domains database.
             context.deleteDatabase(DomainsDatabaseHelper.DOMAINS_DATABASE)
 
             // Delete the current domains database.
             context.deleteDatabase(DomainsDatabaseHelper.DOMAINS_DATABASE)
index 36f9773237eecad16c3c5518dbf60bc362960d4d..a8771e394480fcd1ada6c3ee0885080156872a17 100644 (file)
@@ -18,7 +18,7 @@
   You should have received a copy of the GNU General Public License
   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
 
   You should have received a copy of the GNU General Public License
   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
 
-<!-- This WebView displays inside of the tabs in the about and guide activities. -->
+<!-- This WebView displays inside of the tabs in the About and Guide activities. -->
 <WebView
     android:id="@+id/bare_webview"
     xmlns:android="http://schemas.android.com/apk/res/android"
 <WebView
     android:id="@+id/bare_webview"
     xmlns:android="http://schemas.android.com/apk/res/android"
index e275254add125349bd55b9486e0a5f137758e28e..09ebadaa21e60e335f2702696d9f2ac7f4da0aa2 100644 (file)
@@ -26,8 +26,8 @@ buildscript {
     }
 
     dependencies {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.1.3'
-        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
+        classpath 'com.android.tools.build:gradle:7.2.1'
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
index c61a8ca2b2ebda2cffb512a9c6e89925533f14ec..8b7f5fed811d86108bc77a8280817444616dbbab 100644 (file)
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip