From fefb69c68df5446a7dde7723a9708745f1223f6a Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 3 Sep 2024 14:05:55 -0500 Subject: [PATCH] If no internet while create account, keep trying --- .../eu/siacs/conversations/ui/WelcomeActivity.java | 11 +++++++++-- .../eu/siacs/conversations/utils/SignupUtils.java | 2 +- src/main/res/layout/fragment_conversation.xml | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cheogram/java/eu/siacs/conversations/ui/WelcomeActivity.java b/src/cheogram/java/eu/siacs/conversations/ui/WelcomeActivity.java index 04356717b45eede92a1b51e0d940e14f5a0ca6ed..8e9199b2cb4fb3b63c2e5c791a13c1b1e98c406f 100644 --- a/src/cheogram/java/eu/siacs/conversations/ui/WelcomeActivity.java +++ b/src/cheogram/java/eu/siacs/conversations/ui/WelcomeActivity.java @@ -48,6 +48,7 @@ public class WelcomeActivity extends XmppActivity implements XmppConnectionServi private XmppUri inviteUri; private Account onboardingAccount = null; + private ActivityWelcomeBinding binding = null; public static void launch(AppCompatActivity activity) { Intent intent = new Intent(activity, WelcomeActivity.class); @@ -109,7 +110,13 @@ public class WelcomeActivity extends XmppActivity implements XmppConnectionServi @Override protected void onBackendConnected() { - + if (xmppConnectionService.isOnboarding()) { + binding.registerNewAccount.setText("Working..."); + binding.registerNewAccount.setEnabled(false); + binding.slideshowPager.setCurrentItem(4); + onboardingAccount = xmppConnectionService.getAccounts().get(0); + xmppConnectionService.reconnectAccountInBackground(onboardingAccount); + } } @Override @@ -137,7 +144,7 @@ public class WelcomeActivity extends XmppActivity implements XmppConnectionServi } super.onCreate(savedInstanceState); getPreferences().edit().putStringSet("pstn_gateways", new HashSet<>()).apply(); - ActivityWelcomeBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_welcome); + binding = DataBindingUtil.setContentView(this, R.layout.activity_welcome); Activities.setStatusAndNavigationBarColors(this, binding.getRoot()); binding.slideshowPager.setAdapter(new WelcomePagerAdapter(binding.slideshowPager)); binding.dotsIndicator.setViewPager(binding.slideshowPager); diff --git a/src/cheogram/java/eu/siacs/conversations/utils/SignupUtils.java b/src/cheogram/java/eu/siacs/conversations/utils/SignupUtils.java index 14dc3f79443f98597f8f2306e522284327bb8a3f..fbb294e9b1fde88384c465f11edce933d7f33429 100644 --- a/src/cheogram/java/eu/siacs/conversations/utils/SignupUtils.java +++ b/src/cheogram/java/eu/siacs/conversations/utils/SignupUtils.java @@ -52,7 +52,7 @@ public class SignupUtils { Account pendingAccount = AccountUtils.getPendingAccount(service); Intent intent; if (pendingAccount != null) { - intent = new Intent(activity, EditAccountActivity.class); + intent = new Intent(activity, Config.ONBOARDING_DOMAIN.equals(pendingAccount.getJid().getDomain()) ? WelcomeActivity.class : EditAccountActivity.class); intent.putExtra("jid", pendingAccount.getJid().asBareJid().toString()); if (!pendingAccount.isOptionSet(Account.OPTION_MAGIC_CREATE)) { intent.putExtra(EditAccountActivity.EXTRA_FORCE_REGISTER, pendingAccount.isOptionSet(Account.OPTION_REGISTER)); diff --git a/src/main/res/layout/fragment_conversation.xml b/src/main/res/layout/fragment_conversation.xml index d6c319a633612e3f051a3ae8eb214f33b8e06f4d..0cdc2e90b314b5dd3e6726ab18b5edd4df96169d 100644 --- a/src/main/res/layout/fragment_conversation.xml +++ b/src/main/res/layout/fragment_conversation.xml @@ -299,7 +299,7 @@ android:layout_height="wrap_content" android:layout_below="@+id/commands_view" android:visibility="gone" - android:text="If you have made payment via Bitcoin, eTransfer, or mail, hold tight for your notification. Otherwise you can pick up where you left off (you may be asked a few of the same questions but it will generally not ask you to pay again if you already did, etc)." + android:text="If you have made payment via Bitcoin, eTransfer, or mail, hold tight for your notification. Otherwise you can pick up where you left off by tapping Register with Backend above (you may be asked a few of the same questions but it will generally not ask you to pay again if you already did, etc)." android:gravity="center" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:paddingLeft="8dp"