add "Add as Second Device" to welcome view

ppl try already now to set up a second device from the welcome screen.
however, end up in logging into their email account again,
creating issues with keys and more.
a dedicated "Add as Second Devies" button targets this UX issue
by offering a clear path for setting up a second device.

moreover, the string "Scan Invitation Code" is used again (as on all releases),
this string is used quite a bit in different handouts,
changing that would worsen UX as well.

the "Restore from Backup is moved down,
if you really use this path, finding the button is the smallest issue.
the different layout of the button makes clear,
that this is not the preferred way to set up a new account
(but sure, to restore a backup :)
This commit is contained in:
B. Petersen
2023-03-25 12:40:04 +01:00
committed by bjoern
parent f931c9bc41
commit b36cfcabe9
3 changed files with 25 additions and 10 deletions
+17 -7
View File
@@ -15,8 +15,8 @@
<ImageView
android:id="@+id/welcome_icon"
android:layout_width="wrap_content"
android:layout_height="128dp"
android:layout_weight="16"
android:layout_height="100dp"
android:layout_weight="14"
android:gravity="bottom"
android:src="@drawable/intro1"
android:paddingLeft="32dp"
@@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:layout_marginBottom="24dp"
android:layout_marginBottom="20dp"
android:text="@string/welcome_chat_over_email"
android:textSize="22sp"
android:textStyle="bold"/>
@@ -53,13 +53,13 @@
<Button
style="@style/ButtonSecondary"
android:id="@+id/backup_button"
android:id="@+id/add_as_second_device_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/import_backup_title"/>
android:text="@string/multidevice_receiver_title"/>
<Button
style="@style/ButtonSecondary"
@@ -68,14 +68,24 @@
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:text="@string/qrscan_title"/>
android:text="@string/scan_invitation_code"/>
</LinearLayout>
<androidx.legacy.widget.Space
android:layout_weight="5"
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"/>
<TextView
android:id="@+id/backup_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="22dp"
android:gravity="center"
android:text="@string/import_backup_title"
android:textColor="?attr/secondary_button_fg"
android:textSize="15sp"/>
</LinearLayout>
+1 -1
View File
@@ -471,7 +471,7 @@
<string name="multidevice_title">Add Second Device</string>
<string name="multidevice_same_network_hint">Make sure both devices are on the same Wi-Fi or network</string>
<string name="multidevice_install_dc_on_other_device">Install Delta Chat 1.36 or newer on your other device (https://get.delta.chat)</string>
<string name="multidevice_tap_scan_on_other_device">Start Delta Chat, tap “Scan QR Code” and scan the code shown here</string>
<string name="multidevice_tap_scan_on_other_device">Start Delta Chat, tap “Add as Second Device” and scan the code shown here</string>
<!-- Shown inside a "QR code card" with very limited space; please formulate the text as short as possible therefore. The placeholder will be replaced by name and/or address eg. "Scan to set up second device for Alice (alice@example.org)" -->
<string name="multidevice_qr_subtitle">Scan to set up second device for %1$s</string>
<string name="multidevice_receiver_title">Add as Second Device</string>
@@ -73,10 +73,12 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
setContentView(R.layout.welcome_activity);
Button loginButton = findViewById(R.id.login_button);
View addAsSecondDeviceButton = findViewById(R.id.add_as_second_device_button);
View scanQrButton = findViewById(R.id.scan_qr_button);
View backupButton = findViewById(R.id.backup_button);
loginButton.setOnClickListener((view) -> startRegistrationActivity());
addAsSecondDeviceButton.setOnClickListener((view) -> startAddAsAnotherDeviceActivity());
scanQrButton.setOnClickListener((view) -> startRegistrationQrActivity());
backupButton.setOnClickListener((view) -> startImportBackup());
@@ -147,13 +149,16 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
manualConfigure = true;
Intent intent = new Intent(this, RegistrationActivity.class);
startActivity(intent);
// no finish() here, the back key should take the user back from RegistrationActivity to WelcomeActivity
}
private void startRegistrationQrActivity() {
manualConfigure = false;
new IntentIntegrator(this).setCaptureActivity(RegistrationQrActivity.class).initiateScan();
// no finish() here, the back key should take the user back from RegistrationQrActivity to WelcomeActivity
}
private void startAddAsAnotherDeviceActivity() {
manualConfigure = false;
new IntentIntegrator(this).setCaptureActivity(RegistrationQrActivity.class).initiateScan();
}
@SuppressLint("InlinedApi")