Add remote_backups cta action for release notes.

This commit is contained in:
Cody Henthorne
2026-02-20 11:47:14 -05:00
parent 6e108a03d1
commit 541b4674a8
4 changed files with 18 additions and 12 deletions

View File

@@ -798,6 +798,13 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
} }
) )
clickPref(
title = DSLSettingsText.from("Add remote backups note"),
onClick = {
viewModel.addSampleReleaseNote("remote_backups")
}
)
clickPref( clickPref(
title = DSLSettingsText.from("Add remote donate megaphone"), title = DSLSettingsText.from("Add remote donate megaphone"),
onClick = { onClick = {

View File

@@ -42,7 +42,7 @@ class InternalSettingsRepository(context: Context) {
} }
} }
fun addSampleReleaseNote() { fun addSampleReleaseNote(callToAction: String) {
SignalExecutors.UNBOUNDED.execute { SignalExecutors.UNBOUNDED.execute {
AppDependencies.jobManager.runSynchronously(CreateReleaseChannelJob.create(), 5000) AppDependencies.jobManager.runSynchronously(CreateReleaseChannelJob.create(), 5000)
@@ -52,7 +52,7 @@ class InternalSettingsRepository(context: Context) {
val bodyRangeList = BodyRangeList.Builder() val bodyRangeList = BodyRangeList.Builder()
.addStyle(BodyRangeList.BodyRange.Style.BOLD, 0, title.length) .addStyle(BodyRangeList.BodyRange.Style.BOLD, 0, title.length)
bodyRangeList.addButton("Call to Action Text", "action", body.lastIndex, 0) bodyRangeList.addButton("Call to Action Text", callToAction, body.lastIndex, 0)
val recipientId = SignalStore.releaseChannel.releaseChannelRecipientId!! val recipientId = SignalStore.releaseChannel.releaseChannelRecipientId!!
val threadId = SignalDatabase.threads.getOrCreateThreadIdFor(Recipient.resolved(recipientId)) val threadId = SignalDatabase.threads.getOrCreateThreadIdFor(Recipient.resolved(recipientId))

View File

@@ -154,8 +154,8 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
refresh() refresh()
} }
fun addSampleReleaseNote() { fun addSampleReleaseNote(callToAction: String = "action") {
repository.addSampleReleaseNote() repository.addSampleReleaseNote(callToAction)
} }
fun addRemoteDonateMegaphone() { fun addRemoteDonateMegaphone() {

View File

@@ -158,6 +158,7 @@ import org.thoughtcrime.securesms.components.mention.MentionAnnotation
import org.thoughtcrime.securesms.components.menu.ActionItem import org.thoughtcrime.securesms.components.menu.ActionItem
import org.thoughtcrime.securesms.components.menu.SignalBottomActionBar import org.thoughtcrime.securesms.components.menu.SignalBottomActionBar
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity.Companion.remoteBackups
import org.thoughtcrime.securesms.components.settings.app.subscription.donate.CheckoutFlowActivity import org.thoughtcrime.securesms.components.settings.app.subscription.donate.CheckoutFlowActivity
import org.thoughtcrime.securesms.components.settings.app.subscription.donate.DonateToSignalFragment import org.thoughtcrime.securesms.components.settings.app.subscription.donate.DonateToSignalFragment
import org.thoughtcrime.securesms.components.settings.conversation.ConversationSettingsActivity import org.thoughtcrime.securesms.components.settings.conversation.ConversationSettingsActivity
@@ -3482,14 +3483,12 @@ class ConversationFragment :
} }
override fun onCallToAction(action: String) { override fun onCallToAction(action: String) {
if ("gift_badge" == action) { when (action) {
checkoutLauncher.launch(InAppPaymentType.ONE_TIME_GIFT) "gift_badge" -> checkoutLauncher.launch(InAppPaymentType.ONE_TIME_GIFT)
} else if ("username_edit" == action) { "username_edit" -> startActivity(EditProfileActivity.getIntentForUsernameEdit(requireContext()))
startActivity(EditProfileActivity.getIntentForUsernameEdit(requireContext())) "calls_tab" -> startActivity(MainActivity.clearTopAndOpenTab(requireContext(), MainNavigationListLocation.CALLS))
} else if ("calls_tab" == action) { "chat_folder" -> startActivity(AppSettingsActivity.chatFolders(requireContext()))
startActivity(MainActivity.clearTopAndOpenTab(requireContext(), MainNavigationListLocation.CALLS)) "remote_backups" -> startActivity(AppSettingsActivity.remoteBackups(requireContext()))
} else if ("chat_folder" == action) {
startActivity(AppSettingsActivity.chatFolders(requireContext()))
} }
} }