]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/edit_bookmark_databaseview_dialog.xml
Fix the bookmarks dialogs to align the icons and the radio buttons. https://redmine...
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / edit_bookmark_databaseview_dialog.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2016-2021 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
7
8   Privacy Browser 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 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.  If not, see <http://www.gnu.org/licenses/>. -->
20
21 <ScrollView
22     xmlns:android="http://schemas.android.com/apk/res/android"
23     xmlns:tools="http://schemas.android.com/tools"
24     android:layout_height="wrap_content"
25     android:layout_width="match_parent" >
26
27     <!-- Setting `android:focusable` and `android:focusableInTouchMode` prevents the display order edit text from being autoselected. -->
28     <LinearLayout
29         android:layout_height="wrap_content"
30         android:layout_width="match_parent"
31         android:orientation="vertical"
32         android:focusable="true"
33         android:focusableInTouchMode="true" >
34
35         <!-- Database ID. -->
36         <LinearLayout
37             android:layout_height="wrap_content"
38             android:layout_width="match_parent"
39             android:layout_marginTop="12dp"
40             android:layout_marginBottom="6dp"
41             android:layout_marginStart="7dp"
42             android:layout_marginEnd="7dp" >
43
44             <TextView
45                 android:layout_height="wrap_content"
46                 android:layout_width="wrap_content"
47                 android:text="@string/database_id"
48                 android:textSize="18sp"
49                 android:textColor="?android:textColorPrimary"
50                 android:layout_marginEnd="8dp" />
51
52             <TextView
53                 android:id="@+id/bookmark_database_id_textview"
54                 android:layout_height="wrap_content"
55                 android:layout_width="wrap_content"
56                 android:textSize="18sp"
57                 android:textColor="@color/gray_500" />
58         </LinearLayout>
59
60         <!-- Current icon. -->
61         <LinearLayout
62             android:id="@+id/current_icon_linearlayout"
63             android:layout_height="wrap_content"
64             android:layout_width="match_parent"
65             android:orientation="horizontal"
66             android:layout_marginTop="6dp"
67             android:layout_marginBottom="6dp" >
68
69             <RadioButton
70                 android:id="@id/current_icon_radiobutton"
71                 android:layout_height="wrap_content"
72                 android:layout_width="wrap_content"
73                 android:layout_gravity="center_vertical"
74                 android:checked="true" />
75
76             <ImageView
77                 android:id="@+id/current_icon_imageview"
78                 android:layout_width="30dp"
79                 android:layout_height="30dp"
80                 android:layout_gravity="center_vertical"
81                 tools:ignore="ContentDescription" />
82
83             <TextView
84                 android:layout_height="wrap_content"
85                 android:layout_width="wrap_content"
86                 android:layout_marginStart="7dp"
87                 android:layout_gravity="center_vertical"
88                 android:text="@string/current_bookmark_icon"
89                 android:textSize="18sp"
90                 android:textColor="?android:textColorPrimary" />
91         </LinearLayout>
92
93         <!-- Webpage favorite icon. -->
94         <LinearLayout
95             android:id="@+id/webpage_favorite_icon_linearlayout"
96             android:layout_height="wrap_content"
97             android:layout_width="wrap_content"
98             android:orientation="horizontal"
99             android:layout_marginTop="6dp"
100             android:layout_marginBottom="6dp" >
101
102             <RadioButton
103                 android:id="@+id/webpage_favorite_icon_radiobutton"
104                 android:layout_height="wrap_content"
105                 android:layout_width="wrap_content"
106                 android:layout_gravity="center_vertical" />
107
108             <ImageView
109                 android:id="@+id/webpage_favorite_icon_imageview"
110                 android:layout_height="30dp"
111                 android:layout_width="30dp"
112                 android:layout_gravity="center_vertical"
113                 tools:ignore="ContentDescription" />
114
115             <TextView
116                 android:layout_height="wrap_content"
117                 android:layout_width="wrap_content"
118                 android:layout_marginStart="7dp"
119                 android:layout_gravity="center_vertical"
120                 android:text="@string/webpage_favorite_icon"
121                 android:textSize="18sp"
122                 android:textColor="?android:textColorPrimary" />
123         </LinearLayout>
124
125         <!-- Bookmark name.  The text input layout makes the `android:hint` float above the edit text. -->
126         <com.google.android.material.textfield.TextInputLayout
127             android:layout_height="wrap_content"
128             android:layout_width="match_parent"
129             android:layout_marginTop="12dp"
130             android:layout_marginBottom="6dp"
131             android:layout_marginStart="4dp"
132             android:layout_marginEnd="4dp" >
133
134             <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.  `android:inputType="textUri"` disables spell check in the edit text. -->
135             <com.google.android.material.textfield.TextInputEditText
136                 android:id="@+id/bookmark_name_edittext"
137                 android:layout_height="wrap_content"
138                 android:layout_width="match_parent"
139                 android:hint="@string/bookmark_name"
140                 android:imeOptions="actionGo"
141                 android:inputType="textUri"
142                 android:selectAllOnFocus="true" />
143         </com.google.android.material.textfield.TextInputLayout>
144
145         <!-- URL.  The text input layout makes the `android:hint` float above the edit text. -->
146         <com.google.android.material.textfield.TextInputLayout
147             android:layout_height="wrap_content"
148             android:layout_width="match_parent"
149             android:layout_marginTop="6dp"
150             android:layout_marginBottom="6dp"
151             android:layout_marginStart="4dp"
152             android:layout_marginEnd="4dp" >
153
154             <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.  `android:inputType="textUri"` disables spell check in the edit text. -->
155             <com.google.android.material.textfield.TextInputEditText
156                 android:id="@+id/bookmark_url_edittext"
157                 android:layout_height="wrap_content"
158                 android:layout_width="match_parent"
159                 android:hint="@string/bookmark_url"
160                 android:imeOptions="actionGo"
161                 android:inputType="textUri"
162                 android:selectAllOnFocus="true" />
163         </com.google.android.material.textfield.TextInputLayout>
164
165         <!-- Folder. -->
166         <LinearLayout
167             android:layout_height="wrap_content"
168             android:layout_width="match_parent"
169             android:orientation="horizontal"
170             android:layout_marginTop="6dp"
171             android:layout_marginStart="7dp"
172             android:layout_marginEnd="7dp" >
173
174             <TextView
175                 android:layout_height="wrap_content"
176                 android:layout_width="wrap_content"
177                 android:text="@string/folder"
178                 android:textSize="18sp"
179                 android:textColor="?android:textColorPrimary" />
180
181             <Spinner
182                 android:id="@+id/bookmark_folder_spinner"
183                 android:layout_height="wrap_content"
184                 android:layout_width="wrap_content" />
185         </LinearLayout>
186
187         <!-- Display order. -->
188         <LinearLayout
189             android:layout_height="match_parent"
190             android:layout_width="match_parent"
191             android:orientation="horizontal"
192             android:layout_marginTop="6dp"
193             android:layout_marginBottom="6dp"
194             android:layout_marginStart="7dp"
195             android:layout_marginEnd="7dp" >
196
197             <TextView
198                 android:layout_height="wrap_content"
199                 android:layout_width="wrap_content"
200                 android:text="@string/display_order"
201                 android:textSize="18sp"
202                 android:textColor="?android:textColorPrimary"
203                 android:layout_marginEnd="6dp"
204                 android:labelFor="@+id/bookmark_display_order_edittext"/>
205
206             <EditText
207                 android:id="@id/bookmark_display_order_edittext"
208                 android:layout_height="wrap_content"
209                 android:layout_width="match_parent"
210                 android:imeOptions="actionGo"
211                 android:inputType="number"
212                 android:selectAllOnFocus="true"
213                 android:importantForAutofill="no"
214                 tools:targetApi="26" />
215         </LinearLayout>
216     </LinearLayout>
217 </ScrollView>