diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-12-22 11:51:53 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-12-22 11:51:53 +0100 |
commit | cb365e450bc2cf4e206641da4cc2ed9814019066 (patch) | |
tree | c9a46b297b2446c05d87e2a5581b9ee7c7926bcc /OpenKeychain/src | |
parent | 70801fbc2e84131928f65f7c683d0c07592e0fb6 (diff) | |
download | open-keychain-cb365e450bc2cf4e206641da4cc2ed9814019066.tar.gz open-keychain-cb365e450bc2cf4e206641da4cc2ed9814019066.tar.bz2 open-keychain-cb365e450bc2cf4e206641da4cc2ed9814019066.zip |
Backup: Move FAQ button to last screen and simplify code
Diffstat (limited to 'OpenKeychain/src')
4 files changed, 113 insertions, 124 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java index 3e53e35da..3300bd25b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeFragment.java @@ -54,7 +54,6 @@ import org.sufficientlysecure.keychain.operations.results.ExportResult; import org.sufficientlysecure.keychain.provider.TemporaryFileProvider; import org.sufficientlysecure.keychain.service.BackupKeyringParcel; import org.sufficientlysecure.keychain.ui.base.CryptoOperationFragment; -import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; import org.sufficientlysecure.keychain.ui.util.Notify; import org.sufficientlysecure.keychain.ui.util.Notify.ActionListener; import org.sufficientlysecure.keychain.ui.util.Notify.Style; @@ -81,7 +80,7 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar String mBackupCode; private EditText[] mCodeEditText; - private ToolableViewAnimator mStatusAnimator, mTitleAnimator, mCodeFieldsAnimator, mFaqAnimator; + private ToolableViewAnimator mStatusAnimator, mTitleAnimator, mCodeFieldsAnimator; private Integer mBackStackLevel; private Uri mCachedBackupUri; @@ -115,14 +114,12 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar mTitleAnimator.setDisplayedChild(0, animate); mStatusAnimator.setDisplayedChild(0, animate); mCodeFieldsAnimator.setDisplayedChild(0, animate); - mFaqAnimator.setDisplayedChild(0, animate); break; case STATE_INPUT: mTitleAnimator.setDisplayedChild(1, animate); mStatusAnimator.setDisplayedChild(1, animate); mCodeFieldsAnimator.setDisplayedChild(1, animate); - mFaqAnimator.setDisplayedChild(1, animate); for (EditText editText : mCodeEditText) { editText.setText(""); } @@ -135,7 +132,6 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar mTitleAnimator.setDisplayedChild(1, false); mStatusAnimator.setDisplayedChild(2, animate); mCodeFieldsAnimator.setDisplayedChild(1, false); - mFaqAnimator.setDisplayedChild(0, false); hideKeyboard(); @@ -152,7 +148,6 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar mTitleAnimator.setDisplayedChild(2, animate); mStatusAnimator.setDisplayedChild(3, animate); mCodeFieldsAnimator.setDisplayedChild(1, false); - mFaqAnimator.setDisplayedChild(0, animate); hideKeyboard(); @@ -222,7 +217,6 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar mStatusAnimator = (ToolableViewAnimator) view.findViewById(R.id.status_animator); mTitleAnimator = (ToolableViewAnimator) view.findViewById(R.id.title_animator); mCodeFieldsAnimator = (ToolableViewAnimator) view.findViewById(R.id.code_animator); - mFaqAnimator = (ToolableViewAnimator) view.findViewById(R.id.faq_animator); View backupInput = view.findViewById(R.id.button_backup_input); backupInput.setOnClickListener(new OnClickListener() { @@ -258,7 +252,7 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar } }); - view.findViewById(R.id.tv_faq).setOnClickListener(new OnClickListener() { + view.findViewById(R.id.button_faq).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { showFaq(); 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 0c93f4e24..d01fd10ec 100644 --- a/OpenKeychain/src/main/res/layout-land/backup_code_fragment.xml +++ b/OpenKeychain/src/main/res/layout-land/backup_code_fragment.xml @@ -309,53 +309,51 @@ style="?android:buttonBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal"> + android:layout_gravity="center_horizontal" + android:orientation="vertical"> - <Button - android:id="@+id/button_backup_share" - style="?android:buttonBarButtonStyle" - android:layout_width="0dp" + <LinearLayout + style="?android:buttonBarStyle" + android:layout_width="wrap_content" 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" /> + 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> <Button - android:id="@+id/button_backup_save" + android:id="@+id/button_faq" style="?android:buttonBarButtonStyle" - android:layout_width="0dp" + android:layout_width="match_parent" 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" /> - + android:gravity="center" + android:text="@string/how_to_import" /> </LinearLayout> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> - <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - - android:id="@+id/faq_animator" - android:inAnimation="@anim/fade_in" - android:outAnimation="@anim/fade_out" - android:layout_width="match_parent" - android:layout_height="wrap_content"> - <android.support.v4.widget.Space - android:layout_width="wrap_content" - android:layout_height="match_parent" /> - <TextView - android:id="@+id/tv_faq" - android:text="@string/how_to_import" - android:gravity="center" - style="?android:buttonBarButtonStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> - </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 502050849..fc3816352 100644 --- a/OpenKeychain/src/main/res/layout-mdpi/backup_code_fragment.xml +++ b/OpenKeychain/src/main/res/layout-mdpi/backup_code_fragment.xml @@ -309,52 +309,51 @@ style="?android:buttonBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal"> + android:layout_gravity="center_horizontal" + android:orientation="vertical"> - <Button - android:id="@+id/button_backup_share" - style="?android:buttonBarButtonStyle" - android:layout_width="0dp" + <LinearLayout + style="?android:buttonBarStyle" + android:layout_width="wrap_content" 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" /> + 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> <Button - android:id="@+id/button_backup_save" + android:id="@+id/button_faq" style="?android:buttonBarButtonStyle" - android:layout_width="0dp" + android:layout_width="match_parent" 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" /> - + android:gravity="center" + android:text="@string/how_to_import" /> </LinearLayout> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> - <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:id="@+id/faq_animator" - android:inAnimation="@anim/fade_in" - android:outAnimation="@anim/fade_out" - android:layout_width="match_parent" - android:layout_height="wrap_content"> - <android.support.v4.widget.Space - android:layout_width="wrap_content" - android:layout_height="match_parent" /> - <TextView - android:id="@+id/tv_faq" - android:text="@string/how_to_import" - android:gravity="center" - style="?android:buttonBarButtonStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> - </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 fd1e16145..39f4c9380 100644 --- a/OpenKeychain/src/main/res/layout-xhdpi/backup_code_fragment.xml +++ b/OpenKeychain/src/main/res/layout-xhdpi/backup_code_fragment.xml @@ -309,53 +309,51 @@ style="?android:buttonBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal"> + android:layout_gravity="center_horizontal" + android:orientation="vertical"> - <Button - android:id="@+id/button_backup_share" - style="?android:buttonBarButtonStyle" - android:layout_width="0dp" + <LinearLayout + style="?android:buttonBarStyle" + android:layout_width="wrap_content" 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" /> + 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> <Button - android:id="@+id/button_backup_save" + android:id="@+id/button_faq" style="?android:buttonBarButtonStyle" - android:layout_width="0dp" + android:layout_width="match_parent" 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" /> - + android:gravity="center" + android:text="@string/how_to_import" /> </LinearLayout> </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> - <org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator - android:id="@+id/faq_animator" - android:inAnimation="@anim/fade_in" - android:outAnimation="@anim/fade_out" - android:layout_width="match_parent" - android:layout_height="wrap_content"> - <android.support.v4.widget.Space - android:layout_width="wrap_content" - android:layout_height="match_parent" /> - <TextView - android:id="@+id/tv_faq" - android:text="@string/how_to_import" - android:gravity="center" - style="?android:buttonBarButtonStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - </org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator> - - </LinearLayout> |