mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-20 00:35:47 +01:00
Start fullscreen local backup migration megaphone.
This commit is contained in:
committed by
Cody Henthorne
parent
4f3f50e131
commit
1872894698
@@ -791,6 +791,10 @@ class MainActivity :
|
||||
)
|
||||
mainNavigationViewModel.onEvent(MainNavigationEvents.MegaphoneSnoozed(Megaphones.Event.VERIFY_BACKUP_KEY))
|
||||
}
|
||||
|
||||
if (requestCode == AppSettingsActivity.REQUEST_CODE_UPGRADE_LOCAL_BACKUPS) {
|
||||
mainNavigationViewModel.onEvent(MainNavigationEvents.MegaphoneSnoozed(Megaphones.Event.USE_NEW_ON_DEVICE_BACKUPS))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFirstRender() {
|
||||
|
||||
+2
@@ -165,6 +165,8 @@ class AppSettingsActivity : DSLSettingsActivity(), GooglePayComponent {
|
||||
companion object {
|
||||
const val ACTION_CHANGE_NUMBER_SUCCESS = "action_change_number_success"
|
||||
|
||||
const val REQUEST_CODE_UPGRADE_LOCAL_BACKUPS = 1205
|
||||
|
||||
@JvmStatic
|
||||
@JvmOverloads
|
||||
fun home(context: Context, action: String? = null): Intent {
|
||||
|
||||
@@ -134,7 +134,7 @@ public final class Megaphones {
|
||||
put(Event.BACKUP_MESSAGE_COUNT_UPSELL, shouldShowBackupMessageCountUpsell(context) ? new BackupUpsellSchedule(records, TimeUnit.DAYS.toMillis(60)) : NEVER);
|
||||
put(Event.BACKUPS_GENERIC_UPSELL, shouldShowGenericBackupsMegaphone(context) ? new BackupUpsellSchedule(records, TimeUnit.DAYS.toMillis(60)) : NEVER);
|
||||
put(Event.VERIFY_BACKUP_KEY, new VerifyBackupKeyReminderSchedule());
|
||||
put(Event.USE_NEW_ON_DEVICE_BACKUPS, shouldShowUseNewOnDeviceBackupsMegaphone() ? RecurringSchedule.every(TimeUnit.DAYS.toMillis(14)) : NEVER);
|
||||
put(Event.USE_NEW_ON_DEVICE_BACKUPS, shouldShowUseNewOnDeviceBackupsMegaphone() ? RecurringSchedule.every(TimeUnit.DAYS.toMillis(7)) : NEVER);
|
||||
|
||||
// The Great Wall of PIN Reminder -- megaphones below this may not be seen by users who never do reminders
|
||||
put(Event.PIN_REMINDER, new SignalPinReminderSchedule());
|
||||
@@ -515,18 +515,13 @@ public final class Megaphones {
|
||||
}
|
||||
|
||||
public static @NonNull Megaphone buildUseNewOnDeviceBackupsMegaphone() {
|
||||
return new Megaphone.Builder(Event.USE_NEW_ON_DEVICE_BACKUPS, Megaphone.Style.BASIC)
|
||||
.setImage(R.drawable.backups_megaphone_image)
|
||||
.setTitle(R.string.UseNewOnDeviceBackups__title)
|
||||
.setBody(R.string.UseNewOnDeviceBackups__body)
|
||||
.setActionButton(R.string.UseNewOnDeviceBackups__upgrade, (megaphone, controller) -> {
|
||||
return new Megaphone.Builder(Event.USE_NEW_ON_DEVICE_BACKUPS, Megaphone.Style.FULLSCREEN)
|
||||
.setOnVisibleListener((megaphone, controller) -> {
|
||||
Log.i(TAG, "Prompting the user to upgrade their on-device backups.");
|
||||
|
||||
Intent intent = AppSettingsActivity.upgradeLocalBackups(controller.getMegaphoneActivity());
|
||||
|
||||
controller.onMegaphoneNavigationRequested(intent);
|
||||
controller.onMegaphoneSnooze(Event.USE_NEW_ON_DEVICE_BACKUPS);
|
||||
})
|
||||
.setSecondaryButton(R.string.UseNewOnDeviceBackups__not_now, (megaphone, controller) -> {
|
||||
controller.onMegaphoneSnooze(Event.USE_NEW_ON_DEVICE_BACKUPS);
|
||||
controller.onMegaphoneNavigationRequested(intent, AppSettingsActivity.REQUEST_CODE_UPGRADE_LOCAL_BACKUPS);
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -8210,15 +8210,6 @@
|
||||
<!-- Primary button on the setup complete bottom sheet -->
|
||||
<string name="BackupSetupCompleteBottomSheet__back_up_now">Back up now</string>
|
||||
|
||||
<!-- Title of a megaphone shown to prompt the user to upgrade to the new local backups type -->
|
||||
<string name="UseNewOnDeviceBackups__title">Use new on-device backups</string>
|
||||
<!-- Body of a megaphone shown to prompt the user to upgrade to the new local backups type -->
|
||||
<string name="UseNewOnDeviceBackups__body">On-device backups now save faster and use less data.</string>
|
||||
<!-- Button of a megaphone that will take the user to the upgrade flow -->
|
||||
<string name="UseNewOnDeviceBackups__upgrade">Upgrade</string>
|
||||
<!-- Button of a megaphone that will snooze the reminder to upgrade to the new local backups type -->
|
||||
<string name="UseNewOnDeviceBackups__not_now">Not now</string>
|
||||
|
||||
<!-- Title of a megaphone shown to prompt the user to open Signal on their primary device -->
|
||||
<string name="InactivePrimary__title">Open Signal on your phone</string>
|
||||
<!-- Body of a megaphone shown to prompt the user to open Signal on their primary device -->
|
||||
|
||||
Reference in New Issue
Block a user