From 87d729d03e071f5ba5daed33fa5179ccfd20520e Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 26 Nov 2025 15:10:52 +1100 Subject: [PATCH 1/4] Using system scrim by removing some old flag --- .../org/thoughtcrime/securesms/ui/AlertDialog.kt | 15 ++++----------- app/src/main/res/values/themes.xml | 2 -- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt index 804148d5ed..896104a84f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/AlertDialog.kt @@ -152,21 +152,14 @@ fun BasicSessionAlertDialog( decorFitsSystemWindows = false ), content = { + // control content size Box( modifier = Modifier - .fillMaxSize() - .background(blackAlpha40), // scrim + .widthIn(max = LocalDimensions.current.maxDialogWidth) + .fillMaxWidth(0.85f), contentAlignment = Alignment.Center ) { - // control content size - Box( - modifier = Modifier - .widthIn(max = LocalDimensions.current.maxDialogWidth) - .fillMaxWidth(0.85f), - contentAlignment = Alignment.Center - ) { - content() - } + content() } } ) diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index b4b6e8a55b..c73762f95f 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -16,8 +16,6 @@ @color/gray50 ?colorPrimary @style/Theme.Session.BottomSheet - true - 0 @dimen/dialog_corner_radius @style/ThemeOverlay.Session.AlertDialog @style/ThemeOverlay.Session.AlertDialog From d1f8e728214666b13745810f95e8d982c87df5d1 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 26 Nov 2025 15:34:30 +1100 Subject: [PATCH 2/4] Trigger donate from "It's great" --- .../securesms/reviews/ui/InAppReviewViewModel.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/reviews/ui/InAppReviewViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/reviews/ui/InAppReviewViewModel.kt index b83979b2b7..a57cfcd149 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/reviews/ui/InAppReviewViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/reviews/ui/InAppReviewViewModel.kt @@ -48,7 +48,13 @@ class InAppReviewViewModel @Inject constructor( UiState.StartPrompt -> { when (event) { - UiCommand.PositiveButtonClicked -> UiState.PositivePrompt + // "It's Great" button clicked + UiCommand.PositiveButtonClicked -> { + // mark the app as needing to display the donation post positive review + prefs.setShowDonationCTAFromPositiveReview(true) + + UiState.PositivePrompt + } UiCommand.NegativeButtonClicked -> UiState.NegativePrompt UiCommand.CloseButtonClicked -> { manager.onEvent(InAppReviewManager.Event.Dismiss) @@ -63,9 +69,6 @@ class InAppReviewViewModel @Inject constructor( UiCommand.PositiveButtonClicked -> { manager.onEvent(InAppReviewManager.Event.Dismiss) - // mark the app as needing to display the donation post positive review - prefs.setShowDonationCTAFromPositiveReview(true) - if (runCatching { storeReviewManager.requestReviewFlow() }.isSuccess) { UiState.Hidden } else { From 44ab07f2eac26cf1b8242ffffe194dca8154dc8a Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 26 Nov 2025 15:39:36 +1100 Subject: [PATCH 3/4] Dialog ordering --- .../securesms/home/HomeDialogs.kt | 1 - .../securesms/home/HomeViewModel.kt | 22 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeDialogs.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeDialogs.kt index a026e156e4..186f9efc6e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeDialogs.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeDialogs.kt @@ -23,7 +23,6 @@ import org.thoughtcrime.securesms.ui.AnimatedSessionProCTA import org.thoughtcrime.securesms.ui.CTAFeature import org.thoughtcrime.securesms.ui.OpenURLAlertDialog import org.thoughtcrime.securesms.ui.PinProCTA -import org.thoughtcrime.securesms.ui.SessionProCTA import org.thoughtcrime.securesms.ui.SimpleSessionProCTA import org.thoughtcrime.securesms.ui.UserProfileModal import org.thoughtcrime.securesms.ui.theme.SessionMaterialTheme diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt index 50e059a1ec..ec55f76468 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt @@ -169,13 +169,16 @@ class HomeViewModel @Inject constructor( // - subscription expired less than 30 days ago val now = Instant.now() + var showExpiring: Boolean = false + var showExpired: Boolean = false + if(subscription.type is ProStatus.Active.Expiring && !prefs.hasSeenProExpiring() ){ val validUntil = subscription.type.validUntil - val show = validUntil.isBefore(now.plus(7, ChronoUnit.DAYS)) + showExpiring = validUntil.isBefore(now.plus(7, ChronoUnit.DAYS)) Log.d(DebugLogGroup.PRO_DATA.label, "Home: Pro active but not auto renewing (expiring). Valid until: $validUntil - Should show Expiring CTA? $show") - if (show) { + if (showExpiring) { _dialogsState.update { state -> state.copy( proExpiringCTA = ProExpiringCTA( @@ -188,24 +191,23 @@ class HomeViewModel @Inject constructor( else if(subscription.type is ProStatus.Expired && !prefs.hasSeenProExpired()) { val validUntil = subscription.type.expiredAt - val show = now.isBefore(validUntil.plus(30, ChronoUnit.DAYS)) + showExpired = now.isBefore(validUntil.plus(30, ChronoUnit.DAYS)) Log.d(DebugLogGroup.PRO_DATA.label, "Home: Pro expired. Expired at: $validUntil - Should show Expired CTA? $show") // Check if now is within 30 days after expiry - if (show) { - + if (showExpired) { _dialogsState.update { state -> state.copy(proExpiredCTA = true) } } } - } - } - // check if we should display the donation CTA - if(donationManager.shouldShowDonationCTA()){ - showDonationCTA() + // check if we should display the donation CTA - unless we have a pro CTA already + if(!showExpiring && !showExpired && donationManager.shouldShowDonationCTA()){ + showDonationCTA() + } + } } } From dfa32a601a934e87326c7daf779bdd31595f39a4 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 26 Nov 2025 15:39:59 +1100 Subject: [PATCH 4/4] name change --- .../java/org/thoughtcrime/securesms/home/HomeViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt index ec55f76468..bf4849a7ec 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeViewModel.kt @@ -177,7 +177,7 @@ class HomeViewModel @Inject constructor( ){ val validUntil = subscription.type.validUntil showExpiring = validUntil.isBefore(now.plus(7, ChronoUnit.DAYS)) - Log.d(DebugLogGroup.PRO_DATA.label, "Home: Pro active but not auto renewing (expiring). Valid until: $validUntil - Should show Expiring CTA? $show") + Log.d(DebugLogGroup.PRO_DATA.label, "Home: Pro active but not auto renewing (expiring). Valid until: $validUntil - Should show Expiring CTA? $showExpiring") if (showExpiring) { _dialogsState.update { state -> state.copy( @@ -193,7 +193,7 @@ class HomeViewModel @Inject constructor( val validUntil = subscription.type.expiredAt showExpired = now.isBefore(validUntil.plus(30, ChronoUnit.DAYS)) - Log.d(DebugLogGroup.PRO_DATA.label, "Home: Pro expired. Expired at: $validUntil - Should show Expired CTA? $show") + Log.d(DebugLogGroup.PRO_DATA.label, "Home: Pro expired. Expired at: $validUntil - Should show Expired CTA? $showExpired") // Check if now is within 30 days after expiry if (showExpired) {