If no internet while create account, keep trying

Stephen Paul Weber created

Change summary

src/cheogram/java/eu/siacs/conversations/ui/WelcomeActivity.java | 11 +
src/cheogram/java/eu/siacs/conversations/utils/SignupUtils.java  |  2 
src/main/res/layout/fragment_conversation.xml                    |  2 
3 files changed, 11 insertions(+), 4 deletions(-)

Detailed changes

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);

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));

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"