Migrate to AndroidX from the Android Support Library. https://redmine.stoutner.com...
[PrivacyBrowser.git] / app / src / main / res / layout / edit_bookmark_databaseview_dialog.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2016-2019 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` prevent `edit_bookmark_display_order_edittext` from being autoselected. -->
28     <LinearLayout
29         xmlns:tools="http://schemas.android.com/tools"
30         android:layout_height="wrap_content"
31         android:layout_width="match_parent"
32         android:orientation="vertical"
33         android:focusable="true"
34         android:focusableInTouchMode="true" >
35
36         <!-- Database ID. -->
37         <LinearLayout
38             android:layout_height="wrap_content"
39             android:layout_width="match_parent"
40             android:layout_marginTop="12dp"
41             android:layout_marginBottom="6dp"
42             android:layout_marginStart="7dp"
43             android:layout_marginEnd="7dp" >
44
45             <TextView
46                 android:layout_height="wrap_content"
47                 android:layout_width="wrap_content"
48                 android:text="@string/database_id"
49                 android:textSize="18sp"
50                 android:textColor="?android:textColorPrimary"
51                 android:layout_marginEnd="8dp" />
52
53             <TextView
54                 android:id="@+id/edit_bookmark_database_id_textview"
55                 android:layout_height="wrap_content"
56                 android:layout_width="wrap_content"
57                 android:textSize="18sp"
58                 android:textColor="@color/gray_500" />
59         </LinearLayout>
60
61         <!-- The icon selection rows. -->
62         <LinearLayout
63             android:layout_height="wrap_content"
64             android:layout_width="match_parent"
65             android:orientation="horizontal" >
66
67             <!-- The column displaying the icons. -->
68             <LinearLayout
69                 android:layout_height="wrap_content"
70                 android:layout_width="wrap_content"
71                 android:orientation="vertical"
72                 android:layout_marginStart="7dp" >
73
74                 <ImageView
75                     android:id="@+id/edit_bookmark_current_icon"
76                     android:layout_width="30dp"
77                     android:layout_height="30dp"
78                     android:layout_marginTop="6dp"
79                     android:layout_marginBottom="6dp"
80                     android:layout_gravity="center_vertical"
81                     tools:ignore="ContentDescription" />
82
83                 <ImageView
84                     android:id="@+id/edit_bookmark_webpage_favorite_icon"
85                     android:layout_width="30dp"
86                     android:layout_height="30dp"
87                     android:layout_marginTop="6dp"
88                     android:layout_marginBottom="6dp"
89                     android:layout_gravity="center_vertical"
90                     tools:ignore="ContentDescription" />
91             </LinearLayout>
92
93             <!-- The column with the `RadioGroup`. -->
94             <RadioGroup
95                 android:id="@+id/edit_bookmark_icon_radiogroup"
96                 android:layout_height="wrap_content"
97                 android:layout_width="match_parent"
98                 android:checkedButton="@+id/edit_bookmark_current_icon_radiobutton" >
99
100                 <RadioButton
101                     android:id="@id/edit_bookmark_current_icon_radiobutton"
102                     android:layout_height="wrap_content"
103                     android:layout_width="wrap_content"
104                     android:layout_marginTop="6dp"
105                     android:layout_marginBottom="4dp"
106                     android:text="@string/current_bookmark_icon"
107                     android:textSize="18sp"
108                     android:textColor="?android:textColorPrimary" />
109
110                 <RadioButton
111                     android:id="@+id/edit_bookmark_webpage_favorite_icon_radiobutton"
112                     android:layout_height="wrap_content"
113                     android:layout_width="wrap_content"
114                     android:layout_marginTop="5dp"
115                     android:text="@string/web_page_favorite_icon"
116                     android:textSize="18sp"
117                     android:textColor="?android:textColorPrimary" />
118             </RadioGroup>
119         </LinearLayout>
120
121         <!-- Bookmark name.  The `TextInputLayout` makes the `android:hint` float above the `EditText`. -->
122         <com.google.android.material.textfield.TextInputLayout
123             android:layout_height="wrap_content"
124             android:layout_width="match_parent"
125             android:layout_marginTop="12dp"
126             android:layout_marginBottom="6dp"
127             android:layout_marginStart="4dp"
128             android:layout_marginEnd="4dp" >
129
130             <!-- `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 `EditText`. -->
131             <com.google.android.material.textfield.TextInputEditText
132                 android:id="@+id/edit_bookmark_name_edittext"
133                 android:layout_height="wrap_content"
134                 android:layout_width="match_parent"
135                 android:hint="@string/bookmark_name"
136                 android:imeOptions="actionGo"
137                 android:inputType="textUri"
138                 android:selectAllOnFocus="true" />
139         </com.google.android.material.textfield.TextInputLayout>
140
141         <!-- URL.  The `TextInputLayout` makes the `android:hint` float above the `EditText`. -->
142         <com.google.android.material.textfield.TextInputLayout
143             android:layout_height="wrap_content"
144             android:layout_width="match_parent"
145             android:layout_marginTop="6dp"
146             android:layout_marginBottom="6dp"
147             android:layout_marginStart="4dp"
148             android:layout_marginEnd="4dp" >
149
150             <!-- `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 `EditText`. -->
151             <com.google.android.material.textfield.TextInputEditText
152                 android:id="@+id/edit_bookmark_url_edittext"
153                 android:layout_height="wrap_content"
154                 android:layout_width="match_parent"
155                 android:hint="@string/bookmark_url"
156                 android:imeOptions="actionGo"
157                 android:inputType="textUri"
158                 android:selectAllOnFocus="true" />
159         </com.google.android.material.textfield.TextInputLayout>
160
161         <!-- Folder. -->
162         <LinearLayout
163             android:layout_height="wrap_content"
164             android:layout_width="match_parent"
165             android:orientation="horizontal"
166             android:layout_marginTop="6dp"
167             android:layout_marginStart="7dp"
168             android:layout_marginEnd="7dp" >
169
170             <TextView
171                 android:layout_height="wrap_content"
172                 android:layout_width="wrap_content"
173                 android:text="@string/folder"
174                 android:textSize="18sp"
175                 android:textColor="?android:textColorPrimary" />
176
177             <Spinner
178                 android:id="@+id/edit_bookmark_folder_spinner"
179                 android:layout_height="wrap_content"
180                 android:layout_width="wrap_content" />
181         </LinearLayout>
182
183         <!-- Display order. -->
184         <LinearLayout
185             android:layout_height="match_parent"
186             android:layout_width="match_parent"
187             android:orientation="horizontal"
188             android:layout_marginTop="6dp"
189             android:layout_marginBottom="6dp"
190             android:layout_marginStart="7dp"
191             android:layout_marginEnd="7dp" >
192
193             <TextView
194                 android:layout_height="wrap_content"
195                 android:layout_width="wrap_content"
196                 android:text="@string/display_order"
197                 android:textSize="18sp"
198                 android:textColor="?android:textColorPrimary"
199                 android:layout_marginEnd="6dp"
200                 android:labelFor="@+id/edit_bookmark_display_order_edittext"/>
201
202             <EditText
203                 android:id="@id/edit_bookmark_display_order_edittext"
204                 android:layout_height="wrap_content"
205                 android:layout_width="match_parent"
206                 android:imeOptions="actionGo"
207                 android:inputType="number"
208                 android:selectAllOnFocus="true"
209                 android:importantForAutofill="no"
210                 tools:targetApi="26" />
211         </LinearLayout>
212     </LinearLayout>
213 </ScrollView>