Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6a5be27
chore: colors parameter
jvsena42 Oct 5, 2025
78d2a90
chore: remove background image
jvsena42 Oct 5, 2025
90d7328
feat: implement in receive content screen
jvsena42 Oct 5, 2025
6a07559
chore: remove box
jvsena42 Oct 5, 2025
c0a9766
chore: spacer components
jvsena42 Oct 5, 2025
f15fc1e
feat: implement in ReceiveLiquidityScreen
jvsena42 Oct 5, 2025
e9ebea6
feat: implement in SpendingConfirmScreen
jvsena42 Oct 5, 2025
202ff74
feat: notifications card
jvsena42 Oct 5, 2025
c749118
feat: notifications card
jvsena42 Oct 5, 2025
38589ab
chore: lint
jvsena42 Oct 6, 2025
127e361
chore: lint
jvsena42 Oct 6, 2025
212d59b
Merge branch 'feat/time-sheet-polish' into feat/notifications-settings
jvsena42 Oct 6, 2025
fe56b85
fix: route name
jvsena42 Oct 6, 2025
a905ca0
Merge branch 'feat/time-sheet-polish' into feat/notifications-settings
jvsena42 Oct 8, 2025
c8e164a
Merge branch 'feat/time-sheet-polish' into feat/notifications-settings
jvsena42 Oct 8, 2025
066f21d
fix: suggestion card color
jvsena42 Oct 8, 2025
2ab7848
fix: call RequestNotificationPermissions in liquidity screen
jvsena42 Oct 8, 2025
ad87151
fix: notifications card visibility
jvsena42 Oct 8, 2025
8202b81
fix: handle lost state
jvsena42 Oct 8, 2025
70cd0fc
chore: remove imports
jvsena42 Oct 8, 2025
d408564
Merge branch 'feat/time-sheet-polish' into feat/notifications-settings
jvsena42 Oct 9, 2025
e1e5333
Merge remote-tracking branch 'origin/feat/notifications-settings' int…
jvsena42 Oct 9, 2025
d1a25f7
Merge branch 'feat/time-sheet-polish' into feat/notifications-settings
jvsena42 Oct 9, 2025
02326ff
Merge branch 'feat/time-sheet-polish' into feat/notifications-settings
jvsena42 Oct 10, 2025
e8b0066
Merge branch 'feat/time-sheet-polish' into feat/notifications-settings
jvsena42 Oct 10, 2025
5209cf5
Merge branch 'master' into feat/notifications-settings
jvsena42 Oct 13, 2025
0c5a6a4
fix: solve conflicts
jvsena42 Oct 13, 2025
1ef11ad
fix: solve conflicts
jvsena42 Oct 13, 2025
71e4e35
chore: lint
jvsena42 Oct 13, 2025
55cd625
Merge branch 'master' into feat/notifications-settings
jvsena42 Oct 13, 2025
2f00c65
Merge branch 'refs/heads/master' into feat/notifications-settings
jvsena42 Oct 14, 2025
31505fa
Merge branch 'master' into feat/notifications-settings
jvsena42 Oct 14, 2025
bfe9fd3
fix: padding
jvsena42 Oct 15, 2025
ab27286
fix: ReceiveLiquidityScreen scrollable height
ovitrif Oct 15, 2025
17c5fdf
fix: set up in background text
ovitrif Oct 15, 2025
95a0a7e
fix: setup switch spacing on spending confirm screen
ovitrif Oct 15, 2025
5d8516d
chore: preview
jvsena42 Oct 16, 2025
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
7 changes: 7 additions & 0 deletions app/src/main/java/to/bitkit/models/Suggestion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ enum class Suggestion(
icon = R.drawable.transfer,
dismissible = false,
),
NOTIFICATIONS(
title = R.string.cards__notifications__title,
description = R.string.cards__notifications__description,
color = Colors.Purple24,
icon = R.drawable.bell,
dismissible = true,
),
}

