// 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());
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;
}
// 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);
}
}
// 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);
<?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>
<?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>