]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout-w900dp/bookmarks_drawer_top_appbar.xml
Add the option to pin the bookmarks drawer. https://redmine.stoutner.com/issues/932
[PrivacyBrowserAndroid.git] / app / src / main / res / layout-w900dp / bookmarks_drawer_top_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright 2017,2019-2020,2022 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
7
8   Privacy Browser Android is free software: you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation, either version 3 of the License, or
11   (at your option) any later version.
12
13   Privacy Browser Android is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
20
21 <!-- `android:layout_width="400dp"` keeps the bookmarks drawer from filling the whole screen on a tablet. -->
22 <FrameLayout
23     android:id="@+id/bookmarks_framelayout"
24     xmlns:android="http://schemas.android.com/apk/res/android"
25     xmlns:tools="http://schemas.android.com/tools"
26     android:layout_height="match_parent"
27     android:layout_width="400dp"
28     android:layout_gravity="end" >
29
30     <LinearLayout
31         android:layout_height="match_parent"
32         android:layout_width="match_parent"
33         android:orientation="vertical"
34         android:background="?android:attr/colorBackground" >
35
36         <!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
37         <LinearLayout
38             android:id="@+id/bookmarks_header_linearlayout"
39             android:layout_height="wrap_content"
40             android:layout_width="match_parent"
41             android:orientation="horizontal"
42             tools:ignore="UseCompoundDrawables" >
43
44             <!-- Back arrow. -->
45             <ImageView
46                 android:layout_height="match_parent"
47                 android:layout_width="wrap_content"
48                 android:layout_gravity="center_vertical"
49                 android:paddingStart="15dp"
50                 android:paddingEnd="15dp"
51                 android:src="@drawable/back"
52                 android:onClick="bookmarksBack"
53                 android:contentDescription="@string/back" />
54
55             <!-- Bookmarks folder title. -->
56             <TextView
57                 android:id="@+id/bookmarks_title_textview"
58                 android:layout_height="wrap_content"
59                 android:layout_width="0dp"
60                 android:layout_weight="1"
61                 android:textStyle="bold"
62                 android:textSize="20sp"
63                 android:textColor="?android:attr/textColorPrimary"
64                 android:layout_margin="10dp" />
65
66             <!-- Pin. -->
67             <ImageView
68                 android:id="@+id/bookmarks_drawer_pinned_imageview"
69                 android:layout_height="match_parent"
70                 android:layout_width="wrap_content"
71                 android:layout_gravity="center_vertical"
72                 android:paddingStart="15dp"
73                 android:paddingEnd="20dp"
74                 android:onClick="toggleBookmarksDrawerPinned"
75                 android:contentDescription="@string/pin_drawer" />
76         </LinearLayout>
77
78         <ListView
79             android:id="@+id/bookmarks_drawer_listview"
80             android:layout_height="0dp"
81             android:layout_width="match_parent"
82             android:layout_weight="1"
83             android:divider="@color/transparent"
84             android:dividerHeight="0dp" />
85     </LinearLayout>
86
87     <com.google.android.material.floatingactionbutton.FloatingActionButton
88         android:id="@+id/launch_bookmarks_activity_fab"
89         android:layout_height="wrap_content"
90         android:layout_width="wrap_content"
91         android:layout_gravity="bottom|end"
92         android:layout_marginEnd="16dp"
93         android:layout_marginBottom="155dp"
94         android:src="@drawable/bookmarks"
95         android:tint="?attr/fabIconTintColor"
96         android:contentDescription="@string/bookmarks" />
97
98     <com.google.android.material.floatingactionbutton.FloatingActionButton
99         android:id="@+id/create_bookmark_folder_fab"
100         android:layout_height="wrap_content"
101         android:layout_width="wrap_content"
102         android:layout_gravity="bottom|end"
103         android:layout_marginEnd="16dp"
104         android:layout_marginBottom="85dp"
105         android:src="@drawable/create_folder"
106         android:tint="?attr/fabIconTintColor"
107         android:contentDescription="@string/create_folder" />
108
109     <com.google.android.material.floatingactionbutton.FloatingActionButton
110         android:id="@+id/create_bookmark_fab"
111         android:layout_height="wrap_content"
112         android:layout_width="wrap_content"
113         android:layout_gravity="bottom|end"
114         android:layout_margin="16dp"
115         android:src="@drawable/create_bookmark"
116         android:tint="?attr/fabIconTintColor"
117         android:contentDescription="@string/create_bookmark" />
118 </FrameLayout>