fun String.toSuggestionOrNull() = Suggestion.entries.firstOrNull { it.name == this }
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Switch
import androidx.compose.material3.SwitchColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -25,6 +26,7 @@ fun SettingsSwitchRow(
isChecked: Boolean,
onClick: () -> Unit,
modifier: Modifier = Modifier,
colors: SwitchColors = AppSwitchDefaults.colors,
) {
Column(
modifier = modifier.height(52.dp)
Expand All @@ -42,7 +44,7 @@ fun SettingsSwitchRow(
Switch(
checked = isChecked,
onCheckedChange = null, // handled by parent
colors = AppSwitchDefaults.colors,
colors = colors,
)
}
HorizontalDivider(color = Colors.White10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.synonym.bitkitcore.BtBolt11InvoiceState
import com.synonym.bitkitcore.BtOrderState
Expand All @@ -50,12 +52,17 @@ import to.bitkit.ui.components.LightningChannel
import to.bitkit.ui.components.PrimaryButton
import to.bitkit.ui.components.SwipeToConfirm
import to.bitkit.ui.components.VerticalSpacer
import to.bitkit.ui.components.settings.SettingsSwitchRow
import to.bitkit.ui.scaffold.AppTopBar
import to.bitkit.ui.scaffold.CloseNavIcon
import to.bitkit.ui.scaffold.ScreenColumn
import to.bitkit.ui.theme.AppSwitchDefaults
import to.bitkit.ui.theme.AppThemeSurface
import to.bitkit.ui.theme.Colors
import to.bitkit.ui.utils.NotificationUtils
import to.bitkit.ui.utils.RequestNotificationPermissions
import to.bitkit.ui.utils.withAccent
import to.bitkit.viewmodels.SettingsViewModel
import to.bitkit.viewmodels.TransferViewModel

@Composable
Expand All @@ -66,11 +73,27 @@ fun SpendingConfirmScreen(
onLearnMoreClick: () -> Unit = {},
onAdvancedClick: () -> Unit = {},
onConfirm: () -> Unit = {},
settingsViewModel: SettingsViewModel = hiltViewModel(),
) {
val context = LocalContext.current

val state by viewModel.spendingUiState.collectAsStateWithLifecycle()
val order = state.order ?: return

val order = state.order ?: run {
onCloseClick()
return
}
val isAdvanced = state.isAdvanced

val notificationsGranted by settingsViewModel.notificationsGranted.collectAsStateWithLifecycle()

RequestNotificationPermissions(
onPermissionChange = { granted ->
settingsViewModel.setNotificationPreference(granted)
},
showPermissionDialog = false
)

Content(
onBackClick = onBackClick,
onCloseClick = onCloseClick,
Expand All @@ -80,6 +103,10 @@ fun SpendingConfirmScreen(
onUseDefaultLspBalanceClick = { viewModel.onUseDefaultLspBalanceClick() },
onTransferToSpendingConfirm = { order -> viewModel.onTransferToSpendingConfirm(order) },
order = order,
hasNotificationPermission = notificationsGranted,
onSwitchClick = {
NotificationUtils.openNotificationSettings(context)
},
isAdvanced = isAdvanced
)
}
Expand All @@ -92,6 +119,8 @@ private fun Content(
onAdvancedClick: () -> Unit,
onConfirm: () -> Unit,
onUseDefaultLspBalanceClick: () -> Unit,
onSwitchClick: () -> Unit,
hasNotificationPermission: Boolean,
onTransferToSpendingConfirm: (IBtOrder) -> Unit,
order: IBtOrder,
isAdvanced: Boolean,
Expand Down Expand Up @@ -174,9 +203,20 @@ private fun Content(
showLabels = true,
modifier = Modifier.testTag("SpendingConfirmChannel")
)

VerticalSpacer(16.dp)
}

VerticalSpacer(16.dp)
SettingsSwitchRow(
title = "Set up in background",
isChecked = hasNotificationPermission,
colors = AppSwitchDefaults.colorsPurple,
onClick = onSwitchClick,
modifier = Modifier.fillMaxWidth()
)

VerticalSpacer(31.dp)

Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
PrimaryButton(
text = stringResource(R.string.common__learn_more),
Expand Down Expand Up @@ -298,6 +338,8 @@ private fun Preview() {
updatedAt = "2025-07-28T08:29:03Z",
createdAt = "2025-07-28T08:29:03Z"
),
onSwitchClick = {},
hasNotificationPermission = true,
isAdvanced = false
)
}
Expand Down Expand Up @@ -374,6 +416,8 @@ private fun Preview2() {
updatedAt = "2025-07-28T08:29:03Z",
createdAt = "2025-07-28T08:29:03Z"
),
onSwitchClick = {},
hasNotificationPermission = true,
isAdvanced = true
)
}
Expand Down Expand Up @@ -450,6 +494,8 @@ private fun Preview3() {
updatedAt = "2025-07-28T08:29:03Z",
createdAt = "2025-07-28T08:29:03Z"
),
onSwitchClick = {},
hasNotificationPermission = false,
isAdvanced = false
)
}
Expand Down Expand Up @@ -526,6 +572,8 @@ private fun Preview4() {
updatedAt = "2025-07-28T08:29:03Z",
createdAt = "2025-07-28T08:29:03Z"
),
onSwitchClick = {},
hasNotificationPermission = true,
isAdvanced = true
)
}
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/java/to/bitkit/ui/screens/wallets/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ fun HomeScreen(
activityListViewModel: ActivityListViewModel,
homeViewModel: HomeViewModel = hiltViewModel(),
) {
val context = LocalContext.current
val hasSeenTransferIntro by settingsViewModel.hasSeenTransferIntro.collectAsStateWithLifecycle()
val hasSeenShopIntro by settingsViewModel.hasSeenShopIntro.collectAsStateWithLifecycle()
val hasSeenProfileIntro by settingsViewModel.hasSeenProfileIntro.collectAsStateWithLifecycle()
val hasSeenWidgetsIntro: Boolean by settingsViewModel.hasSeenWidgetsIntro.collectAsStateWithLifecycle()
val bgPaymentsIntroSeen: Boolean by settingsViewModel.bgPaymentsIntroSeen.collectAsStateWithLifecycle()
val quickPayIntroSeen by settingsViewModel.quickPayIntroSeen.collectAsStateWithLifecycle()
val latestActivities by activityListViewModel.latestActivities.collectAsStateWithLifecycle()

val homeUiState by homeViewModel.uiState.collectAsStateWithLifecycle()

val context = LocalContext.current

LaunchedEffect(Unit) {
appViewModel.checkTimedSheets()
}
Expand Down Expand Up @@ -239,6 +239,13 @@ fun HomeScreen(
Suggestion.TRANSFER_CLOSING_CHANNEL -> Unit
Suggestion.LIGHTNING_SETTING_UP -> rootNavController.navigate(Routes.SettingUp)
Suggestion.LIGHTNING_READY -> Unit
Suggestion.NOTIFICATIONS -> {
if (bgPaymentsIntroSeen) {
rootNavController.navigate(Routes.BackgroundPaymentsSettings)
} else {
rootNavController.navigate(Routes.BackgroundPaymentsIntro)
}
}
}
},
onClickAddWidget = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class HomeViewModel @Inject constructor(
Suggestion.SUPPORT,
Suggestion.INVITE,
Suggestion.QUICK_PAY,
Suggestion.NOTIFICATIONS.takeIf { !settings.notificationsGranted },
Suggestion.SHOP,
Suggestion.PROFILE,
)
Expand Down
Loading
Loading