-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae470e0
commit fc653c9
Showing
6 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...ava/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<SubscriptionViewModel>(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"), | ||
) | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...va/io/horizontalsystems/bankwallet/modules/settings/subscription/SubscriptionViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <T : ViewModel> create(modelClass: Class<T>): T { | ||
return SubscriptionViewModel(App.localStorage) as T | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M12,2C12.395,2 12.753,2.232 12.913,2.593L15.432,8.24L21.603,8.881C21.997,8.922 22.329,9.191 22.451,9.567C22.573,9.944 22.462,10.356 22.167,10.62L17.555,14.75L18.849,20.791C18.932,21.177 18.779,21.576 18.46,21.808C18.141,22.041 17.714,22.064 17.372,21.866L12,18.771L6.628,21.866C6.286,22.064 5.859,22.041 5.54,21.808C5.221,21.576 5.068,21.177 5.151,20.791L6.445,14.75L1.833,10.62C1.538,10.356 1.427,9.944 1.549,9.567C1.671,9.191 2.003,8.922 2.397,8.881L8.568,8.24L11.087,2.593C11.248,2.232 11.605,2 12,2ZM12,5.455L10.16,9.582C10.014,9.909 9.705,10.132 9.35,10.169L4.849,10.637L8.212,13.647C8.479,13.887 8.598,14.251 8.522,14.602L7.578,19.011L11.501,16.75C11.81,16.572 12.19,16.572 12.499,16.75L16.423,19.011L15.478,14.602C15.403,14.251 15.521,13.887 15.788,13.647L19.151,10.637L14.65,10.169C14.295,10.132 13.986,9.909 13.84,9.582L12,5.455Z" | ||
android:fillColor="#808085" | ||
android:fillType="evenOdd"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters