Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/src/main/java/to/bitkit/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class MainActivity : FragmentActivity() {
super.onCreate(savedInstanceState)

initNotificationChannel()
initNotificationChannel( // TODO EXTRACT TO Strings
initNotificationChannel(
// TODO EXTRACT TO Strings
id = CHANNEL_ID_NODE,
name = "Lightning node notification",
desc = "Channel for LightningNodeService",
Expand Down Expand Up @@ -257,7 +258,11 @@ class MainActivity : FragmentActivity() {
)

if (appViewModel.showNewTransaction) {
NewTransactionSheet(appViewModel = appViewModel, currencyViewModel = currencyViewModel)
NewTransactionSheet(
appViewModel = appViewModel,
currencyViewModel = currencyViewModel,
settingsViewModel = settingsViewModel,
)
}

SplashScreen(appViewModel.splashVisible)
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/to/bitkit/ui/sheets/NewTransactionSheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import to.bitkit.models.NewTransactionSheetDirection
import to.bitkit.models.NewTransactionSheetType
import to.bitkit.ui.LocalCurrencies
import to.bitkit.ui.LocalCurrencyViewModel
import to.bitkit.ui.LocalSettingsViewModel
import to.bitkit.ui.components.BalanceHeaderView
import to.bitkit.ui.components.BottomSheet
import to.bitkit.ui.components.BottomSheetPreview
Expand All @@ -45,17 +46,20 @@ import to.bitkit.ui.theme.AppThemeSurface
import to.bitkit.ui.utils.localizedRandom
import to.bitkit.viewmodels.AppViewModel
import to.bitkit.viewmodels.CurrencyViewModel
import to.bitkit.viewmodels.SettingsViewModel

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun NewTransactionSheet(
appViewModel: AppViewModel,
currencyViewModel: CurrencyViewModel,
settingsViewModel: SettingsViewModel,
) {
val currencies by currencyViewModel.uiState.collectAsState()

CompositionLocalProvider(
LocalCurrencyViewModel provides currencyViewModel,
LocalSettingsViewModel provides settingsViewModel,
LocalCurrencies provides currencies,
) {
BottomSheet(
Expand Down