30fc90ecdb1560df3a627784e692105cea328cb2
[PrivacyBrowser.git] / app / src / main / res / layout / edit_bookmark_folder_databaseview_dialog.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2016-2017 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     android:layout_height="wrap_content"
24     android:layout_width="match_parent" >
25
26     <!-- Setting `android:focusable` and `android:focusableInTouchMode` prevent `edit_bookmark_display_order_edittext` from being autoselected. -->
27     <LinearLayout
28         xmlns:tools="http://schemas.android.com/tools"
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="?attr/primaryTextColorSelector"
50                 android:layout_marginEnd="8dp" />
51
52             <TextView
53                 android:id="@+id/edit_folder_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         <!-- The icon selection rows. -->
61         <LinearLayout
62             android:layout_height="wrap_content"
63             android:layout_width="match_parent"
64             android:orientation="horizontal" >
65
66             <!-- The column displaying the icons. -->
67             <LinearLayout
68                 android:layout_height="wrap_content"
69                 android:layout_width="wrap_content"
70                 android:layout_marginStart="16dp"
71                 android:layout_marginEnd="10dp"
72                 android:orientation="vertical" >
73
74                 <ImageView
75                     android:id="@+id/edit_folder_current_icon_imageview"
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_folder_default_icon_imageview"
85                     android:layout_height="30dp"
86                     android:layout_width="30dp"
87                     android:layout_marginTop="6dp"
88                     android:layout_marginBottom="6dp"
89                     android:layout_gravity="center_vertical"
90                     android:src="@drawable/folder_blue_bitmap"
91                     tools:ignore="ContentDescription" />
92
93                 <ImageView
94                     android:id="@+id/edit_folder_webpage_favorite_icon_imageview"
95                     android:layout_width="30dp"
96                     android:layout_height="30dp"
97                     android:layout_marginTop="6dp"
98                     android:layout_marginBottom="6dp"
99                     tools:ignore="ContentDescription" />
100             </LinearLayout>
101
102             <!-- The column with the `RadioGroup`. -->
103             <RadioGroup
104                 android:id="@+id/edit_folder_icon_radiogroup"
105                 android:layout_height="wrap_content"
106                 android:layout_width="match_parent"
107                 android:checkedButton="@+id/edit_folder_current_icon_radiobutton" >
108
109                 <RadioButton
110                     android:id="@id/edit_folder_current_icon_radiobutton"
111                     android:layout_height="wrap_content"
112                     android:layout_width="wrap_content"
113                     android:layout_marginTop="6dp"
114                     android:layout_marginBottom="4dp"
115                     android:text="@string/current_bookmark_icon"
116                     android:textSize="18sp" />
117
118                 <RadioButton
119                     android:id="@+id/edit_folder_default_icon_radiobutton"
120                     android:layout_width="wrap_content"
121                     android:layout_height="wrap_content"
122                     android:layout_marginTop="5dp"
123                     android:layout_marginBottom="4dp"
124                     android:text="@string/default_folder_icon"
125                     android:textSize="18sp" />
126
127                 <RadioButton
128                     android:id="@+id/edit_folder_webpage_favorite_icon_radiobutton"
129                     android:layout_height="wrap_content"
130                     android:layout_width="wrap_content"
131                     android:layout_marginTop="5dp"
132                     android:text="@string/web_page_favorite_icon"
133                     android:textSize="18sp" />
134             </RadioGroup>
135         </LinearLayout>
136
137         <!-- Folder name.  `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
138         <android.support.design.widget.TextInputLayout
139             android:layout_height="wrap_content"
140             android:layout_width="match_parent"
141             android:layout_marginTop="12dp"
142             android:layout_marginBottom="12dp"
143             android:layout_marginStart="4dp"
144             android:layout_marginEnd="4dp" >
145
146             <!-- `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`. -->
147             <android.support.design.widget.TextInputEditText
148                 android:id="@+id/edit_folder_name_edittext"
149                 android:layout_height="wrap_content"
150                 android:layout_width="match_parent"
151                 android:hint="@string/folder_name"
152                 android:imeOptions="actionGo"
153                 android:inputType="textUri"
154                 android:selectAllOnFocus="true" />
155         </android.support.design.widget.TextInputLayout>
156
157         <!-- Folder. -->
158         <LinearLayout
159             android:layout_height="wrap_content"
160             android:layout_width="match_parent"
161             android:orientation="horizontal"
162             android:layout_marginTop="6dp"
163             android:layout_marginStart="7dp"
164             android:layout_marginEnd="7dp" >
165
166             <TextView
167                 android:layout_height="wrap_content"
168                 android:layout_width="wrap_content"
169                 android:text="@string/parent_folder"
170                 android:textSize="18sp"
171                 android:textColor="?attr/primaryTextColorSelector" />
172
173             <Spinner
174                 android:id="@+id/edit_folder_parent_folder_spinner"
175                 android:layout_height="wrap_content"
176                 android:layout_width="wrap_content" />
177         </LinearLayout>
178
179         <!-- Display order. -->
180         <LinearLayout
181             android:layout_height="match_parent"
182             android:layout_width="match_parent"
183             android:orientation="horizontal"
184             android:layout_marginTop="6dp"
185             android:layout_marginStart="7dp"
186             android:layout_marginEnd="7dp" >
187
188             <TextView
189                 android:layout_height="wrap_content"
190                 android:layout_width="wrap_content"
191                 android:text="@string/display_order"
192                 android:textSize="18sp"
193                 android:textColor="?attr/primaryTextColorSelector"
194                 android:layout_marginEnd="6dp"
195                 android:labelFor="@+id/edit_folder_display_order_edittext"/>
196
197             <EditText
198                 android:id="@id/edit_folder_display_order_edittext"
199                 android:layout_height="wrap_content"
200                 android:layout_width="match_parent"
201                 android:imeOptions="actionGo"
202                 android:inputType="number"
203                 android:selectAllOnFocus="true" />
204         </LinearLayout>
205
206         <TextView
207             android:layout_height="wrap_content"
208             android:layout_width="match_parent"
209             android:gravity="center_horizontal"
210             android:text="@string/folder_names_must_be_unique" />
211     </LinearLayout>
212 </ScrollView>