<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<!--
+ Copyright 2023 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
+
+ It is a modified version of `map`, which is part of the Android Material icon set and is released under the Apache License 2.0.
+
+ Privacy Browser Android 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 Android 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 Android. If not, see <http://www.gnu.org/licenses/>. -->
+
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 -960 960 960"
+ id="icon" >
+
+ <path
+ d="M160-240q-17 0-28.5-11.5T120-280q0-17 11.5-28.5T160-320h640q17 0 28.5 11.5T840-280q0 17-11.5 28.5T800-240H160Zm0-200q-17 0-28.5-11.5T120-480q0-17 11.5-28.5T160-520h640q17 0 28.5 11.5T840-480q0 17-11.5 28.5T800-440H160Zm0-200q-17 0-28.5-11.5T120-680q0-17 11.5-28.5T160-720h640q17 0 28.5 11.5T840-680q0 17-11.5 28.5T800-640H160Z" />
+</svg>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
<p><svg class="icon"><use href="../shared_images/location_off.svg#icon"/></svg> location_off.</p>
<p><svg class="icon"><use href="../shared_images/lock.svg#icon"/></svg> lock.</p>
<p><svg class="icon"><use href="../shared_images/map.svg#icon"/></svg> map.</p>
+ <p><svg class="icon"><use href="../shared_images/menu_rounded_weight400_grade0_24px.svg#icon"/></svg> menu_<wbr>rounded_<wbr>weight400_<wbr>grade0_<wbr>24px.</p>
<p><svg class="icon"><use href="../shared_images/more.svg#icon"/></svg> more.</p>
<p><svg class="icon"><use href="../shared_images/new_releases.svg#icon"/></svg> new_releases.</p>
<p><svg class="icon"><use href="../shared_images/open_in_browser.svg#icon"/></svg> open_in_browser.</p>
import androidx.activity.OnBackPressedCallback
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.ActionBar
-import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.content.res.AppCompatResources
private lateinit var userAgentNamesArrayAdapter: ArrayAdapter<CharSequence>
// Define the class variables.
- private var actionBarDrawerToggle: ActionBarDrawerToggle? = null
private var appBarHeight = 0
private var bookmarksCursor: Cursor? = null
private var bookmarksDatabaseHelper: BookmarksDatabaseHelper? = null
urlRelativeLayout = findViewById(R.id.url_relativelayout)
urlEditText = findViewById(R.id.url_edittext)
- // Create the hamburger icon at the start of the AppBar.
- actionBarDrawerToggle = ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open_navigation_drawer, R.string.close_navigation_drawer)
-
// Initially disable the sliding drawers. They will be enabled once the filter lists are loaded.
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
}
}
- public override fun onPostCreate(savedInstanceState: Bundle?) {
- // Run the default commands.
- super.onPostCreate(savedInstanceState)
-
- // Sync the state of the DrawerToggle after the default `onRestoreInstanceState()` has finished. This creates the navigation drawer icon.
- // If the app is restarting to change the app theme the action bar drawer toggle will not yet be populated.
- actionBarDrawerToggle?.syncState()
- }
-
override fun onNewIntent(intent: Intent) {
// Run the default commands.
super.onNewIntent(intent)
override fun onDrawerOpened(drawerView: View) {}
- override fun onDrawerClosed(drawerView: View) {
- // Reset the drawer icon when the drawer is closed. Otherwise, it remains an arrow if the drawer is open when the app is restarted.
- actionBarDrawerToggle!!.syncState()
- }
+ override fun onDrawerClosed(drawerView: View) {}
override fun onDrawerStateChanged(newState: Int) {
if (newState == DrawerLayout.STATE_SETTLING || newState == DrawerLayout.STATE_DRAGGING) { // A drawer is opening or closing.
currentWebView!!.loadUrl(openFilePath)
}
}
+ // The view parameter cannot be removed because it is called from the layout onClick.
+ fun openNavigationDrawer(@Suppress("UNUSED_PARAMETER")view: View) {
+ // Open the navigation drawer.
+ drawerLayout.openDrawer(GravityCompat.START)
+ }
private fun openWithApp(url: String) {
// Create an open with app intent with `ACTION_VIEW`.
<path
android:fillColor="@color/black"
android:pathData="M3,13h2v-2L3,11v2zM3,17h2v-2L3,15v2zM3,9h2L5,7L3,7v2zM7,13h14v-2L7,11v2zM7,17h14v-2L7,15v2zM7,7v2h14L21,7L7,7z" />
-</vector>
\ No newline at end of file
+</vector>
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `menu_rounded_weight400_grade0_24px`. 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="960"
+ android:viewportWidth="960" >
+
+ <path
+ android:fillColor="@color/icon"
+ android:pathData="M160,720Q143,720 131.5,708.5Q120,697 120,680Q120,663 131.5,651.5Q143,640 160,640L800,640Q817,640 828.5,651.5Q840,663 840,680Q840,697 828.5,708.5Q817,720 800,720L160,720ZM160,520Q143,520 131.5,508.5Q120,497 120,480Q120,463 131.5,451.5Q143,440 160,440L800,440Q817,440 828.5,451.5Q840,463 840,480Q840,497 828.5,508.5Q817,520 800,520L160,520ZM160,320Q143,320 131.5,308.5Q120,297 120,280Q120,263 131.5,251.5Q143,240 160,240L800,240Q817,240 828.5,251.5Q840,263 840,280Q840,297 828.5,308.5Q817,320 800,320L160,320Z" />
+</vector>
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright © 2015-2019,2022 Soren Stoutner <soren@stoutner.com>.
+ Copyright 2015-2019,2022-2023 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
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/>. -->
-<!-- A relative layout is used instead of a linear layout because the app bar does not let `android:layout_weight="1"` cause the URL text bar to fill all the available space.
- Placing the edit text inside a relative layout also draws a line under the edit text. -->
-<RelativeLayout
+
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_height="24dp"
+ android:layout_width="24dp"
+ android:layout_gravity="center_vertical"
+ android:layout_marginEnd="8dp"
+ android:src="@drawable/menu"
+ android:contentDescription="@string/navigation_drawer"
+ android:onClick="openNavigationDrawer" />
+
+ <!-- A relative layout is used instead of a linear layout because the app bar does not let `android:layout_weight="1"` cause the URL text bar to fill all the available space.
+ Placing the edit text inside a relative layout also draws a line under the edit text. -->
+ <RelativeLayout
android:id="@+id/url_relativelayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:selectAllOnFocus="true"
android:autofillHints=""
tools:ignore="UnusedAttribute" />
-</RelativeLayout>
\ No newline at end of file
+ </RelativeLayout>
+</LinearLayout>