diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/main/MainSettingsScreen.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/main/MainSettingsScreen.kt index ff73bbede2..14cff89f89 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/main/MainSettingsScreen.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/main/MainSettingsScreen.kt @@ -255,6 +255,17 @@ private fun SettingSections( } ) }, + { + HsSettingCell( + R.string.Settings_Subscription, + R.drawable.ic_star_24, + value = stringResource(R.string.SettingsSubscription_Active), + onClick = { + navController.slideFromRight(R.id.subscriptionFragment) + + } + ) + }, { HsSettingCell( R.string.Settings_BaseCurrency, diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionFragment.kt new file mode 100644 index 0000000000..bf5f9a11e9 --- /dev/null +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionFragment.kt @@ -0,0 +1,84 @@ +package io.horizontalsystems.bankwallet.modules.settings.subscription + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.lifecycle.viewmodel.compose.viewModel +import androidx.navigation.NavController +import io.horizontalsystems.bankwallet.R +import io.horizontalsystems.bankwallet.core.BaseComposeFragment +import io.horizontalsystems.bankwallet.ui.compose.ComposeAppTheme +import io.horizontalsystems.bankwallet.ui.compose.components.AppBar +import io.horizontalsystems.bankwallet.ui.compose.components.CellUniversalLawrenceSection +import io.horizontalsystems.bankwallet.ui.compose.components.HsBackButton +import io.horizontalsystems.bankwallet.ui.compose.components.InfoText +import io.horizontalsystems.bankwallet.ui.compose.components.RowUniversal +import io.horizontalsystems.bankwallet.ui.compose.components.VSpacer +import io.horizontalsystems.bankwallet.ui.compose.components.body_leah +import io.horizontalsystems.bankwallet.ui.compose.components.subhead1_jacob + +class SubscriptionFragment : BaseComposeFragment() { + + @Composable + override fun GetContent(navController: NavController) { + SubscriptionScreen(navController) + } + +} + +@Composable +fun SubscriptionScreen(navController: NavController) { + val viewModel = viewModel(factory = SubscriptionModule.Factory()) + + Column( + modifier = Modifier.background(color = ComposeAppTheme.colors.tyler) + ) { + AppBar( + title = stringResource(R.string.Settings_Subscription), + navigationIcon = { + HsBackButton(onClick = { navController.popBackStack() }) + } + ) + Column( + Modifier.verticalScroll(rememberScrollState()) + ) { + VSpacer(12.dp) + CellUniversalLawrenceSection { + RowUniversal( + modifier = Modifier.padding(horizontal = 16.dp), + onClick = { + //todo add action + } + ) { + body_leah( + text = stringResource(R.string.SettingsSubscription_SubscriptionPlan), + maxLines = 1, + modifier = Modifier.weight(1f) + ) + subhead1_jacob( + text = "PRO", + maxLines = 1, + modifier = Modifier.padding(horizontal = 8.dp) + ) + Image( + modifier = Modifier.size(20.dp), + painter = painterResource(id = R.drawable.ic_arrow_right), + contentDescription = null, + ) + } + } + InfoText( + text = stringResource(R.string.SettingsSubscription_SubscriptionInfo, "10.06.25"), + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionViewModel.kt new file mode 100644 index 0000000000..480b88c5d1 --- /dev/null +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionViewModel.kt @@ -0,0 +1,23 @@ +package io.horizontalsystems.bankwallet.modules.settings.subscription + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider +import io.horizontalsystems.bankwallet.core.App +import io.horizontalsystems.bankwallet.core.ILocalStorage + +class SubscriptionViewModel( + private val localStorage: ILocalStorage +) : ViewModel() { + + +} + + +object SubscriptionModule { + class Factory : ViewModelProvider.Factory { + @Suppress("UNCHECKED_CAST") + override fun create(modelClass: Class): T { + return SubscriptionViewModel(App.localStorage) as T + } + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_star_24.xml b/app/src/main/res/drawable/ic_star_24.xml new file mode 100644 index 0000000000..004fa73694 --- /dev/null +++ b/app/src/main/res/drawable/ic_star_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/navigation/main_graph.xml b/app/src/main/res/navigation/main_graph.xml index b69f391bb9..23f0899ae1 100644 --- a/app/src/main/res/navigation/main_graph.xml +++ b/app/src/main/res/navigation/main_graph.xml @@ -111,6 +111,9 @@ + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d76c44ae60..03a3891647 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -818,6 +818,7 @@ Rate Us Launch Screen Appearance + Subscription via Telegram via E-mail Auto-Lock @@ -862,6 +863,11 @@ Full Power Unleash the Full Power of Unstoppable Wallet + + Active + Subscription Plan + Next payment date: %s. You can manage your subscription in the Manage Subscription section. + Premium Choose the plan