diff options
Diffstat (limited to 'OpenKeychain')
4 files changed, 373 insertions, 435 deletions
diff --git a/OpenKeychain/src/main/res/layout-land/backup_code_fragment.xml b/OpenKeychain/src/main/res/layout-land/backup_code_fragment.xml index fd8cd21f0..3157bbfd3 100644 --- a/OpenKeychain/src/main/res/layout-land/backup_code_fragment.xml +++ b/OpenKeychain/src/main/res/layout-land/backup_code_fragment.xml @@ -1,295 +1,278 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" xmlns:custom="http://schemas.android.com/apk/res-auto" - android:orientation="vertical" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:orientation="vertical" android:paddingTop="20dp"> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/title_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/title_animator" android:inAnimation="@anim/fade_in" android:outAnimation="@anim/fade_out" custom:initialView="0"> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_explanation" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_explanation" /> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_enter" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_enter" /> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_ok" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_ok" /> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/code_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/code_animator" + android:layout_marginBottom="15dp" + android:layout_marginTop="15dp" android:inAnimation="@anim/fade_in" android:outAnimation="@anim/fade_out" - android:layout_marginTop="15dp" - android:layout_marginBottom="15dp" custom:initialView="1"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - > + android:layout_gravity="center_horizontal"> <TextView + android:id="@+id/backup_code_display_1" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_1" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="ABCDEF" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="ABCDEF" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_2" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_2" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="GHIJKL" - tools:ignore="SpUsage" /> + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="SpUsage" + tools:text="GHIJKL" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_3" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_3" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="MNOPQR" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="MNOPQR" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_4" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_4" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="STUVWX" + android:singleLine="true" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="STUVWX" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - > + android:layout_gravity="center_horizontal"> <!-- The most reliable way to correctly size these I found was to put a transparent hint on them. Theoretically, this should be what the android:ems attribute is for - didn't work for me. --> <EditText + android:id="@+id/backup_code_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_1" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" + android:hint="ABCDEF" android:inputType="textNoSuggestions|textCapCharacters" - android:hint="______" - android:textColorHint="@android:color/transparent" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_2" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" + android:hint="ABCDEF" android:inputType="textNoSuggestions|textCapCharacters" - android:hint="______" - android:textColorHint="@android:color/transparent" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_3" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" + android:hint="ABCDEF" android:inputType="textNoSuggestions|textCapCharacters" - android:hint="______" - android:textColorHint="@android:color/transparent" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> + <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_4" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" + android:hint="ABCDEF" android:inputType="textNoSuggestions|textCapCharacters" - android:hint="______" - android:textColorHint="@android:color/transparent" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> </LinearLayout> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/status_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/status_animator" android:inAnimation="@anim/fade_in_delayed" android:outAnimation="@anim/fade_out" custom:initialView="2"> <Button + android:id="@+id/button_backup_input" + style="?android:buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_margin="10dp" - android:text="@string/btn_code_wrotedown" android:drawableLeft="@drawable/ic_mode_edit_grey_24dp" android:drawablePadding="8dp" android:padding="12dp" - android:id="@+id/button_backup_input" - style="?android:buttonBarButtonStyle" - /> + android:text="@string/btn_code_wrotedown" /> <Space android:layout_width="wrap_content" @@ -302,59 +285,55 @@ android:orientation="horizontal"> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" - android:text="@string/backup_code_wrong" - style="?android:textAppearanceMedium" - /> + android:text="@string/backup_code_wrong" /> <Button + android:id="@+id/button_backup_back" + style="?android:buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="10dp" android:layout_gravity="center_horizontal" - android:padding="12dp" - android:text="@string/btn_backup_back" + android:layout_margin="10dp" android:drawableLeft="@drawable/ic_repeat_grey_24dp" android:drawablePadding="8dp" - android:id="@+id/button_backup_back" - style="?android:buttonBarButtonStyle" - /> + android:padding="12dp" + android:text="@string/btn_backup_back" /> </LinearLayout> <LinearLayout + style="?android:buttonBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - style="?android:buttonBarStyle"> + android:layout_gravity="center_horizontal"> <Button + android:id="@+id/button_backup_share" + style="?android:buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" android:layout_margin="10dp" - android:padding="12dp" - android:text="@string/btn_backup_share" + android:layout_weight="1" android:drawableLeft="@drawable/ic_share_grey_24dp" android:drawablePadding="8dp" - android:id="@+id/button_backup_share" - style="?android:buttonBarButtonStyle" - /> + android:padding="12dp" + android:text="@string/btn_backup_share" /> <Button + android:id="@+id/button_backup_save" + style="?android:buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" android:layout_margin="10dp" - android:padding="12dp" - android:text="@string/btn_backup_save" + android:layout_weight="1" android:drawableLeft="@drawable/ic_save_grey_24dp" android:drawablePadding="8dp" - android:id="@+id/button_backup_save" - style="?android:buttonBarButtonStyle" - /> + android:padding="12dp" + android:text="@string/btn_backup_save" /> </LinearLayout> diff --git a/OpenKeychain/src/main/res/layout-mdpi/backup_code_fragment.xml b/OpenKeychain/src/main/res/layout-mdpi/backup_code_fragment.xml index 4c7cb7374..2e2159f4e 100644 --- a/OpenKeychain/src/main/res/layout-mdpi/backup_code_fragment.xml +++ b/OpenKeychain/src/main/res/layout-mdpi/backup_code_fragment.xml @@ -1,294 +1,278 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" xmlns:custom="http://schemas.android.com/apk/res-auto" - android:orientation="vertical" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:orientation="vertical" android:paddingTop="50dp"> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/title_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/title_animator" android:inAnimation="@anim/fade_in" android:outAnimation="@anim/fade_out" custom:initialView="0"> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_explanation" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_explanation" /> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_enter" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_enter" /> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_ok" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_ok" /> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/code_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/code_animator" + android:layout_marginBottom="15dp" + android:layout_marginTop="15dp" android:inAnimation="@anim/fade_in" android:outAnimation="@anim/fade_out" - android:layout_marginTop="15dp" - android:layout_marginBottom="15dp" custom:initialView="0"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - > + android:layout_gravity="center_horizontal"> <TextView + android:id="@+id/backup_code_display_1" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_1" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="ABCDEF" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="ABCDEF" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="16dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="16dp" - android:text="-" tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_2" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_2" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="GHIJKL" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="GHIJKL" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="16dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="16dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_3" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_3" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="MNOPQR" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="MNOPQR" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="16dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="16dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_4" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_4" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - android:singleLine="true" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="STUVWX" + android:singleLine="true" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="STUVWX" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - > + android:layout_gravity="center_horizontal"> <!-- The most reliable way to correctly size these I found was to put a transparent hint on them. Theoretically, this should be what the android:ems attribute is for - didn't work for me. --> <EditText + android:id="@+id/backup_code_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_1" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="16dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="16dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_2" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="16dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="16dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_3" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> + <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="16dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="16dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_4" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="16dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="16dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> </LinearLayout> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/status_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/status_animator" android:inAnimation="@anim/fade_in_delayed" android:outAnimation="@anim/fade_out" custom:initialView="2"> <Button + android:id="@+id/button_backup_input" + style="?android:buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_margin="10dp" - android:text="@string/btn_code_wrotedown" + android:drawableLeft="@drawable/ic_mode_edit_grey_24dp" + android:drawablePadding="8dp" android:padding="12dp" - android:id="@+id/button_backup_input" - style="?android:buttonBarButtonStyle" - /> + android:text="@string/btn_code_wrotedown" /> <Space android:layout_width="wrap_content" @@ -301,59 +285,55 @@ android:orientation="vertical"> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" - android:text="@string/backup_code_wrong" - style="?android:textAppearanceMedium" - /> + android:text="@string/backup_code_wrong" /> <Button + android:id="@+id/button_backup_back" + style="?android:buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="10dp" android:layout_gravity="center_horizontal" - android:padding="12dp" - android:text="@string/btn_backup_back" + android:layout_margin="10dp" android:drawableLeft="@drawable/ic_repeat_grey_24dp" android:drawablePadding="8dp" - android:id="@+id/button_backup_back" - style="?android:buttonBarButtonStyle" - /> + android:padding="12dp" + android:text="@string/btn_backup_back" /> </LinearLayout> <LinearLayout + style="?android:buttonBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - style="?android:buttonBarStyle"> - - <Button - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:layout_margin="10dp" - android:padding="12dp" - android:text="@string/btn_backup_share" - android:drawableLeft="@drawable/ic_share_grey_24dp" - android:drawablePadding="8dp" - android:id="@+id/button_backup_share" - style="?android:buttonBarButtonStyle" - /> - - <Button - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:layout_margin="10dp" - android:padding="12dp" - android:text="@string/btn_backup_save" - android:drawableLeft="@drawable/ic_save_grey_24dp" - android:drawablePadding="8dp" - android:id="@+id/button_backup_save" - style="?android:buttonBarButtonStyle" - /> + android:layout_gravity="center_horizontal"> + + <Button + android:id="@+id/button_backup_share" + style="?android:buttonBarButtonStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="10dp" + android:layout_weight="1" + android:drawableLeft="@drawable/ic_share_grey_24dp" + android:drawablePadding="8dp" + android:padding="12dp" + android:text="@string/btn_backup_share" /> + + <Button + android:id="@+id/button_backup_save" + style="?android:buttonBarButtonStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="10dp" + android:layout_weight="1" + android:drawableLeft="@drawable/ic_save_grey_24dp" + android:drawablePadding="8dp" + android:padding="12dp" + android:text="@string/btn_backup_save" /> </LinearLayout> diff --git a/OpenKeychain/src/main/res/layout-xhdpi/backup_code_fragment.xml b/OpenKeychain/src/main/res/layout-xhdpi/backup_code_fragment.xml index 1ea976656..e7d8cac34 100644 --- a/OpenKeychain/src/main/res/layout-xhdpi/backup_code_fragment.xml +++ b/OpenKeychain/src/main/res/layout-xhdpi/backup_code_fragment.xml @@ -1,295 +1,278 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" xmlns:custom="http://schemas.android.com/apk/res-auto" - android:orientation="vertical" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:orientation="vertical" android:paddingTop="50dp"> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/title_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/title_animator" android:inAnimation="@anim/fade_in" android:outAnimation="@anim/fade_out" custom:initialView="0"> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_explanation" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_explanation" /> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_enter" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_enter" /> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" - android:text="@string/backup_code_ok" - style="?android:textAppearanceMedium" - /> + android:padding="10dp" + android:text="@string/backup_code_ok" /> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/code_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/code_animator" + android:layout_marginBottom="15dp" + android:layout_marginTop="15dp" android:inAnimation="@anim/fade_in" android:outAnimation="@anim/fade_out" - android:layout_marginTop="15dp" - android:layout_marginBottom="15dp" custom:initialView="0"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - > + android:layout_gravity="center_horizontal"> <TextView + android:id="@+id/backup_code_display_1" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_1" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="ABCDEF" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="ABCDEF" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_2" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_2" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="GHIJKL" - tools:ignore="SpUsage" /> + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="SpUsage" + tools:text="GHIJKL" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_3" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_3" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="MNOPQR" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="MNOPQR" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <TextView + android:id="@+id/backup_code_display_4" + style="@android:style/Widget.EditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_display_4" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" - style="@android:style/Widget.EditText" android:clickable="false" android:focusable="false" - tools:text="STUVWX" + android:singleLine="true" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" tools:ignore="SpUsage" - /> + tools:text="STUVWX" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - > + android:layout_gravity="center_horizontal"> <!-- The most reliable way to correctly size these I found was to put a transparent hint on them. Theoretically, this should be what the android:ems attribute is for - didn't work for me. --> <EditText + android:id="@+id/backup_code_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_1" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_2" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_3" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> + <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical" + android:text="-" + android:textSize="18dp" android:textStyle="bold" android:typeface="monospace" - android:textSize="18dp" - android:text="-" - tools:ignore="HardcodedText,SpUsage" - /> + tools:ignore="HardcodedText,SpUsage" /> <EditText + android:id="@+id/backup_code_4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/backup_code_4" - android:textStyle="bold" - android:typeface="monospace" - android:textSize="18dp" - android:singleLine="true" - android:inputType="textNoSuggestions|textCapCharacters" android:hint="ABCDEF" - android:textColorHint="@android:color/transparent" + android:inputType="textNoSuggestions|textCapCharacters" android:maxLength="6" - tools:ignore="HardcodedText,SpUsage" - /> + android:singleLine="true" + android:textColorHint="@android:color/transparent" + android:textSize="18dp" + android:textStyle="bold" + android:typeface="monospace" + tools:ignore="HardcodedText,SpUsage" /> </LinearLayout> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:layout_height="wrap_content" + android:id="@+id/status_animator" android:layout_width="match_parent" + android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:id="@+id/status_animator" android:inAnimation="@anim/fade_in_delayed" android:outAnimation="@anim/fade_out" custom:initialView="2"> <Button + android:id="@+id/button_backup_input" + style="?android:buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_margin="10dp" - android:text="@string/btn_code_wrotedown" android:drawableLeft="@drawable/ic_mode_edit_grey_24dp" android:drawablePadding="8dp" android:padding="12dp" - android:id="@+id/button_backup_input" - style="?android:buttonBarButtonStyle" - /> + android:text="@string/btn_code_wrotedown" /> <Space android:layout_width="wrap_content" @@ -302,59 +285,55 @@ android:orientation="vertical"> <TextView + style="?android:textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" - android:text="@string/backup_code_wrong" - style="?android:textAppearanceMedium" - /> + android:text="@string/backup_code_wrong" /> <Button + android:id="@+id/button_backup_back" + style="?android:buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="10dp" android:layout_gravity="center_horizontal" - android:padding="12dp" - android:text="@string/btn_backup_back" + android:layout_margin="10dp" android:drawableLeft="@drawable/ic_repeat_grey_24dp" android:drawablePadding="8dp" - android:id="@+id/button_backup_back" - style="?android:buttonBarButtonStyle" - /> + android:padding="12dp" + android:text="@string/btn_backup_back" /> </LinearLayout> <LinearLayout + style="?android:buttonBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - style="?android:buttonBarStyle"> + android:layout_gravity="center_horizontal"> <Button + android:id="@+id/button_backup_share" + style="?android:buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" android:layout_margin="10dp" - android:padding="12dp" - android:text="@string/btn_backup_share" + android:layout_weight="1" android:drawableLeft="@drawable/ic_share_grey_24dp" android:drawablePadding="8dp" - android:id="@+id/button_backup_share" - style="?android:buttonBarButtonStyle" - /> + android:padding="12dp" + android:text="@string/btn_backup_share" /> <Button + android:id="@+id/button_backup_save" + style="?android:buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" android:layout_margin="10dp" - android:padding="12dp" - android:text="@string/btn_backup_save" + android:layout_weight="1" android:drawableLeft="@drawable/ic_save_grey_24dp" android:drawablePadding="8dp" - android:id="@+id/button_backup_save" - style="?android:buttonBarButtonStyle" - /> + android:padding="12dp" + android:text="@string/btn_backup_save" /> </LinearLayout> diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 8f86d5976..8dd1f1b50 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -794,7 +794,7 @@ <string name="drawer_open">"Open navigation drawer"</string> <string name="drawer_close">"Close navigation drawer"</string> <string name="my_keys">"My Keys"</string> - <string name="nav_backup">"Backup"</string> + <string name="nav_backup">"Backup/Restore"</string> <!-- hints --> <string name="encrypt_content_edit_text_hint">"Type text"</string> |