From 920656b45d640f78fa2eab851227ce63ee41d864 Mon Sep 17 00:00:00 2001 From: kosyak Date: Sat, 18 May 2024 13:41:39 +0200 Subject: [PATCH] move restore backup button from context menu on welcome screen --- .../eu/siacs/conversations/ui/WelcomeActivity.java | 12 ++++++------ src/conversations/res/layout/activity_welcome.xml | 9 +++++++++ src/conversations/res/menu/welcome_menu.xml | 5 ----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/conversations/java/eu/siacs/conversations/ui/WelcomeActivity.java b/src/conversations/java/eu/siacs/conversations/ui/WelcomeActivity.java index d61c64a9c..61b2730ff 100644 --- a/src/conversations/java/eu/siacs/conversations/ui/WelcomeActivity.java +++ b/src/conversations/java/eu/siacs/conversations/ui/WelcomeActivity.java @@ -11,6 +11,7 @@ import android.security.KeyChainAliasCallback; import android.util.Log; import android.view.Menu; import android.view.MenuItem; +import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; @@ -140,7 +141,11 @@ public class WelcomeActivity extends XmppActivity implements XmppConnectionServi addInviteUri(intent); startActivity(intent); }); - + binding.restoreBackup.setOnClickListener(v -> { + if (hasStoragePermission(REQUEST_IMPORT_BACKUP)) { + startActivity(new Intent(this, ImportBackupActivity.class)); + } + }); } @Override @@ -156,11 +161,6 @@ public class WelcomeActivity extends XmppActivity implements XmppConnectionServi @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case R.id.action_import_backup: - if (hasStoragePermission(REQUEST_IMPORT_BACKUP)) { - startActivity(new Intent(this, ImportBackupActivity.class)); - } - break; case R.id.action_scan_qr_code: UriHandlerActivity.scan(this, true); break; diff --git a/src/conversations/res/layout/activity_welcome.xml b/src/conversations/res/layout/activity_welcome.xml index 33076858a..a04a4409c 100644 --- a/src/conversations/res/layout/activity_welcome.xml +++ b/src/conversations/res/layout/activity_welcome.xml @@ -68,6 +68,15 @@ android:layout_gravity="right" android:text="@string/i_already_have_an_account" android:textColor="?android:textColorSecondary" /> + +