diff --git a/app/src/googleplay/java/org/tasks/analytics/Firebase.kt b/app/src/googleplay/java/org/tasks/analytics/Firebase.kt index 26c0bf9d9..de46bbdc0 100644 --- a/app/src/googleplay/java/org/tasks/analytics/Firebase.kt +++ b/app/src/googleplay/java/org/tasks/analytics/Firebase.kt @@ -75,8 +75,8 @@ class Firebase @Inject constructor( get() = installCooldown || preferences.lastSubscribeRequest + days("subscribe_cooldown", 30L) > currentTimeMillis() - val subGroupA: Boolean - get() = remoteConfig?.getBoolean("sub_group_a") ?: false + val nameYourPrice: Boolean + get() = remoteConfig?.getBoolean("name_your_price") ?: false private fun days(key: String, default: Long): Long = TimeUnit.DAYS.toMillis(remoteConfig?.getLong(key) ?: default) diff --git a/app/src/main/java/org/tasks/billing/PurchaseActivity.kt b/app/src/main/java/org/tasks/billing/PurchaseActivity.kt index b96102df2..5d75e05cb 100644 --- a/app/src/main/java/org/tasks/billing/PurchaseActivity.kt +++ b/app/src/main/java/org/tasks/billing/PurchaseActivity.kt @@ -49,7 +49,7 @@ class PurchaseActivity : AppCompatActivity(), OnPurchasesUpdated { theme.applyToContext(this) if (savedInstanceState == null) { - nameYourPrice.value = intent?.extras?.getBoolean(EXTRA_NAME_YOUR_PRICE) ?: false + nameYourPrice.value = intent?.extras?.getBoolean(EXTRA_NAME_YOUR_PRICE) ?: firebase.nameYourPrice } else { nameYourPrice.value = savedInstanceState.getBoolean(EXTRA_NAME_YOUR_PRICE) sliderPosition.value = savedInstanceState.getFloat(EXTRA_PRICE) @@ -64,7 +64,6 @@ class PurchaseActivity : AppCompatActivity(), OnPurchasesUpdated { nameYourPrice = nameYourPrice, sliderPosition = sliderPosition, github = github, - hideText = firebase.subGroupA, subscribe = this::purchase, onBack = { finish() }, ) diff --git a/app/src/main/java/org/tasks/compose/Subscription.kt b/app/src/main/java/org/tasks/compose/Subscription.kt index cc4f1cf3f..2cfa3d80a 100644 --- a/app/src/main/java/org/tasks/compose/Subscription.kt +++ b/app/src/main/java/org/tasks/compose/Subscription.kt @@ -41,6 +41,7 @@ import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -140,7 +141,6 @@ object PurchaseText { nameYourPrice: MutableState = mutableStateOf(false), sliderPosition: MutableState = mutableStateOf(0f), github: Boolean = false, - hideText: Boolean, subscribe: (Int, Boolean) -> Unit, onBack: () -> Unit, ) { @@ -176,10 +176,8 @@ object PurchaseText { .background(color = colorResource(R.color.content_background)), horizontalAlignment = Alignment.CenterHorizontally, ) { - if (!hideText) { - GreetingText(R.string.upgrade_blurb_1) - GreetingText(R.string.upgrade_blurb_2) - } + GreetingText(R.string.upgrade_blurb_1) + GreetingText(R.string.upgrade_blurb_2) Spacer(Modifier.height(KEYLINE_FIRST)) val pagerState = rememberPagerState { featureList.size @@ -474,7 +472,6 @@ object PurchaseText { private fun PurchaseDialogPreview() { TasksTheme { SubscriptionScreen( - hideText = false, subscribe = { _, _ -> }, onBack = {}, ) @@ -484,10 +481,10 @@ private fun PurchaseDialogPreview() { @Preview(showBackground = true) @Preview(showBackground = true, uiMode = UI_MODE_NIGHT_YES) @Composable -private fun PurchaseDialogPreviewNoText() { +private fun NameYourPricePreview() { TasksTheme { SubscriptionScreen( - hideText = true, + nameYourPrice = remember { mutableStateOf(true) }, subscribe = { _, _ -> }, onBack = {}, )