]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/res/layout/import_export_bottom_appbar.xml
Add import and export of bookmarks to HTML file. https://redmine.stoutner.com/issues/91
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / import_export_bottom_appbar.xml
index 2c5759c9ee757cdacaa32ae89ec7a0f1ed7aab9e..f72fe66158d61f1a48b8390b373fcc471ae6611e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!--
-  Copyright © 2018-2022 Soren Stoutner <soren@stoutner.com>.
+  Copyright 2018-2023 Soren Stoutner <soren@stoutner.com>.
 
   This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
 
     android:layout_height="match_parent"
     android:layout_width="match_parent" >
 
-    <!-- the linear layout with `orientation="vertical"` keeps the content above the app bar layout.  `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars.-->
+    <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. -->
     <LinearLayout
         android:layout_height="match_parent"
         android:layout_width="match_parent"
-        android:orientation="vertical"
-        app:layout_dodgeInsetEdges="bottom" >
+        android:orientation="vertical" >
 
         <ScrollView
+            android:id="@+id/scrollview"
             android:layout_height="0dp"
             android:layout_width="match_parent"
             android:layout_weight="1" >
 
-            <!-- Align the cards vertically. -->
+            <!-- Align the content vertically. -->
             <LinearLayout
                 android:layout_height="wrap_content"
                 android:layout_width="match_parent"
-                android:orientation="vertical" >
+                android:orientation="vertical"
+                android:layout_marginTop="10dp" >
+
+                <!-- Settings and Bookmarks. -->
+                <TextView
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent"
+                    android:gravity="center_horizontal"
+                    android:text="@string/bookmarks_and_settings"
+                    android:textSize="30sp"
+                    android:textStyle="bold"
+                    android:textColor="?android:textColorPrimary" />
+
+                <TextView
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent"
+                    android:gravity="center_horizontal"
+                    android:layout_marginBottom="10dp"
+                    android:text="@string/sqlite_database_format"
+                    android:textSize="14sp" />
 
                 <!-- The encryption card. -->
                 <androidx.cardview.widget.CardView
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent"
-                    android:layout_marginTop="10dp"
-                    android:layout_marginBottom="5dp"
                     android:layout_marginStart="10dp"
-                    android:layout_marginEnd="10dp" >
+                    android:layout_marginEnd="10dp"
+                    android:layout_marginBottom="5dp" >
 
                     <!-- Align the contents of the card vertically. -->
                     <LinearLayout
                     </LinearLayout>
                 </androidx.cardview.widget.CardView>
 
-                <!-- The file location card. -->
+                <!-- The bookmarks and settings file location card. -->
                 <androidx.cardview.widget.CardView
-                    android:id="@+id/file_location_cardview"
+                    android:id="@+id/settings_file_location_cardview"
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent"
                     android:layout_marginTop="5dp"
                             android:orientation="horizontal" >
 
                             <RadioButton
-                                android:id="@+id/import_radiobutton"
+                                android:id="@+id/settings_import_radiobutton"
                                 android:layout_height="wrap_content"
                                 android:layout_width="wrap_content"
                                 android:text="@string/import_button"
                                 android:layout_marginEnd="10dp"
-                                android:onClick="onClickRadioButton" />
+                                android:onClick="onClickSettingsRadioButton" />
 
                             <RadioButton
-                                android:id="@+id/export_radiobutton"
+                                android:id="@+id/settings_export_radiobutton"
                                 android:layout_height="wrap_content"
                                 android:layout_width="wrap_content"
                                 android:text="@string/export"
-                                android:onClick="onClickRadioButton" />
+                                android:onClick="onClickSettingsRadioButton" />
                         </RadioGroup>
 
                         <!-- Align the edit text and the select file button horizontally. -->
                         <LinearLayout
-                            android:id="@+id/file_name_linearlayout"
+                            android:id="@+id/settings_file_name_linearlayout"
                             android:layout_height="wrap_content"
                             android:layout_width="match_parent"
                             android:orientation="horizontal"
 
                                 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
                                 <com.google.android.material.textfield.TextInputEditText
-                                    android:id="@+id/file_name_edittext"
+                                    android:id="@+id/settings_file_name_edittext"
                                     android:layout_height="wrap_content"
                                     android:layout_width="match_parent"
                                     android:hint="@string/file_name"
                             </com.google.android.material.textfield.TextInputLayout>
 
                             <Button
-                                android:id="@+id/browse_button"
+                                android:id="@+id/settings_browse_button"
                                 android:layout_height="wrap_content"
                                 android:layout_width="wrap_content"
                                 android:layout_gravity="center_vertical"
                                 android:text="@string/browse"
-                                android:onClick="browse" />
+                                android:onClick="settingsBrowse" />
                         </LinearLayout>
 
                         <!-- OpenKeychain import instructions -->
                             android:textAlignment="center" />
 
                         <Button
-                            android:id="@+id/import_export_button"
+                            android:id="@+id/settings_import_export_button"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginTop="10dp"
+                            android:text="@string/import_button"
+                            android:textSize="18sp"
+                            android:onClick="importExportSettings"
+                            app:backgroundTint="@color/button_background_selector"
+                            android:textColor="@color/button_text_selector" />
+                    </LinearLayout>
+                </androidx.cardview.widget.CardView>
+
+                <!-- Bookmarks. -->
+                <TextView
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent"
+                    android:gravity="center_horizontal"
+                    android:layout_marginTop="30dp"
+                    android:text="@string/bookmarks"
+                    android:textSize="30sp"
+                    android:textStyle="bold"
+                    android:textColor="?android:textColorPrimary" />
+
+                <TextView
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent"
+                    android:gravity="center_horizontal"
+                    android:layout_marginBottom="10dp"
+                    android:text="@string/html_format"
+                    android:textSize="14sp" />
+
+                <!-- The bookmarks file location card. -->
+                <androidx.cardview.widget.CardView
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent"
+                    android:layout_marginStart="10dp"
+                    android:layout_marginEnd="10dp"
+                    android:layout_marginBottom="20dp" >
+
+                    <!-- Align the contents of the card vertically. -->
+                    <LinearLayout
+                        android:layout_height="match_parent"
+                        android:layout_width="match_parent"
+                        android:orientation="vertical"
+                        android:layout_marginTop="10dp"
+                        android:layout_marginBottom="20dp"
+                        android:layout_marginStart="10dp"
+                        android:layout_marginEnd="10dp" >
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginBottom="6dp"
+                            android:text="@string/file_location"
+                            android:textSize="25sp"
+                            android:textStyle="bold"
+                            android:textColor="?colorAccent" />
+
+                        <RadioGroup
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:orientation="horizontal" >
+
+                            <RadioButton
+                                android:id="@+id/bookmarks_import_radiobutton"
+                                android:layout_height="wrap_content"
+                                android:layout_width="wrap_content"
+                                android:text="@string/import_button"
+                                android:layout_marginEnd="10dp"
+                                android:onClick="onClickBookmarksRadioButton" />
+
+                            <RadioButton
+                                android:layout_height="wrap_content"
+                                android:layout_width="wrap_content"
+                                android:text="@string/export"
+                                android:onClick="onClickBookmarksRadioButton" />
+                        </RadioGroup>
+
+                        <!-- Align the edit text and the select file button horizontally. -->
+                        <LinearLayout
+                            android:id="@+id/bookmarks_file_name_linearlayout"
+                            android:layout_height="wrap_content"
+                            android:layout_width="match_parent"
+                            android:orientation="horizontal"
+                            android:layout_marginTop="10dp">
+
+                            <!-- The text input layout makes the hint float above the edit text. -->
+                            <com.google.android.material.textfield.TextInputLayout
+                                android:layout_height="wrap_content"
+                                android:layout_width="0dp"
+                                android:layout_weight="1" >
+
+                                <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
+                                <com.google.android.material.textfield.TextInputEditText
+                                    android:id="@+id/bookmarks_file_name_edittext"
+                                    android:layout_height="wrap_content"
+                                    android:layout_width="match_parent"
+                                    android:hint="@string/file_name"
+                                    android:inputType="textMultiLine|textUri" />
+                            </com.google.android.material.textfield.TextInputLayout>
+
+                            <Button
+                                android:id="@+id/bookmarks_browse_button"
+                                android:layout_height="wrap_content"
+                                android:layout_width="wrap_content"
+                                android:layout_gravity="center_vertical"
+                                android:text="@string/browse"
+                                android:onClick="bookmarksBrowse" />
+                        </LinearLayout>
+
+                        <Button
+                            android:id="@+id/bookmarks_import_export_button"
                             android:layout_height="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_gravity="center_horizontal"
                             android:layout_marginTop="10dp"
                             android:text="@string/import_button"
                             android:textSize="18sp"
-                            android:onClick="importExport"
+                            android:onClick="importExportBookmarks"
                             app:backgroundTint="@color/button_background_selector"
                             android:textColor="@color/button_text_selector" />
                     </LinearLayout>
                 android:layout_width="match_parent" />
         </com.google.android.material.appbar.AppBarLayout>
     </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+</androidx.coordinatorlayout.widget.CoordinatorLayout>