Add password encrypted export.
[PrivacyBrowser.git] / app / src / main / res / layout / import_export_coordinatorlayout.xml
index 3ecc1aec9d99b589b1aab0652998028ba8164f7c..f3c7cefeb4b2cf9a2b81309f9e2cd87336ab19ef 100644 (file)
@@ -58,7 +58,7 @@
                 android:layout_width="match_parent"
                 android:orientation="vertical" >
 
-                <!-- The export card. -->
+                <!-- The encryption card. -->
                 <android.support.v7.widget.CardView
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_gravity="center_horizontal"
                             android:layout_marginBottom="6dp"
-                            android:text="@string/export_settings"
+                            android:text="@string/encryption"
                             android:textSize="25sp"
                             android:textStyle="bold"
-                            android:textColor="?android:textColorPrimary" />
+                            android:textColor="?colorAccent" />
 
-                        <!-- Align the export EditText and the select file button horizontally. -->
-                        <LinearLayout
+                        <Spinner
+                            android:id="@+id/encryption_spinner"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal" />
+
+                        <!-- The encryption password. -->
+                        <android.support.design.widget.TextInputLayout
+                            android:id="@+id/password_encryption_textinputlayout"
                             android:layout_height="wrap_content"
                             android:layout_width="match_parent"
-                            android:orientation="horizontal" >
+                            app:passwordToggleEnabled="true" >
 
-                            <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
-                            <android.support.design.widget.TextInputLayout
+                            <android.support.design.widget.TextInputEditText
+                                android:id="@+id/password_encryption_edittext"
                                 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. -->
-                                <android.support.design.widget.TextInputEditText
-                                    android:id="@+id/export_file_edittext"
-                                    android:layout_height="wrap_content"
-                                    android:layout_width="match_parent"
-                                    android:hint="@string/export_file_name"
-                                    android:inputType="textMultiLine|textUri" />
-                            </android.support.design.widget.TextInputLayout>
-
-                            <Button
-                                android:id="@+id/select_export_file"
-                                android:layout_height="wrap_content"
-                                android:layout_width="wrap_content"
-                                android:layout_gravity="center_vertical"
-                                android:text="@string/browse"
-                                android:onClick="exportBrowse" />
-                        </LinearLayout>
-
-                        <Button
-                            android:id="@+id/export_button"
-                            android:layout_height="wrap_content"
-                            android:layout_width="wrap_content"
-                            android:layout_gravity="center_horizontal"
-                            android:text="@string/export"
-                            android:textSize="18sp"
-                            android:onClick="onClickExport" />
+                                android:layout_width="match_parent"
+                                android:hint="@string/password"
+                                android:inputType="textPassword"/>
+                        </android.support.design.widget.TextInputLayout>
                     </LinearLayout>
                 </android.support.v7.widget.CardView>
 
-                <!-- The import card. -->
+                <!-- The file location card. -->
                 <android.support.v7.widget.CardView
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent"
                     android:layout_marginTop="5dp"
-                    android:layout_marginBottom="10dp"
+                    android:layout_marginBottom="5dp"
                     android:layout_marginStart="10dp"
                     android:layout_marginEnd="10dp" >
 
                             android:layout_height="wrap_content"
                             android:layout_gravity="center_horizontal"
                             android:layout_marginBottom="6dp"
-                            android:text="@string/import_settings"
+                            android:text="@string/file_location"
                             android:textSize="25sp"
                             android:textStyle="bold"
-                            android:textColor="?android:textColorPrimary" />
+                            android:textColor="?colorAccent" />
+
+                        <Spinner
+                            android:id="@+id/import_export_spinner"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal" />
 
-                        <!-- Align the import EditText and the select file button horizontally. -->
+                        <!-- Align the EditText and the select file button horizontally. -->
                         <LinearLayout
                             android:layout_height="wrap_content"
                             android:layout_width="match_parent"
-                            android:orientation="horizontal" >
+                            android:orientation="horizontal"
+                            android:layout_marginTop="10dp">
 
                             <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
                             <android.support.design.widget.TextInputLayout
 
                                 <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
                                 <android.support.design.widget.TextInputEditText
-                                    android:id="@+id/import_file_edittext"
+                                    android:id="@+id/file_name_edittext"
                                     android:layout_height="wrap_content"
                                     android:layout_width="match_parent"
-                                    android:hint="@string/import_file_name"
+                                    android:hint="@string/file_name"
                                     android:inputType="textMultiLine|textUri" />
                             </android.support.design.widget.TextInputLayout>
 
                             <Button
-                                android:id="@+id/select_import_file"
+                                android:id="@+id/browser_button"
                                 android:layout_height="wrap_content"
                                 android:layout_width="wrap_content"
                                 android:layout_gravity="center_vertical"
                                 android:text="@string/browse"
-                                android:onClick="importBrowse" />
+                                android:onClick="browse" />
                         </LinearLayout>
 
-                        <!-- `import` is a reserved word and cannot be used for the `onClick` name. -->
                         <Button
-                            android:id="@+id/import_button"
+                            android:id="@+id/import_export_button"
                             android:layout_height="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_gravity="center_horizontal"
                             android:text="@string/import_button"
                             android:textSize="18sp"
-                            android:onClick="onClickImport" />
+                            android:onClick="importExport"
+                            app:backgroundTint="?attr/buttonBackgroundColorSelector"
+                            android:textColor="?attr/buttonTextColorSelector" />
                     </LinearLayout>
                 </android.support.v7.widget.CardView>