]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Fix the GUI displaying under the loading blocklists screen on restart. https://redmin...
authorSoren Stoutner <soren@stoutner.com>
Tue, 8 Nov 2022 23:52:15 +0000 (16:52 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 8 Nov 2022 23:52:15 +0000 (16:52 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/asynctasks/PopulateBlocklists.java
app/src/main/res/layout/main_framelayout_bottom_appbar.xml
app/src/main/res/layout/main_framelayout_top_appbar.xml

index a21848a5ed5530e135fdfd2ca2206a89aec71a18..1b34ffd8bd8c961bfbca9e7dd358ab3103a52ea5 100644 (file)
@@ -589,6 +589,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
         // Initially disable the sliding drawers.  They will be enabled once the blocklists are loaded.
         drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
 
+        // Initially hide the user interface so that only the blocklist loading screen is shown (if reloading).
+        drawerLayout.setVisibility(View.GONE);
+
         // Initialize the web view pager adapter.
         webViewPagerAdapter = new WebViewPagerAdapter(getSupportFragmentManager());
 
index 99ccd45fd83e23f8258c1cf6c230c002b918e5c7..af2bea14001fe28ea2b0f288a36c0f58a0cb96d0 100644 (file)
@@ -23,11 +23,9 @@ import android.app.Activity;
 import android.content.Context;
 import android.os.AsyncTask;
 import android.view.View;
-import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
-import androidx.appcompat.widget.Toolbar;
 import androidx.drawerlayout.widget.DrawerLayout;
 
 import com.stoutner.privacybrowser.R;
@@ -74,14 +72,8 @@ public class PopulateBlocklists extends AsyncTask<Void, String, ArrayList<ArrayL
         }
 
         // Get handles for the views.
-        Toolbar toolbar = activity.findViewById(R.id.toolbar);
-        LinearLayout tabsLinearLayout = activity.findViewById(R.id.tabs_linearlayout);
         RelativeLayout loadingBlocklistsRelativeLayout = activity.findViewById(R.id.loading_blocklists_relativelayout);
 
-        // Hide the toolbar and tabs linear layout, which will be visible if this is being run after the app process has been killed in the background.
-        toolbar.setVisibility(View.GONE);
-        tabsLinearLayout.setVisibility(View.GONE);
-
         // Show the loading blocklists screen.
         loadingBlocklistsRelativeLayout.setVisibility(View.VISIBLE);
     }
@@ -222,14 +214,11 @@ public class PopulateBlocklists extends AsyncTask<Void, String, ArrayList<ArrayL
         }
 
         // Get handles for the views.
-        Toolbar toolbar = activity.findViewById(R.id.toolbar);
         DrawerLayout drawerLayout = activity.findViewById(R.id.drawerlayout);
-        LinearLayout tabsLinearLayout = activity.findViewById(R.id.tabs_linearlayout);
         RelativeLayout loadingBlocklistsRelativeLayout = activity.findViewById(R.id.loading_blocklists_relativelayout);
 
-        // Show the toolbar and tabs linear layout.
-        toolbar.setVisibility(View.VISIBLE);
-        tabsLinearLayout.setVisibility(View.VISIBLE);
+        // Show the drawer layout.
+        drawerLayout.setVisibility(View.VISIBLE);
 
         // Hide the loading blocklists screen.
         loadingBlocklistsRelativeLayout.setVisibility(View.GONE);
index 694c810fe19592ebd8c045e1c134edc390794180..f9bfce5f7aafe1f94ad4fd63ee7eba7f41684031 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!--
-  Copyright © 2015-2017,2019-2022 Soren Stoutner <soren@stoutner.com>.
+  Copyright 2015-2017,2019-2022 Soren Stoutner <soren@stoutner.com>.
 
   This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
 
                     android:layout_gravity="bottom"
                     app:layout_dodgeInsetEdges="bottom" >
 
-                    <!-- The tab linear layout.  It sets the background to the right of the add tab button.
-                        It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+                    <!-- The tab linear layout.  It sets the background to the right of the add tab button. -->
                     <LinearLayout
                         android:id="@+id/tabs_linearlayout"
                         android:layout_height="wrap_content"
                         android:layout_width="wrap_content"
-                        android:orientation="horizontal"
-                        android:visibility="gone" >
+                        android:orientation="horizontal" >
 
                         <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
                         <ImageView
                             android:contentDescription="@string/add_tab" />
                     </LinearLayout>
 
-                    <!-- The find on page linear layout.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+                    <!-- The find on page linear layout.  It is initially `visibility="gone"` and is only displayed when requested. -->
                     <LinearLayout
                         android:id="@+id/find_on_page_linearlayout"
                         android:layout_height="wrap_content"
                             app:tint="?attr/findOnPageIconTintColor" />
                     </LinearLayout>
 
-                    <!-- The toolbar.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+                    <!-- The toolbar. -->
                     <androidx.appcompat.widget.Toolbar
                         android:id="@+id/toolbar"
                         android:layout_height="wrap_content"
-                        android:layout_width="match_parent"
-                        android:visibility="gone" />
+                        android:layout_width="match_parent" />
                 </com.google.android.material.appbar.AppBarLayout>
         </androidx.coordinatorlayout.widget.CoordinatorLayout>
 
             android:textAlignment="center"
             android:textColor="?android:attr/textColorPrimary" />
     </RelativeLayout>
-</FrameLayout>
\ No newline at end of file
+</FrameLayout>
index 362df1a2d409e0f1bfe624ee4e9d164100d0504d..afb43e1953c861972eef2509276a8aafc9027a69 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!--
-  Copyright © 2015-2017,2019-2022 Soren Stoutner <soren@stoutner.com>.
+  Copyright 2015-2017,2019-2022 Soren Stoutner <soren@stoutner.com>.
 
   This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
 
                 android:layout_width="match_parent"
                 android:theme="@style/PrivacyBrowserAppBar" >
 
-                <!-- The toolbar.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+                <!-- The toolbar. -->
                 <androidx.appcompat.widget.Toolbar
                     android:id="@+id/toolbar"
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent"
-                    android:visibility="gone"
                     app:layout_scrollFlags="scroll|enterAlways|snap" />
 
-                <!-- The find on page linear layout.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+                <!-- The find on page linear layout.  It is initially `visibility="gone"` and is only displayed when requested. -->
                 <LinearLayout
                     android:id="@+id/find_on_page_linearlayout"
                     android:layout_height="wrap_content"
                         app:tint="?attr/findOnPageIconTintColor" />
                 </LinearLayout>
 
-                <!-- The tab linear layout.  It sets the background to the right of the add tab button.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+                <!-- The tab linear layout.  It sets the background to the right of the add tab button. -->
                 <LinearLayout
                     android:id="@+id/tabs_linearlayout"
                     android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
                     android:orientation="horizontal"
-                    android:visibility="gone"
                     app:layout_scrollFlags="scroll|enterAlways|snap" >
 
                     <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
             android:textAlignment="center"
             android:textColor="?android:attr/textColorPrimary" />
     </RelativeLayout>
-</FrameLayout>
\ No newline at end of file
+</FrameLayout>