Skip to content

Commit

Permalink
Publish source 2024-07-23
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 23, 2024
1 parent e404a44 commit db54eb6
Show file tree
Hide file tree
Showing 323 changed files with 5,543 additions and 1,615 deletions.
1 change: 0 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
!/.idea/dictionaries/
!/.idea/externalDependencies.xml
!/.idea/detekt.xml
!/.idea/vcs.xml
# ktlint code style
!/.idea/codeStyles/codeStyleConfig.xml
!/.idea/codeStyles/Project.xml
Expand Down
10 changes: 0 additions & 10 deletions app/.idea/vcs.xml

This file was deleted.

4 changes: 2 additions & 2 deletions app/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ buildLogic {
app {
version(
yyyy = 2024,
version = 62,
version = 63,
patch = 0,
build = 2
build = 4
)
}
compose {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private fun Explainer(statements: ImmutableList<Statement>) {
append(body.string)
body.linkedSubstrings.forEach { linkedSubstring ->
addStyle(
style = SpanStyle(color = WalletTheme.colors.primary),
style = SpanStyle(color = WalletTheme.colors.bitkeyPrimary),
start = linkedSubstring.range.first,
end = linkedSubstring.range.last + 1
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@ package build.wallet.ui.app.moneyhome

import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInParent
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import build.wallet.bitkey.socrec.ProtectedCustomer
import build.wallet.bitkey.socrec.ProtectedCustomerAlias
import build.wallet.coachmark.CoachmarkIdentifier
import build.wallet.compose.collections.emptyImmutableList
import build.wallet.compose.collections.immutableListOf
import build.wallet.statemachine.core.list.ListModel
Expand All @@ -35,6 +32,7 @@ import build.wallet.ui.components.amount.HeroAmount
import build.wallet.ui.components.button.Button
import build.wallet.ui.components.button.ButtonContentsList
import build.wallet.ui.components.button.RowOfButtons
import build.wallet.ui.components.coachmark.CoachmarkPresenter
import build.wallet.ui.components.header.Header
import build.wallet.ui.components.icon.IconButton
import build.wallet.ui.components.layout.Divider
Expand All @@ -52,95 +50,124 @@ import build.wallet.ui.tooling.PreviewWalletTheme
@Composable
fun MoneyHomeScreen(model: MoneyHomeBodyModel) {
val listState = rememberLazyListState()
Column {
Box(
modifier =
Modifier
.pullRefresh(
refreshing = model.isRefreshing,
onRefresh = model.onRefresh
)
) {
LazyColumn(
var coachmarkOffset by remember { mutableStateOf(Offset(0f, 0f)) }

Box {
// Display a coachmark if needed
model.coachmark?.let { coachmarkModel ->
CoachmarkPresenter(
yOffset = coachmarkOffset.y,
model = coachmarkModel
)
}
Column {
Box(
modifier =
Modifier
.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
state = listState
) {
// Header
item {
Row(
modifier = Modifier.padding(horizontal = 20.dp),
verticalAlignment = Alignment.CenterVertically
) {
Header(
headline = "Home",
headlineTopSpacing = 8.dp,
fillsMaxWidth = false
)
Spacer(Modifier.weight(1F))
ToolbarAccessory(model.trailingToolbarAccessoryModel)
}
Spacer(Modifier.height(48.dp))
}

// Balance + buttons
item {
with(model.balanceModel) {
HeroAmount(
modifier = Modifier.clickable(
interactionSource = MutableInteractionSource(),
indication = null,
onClick = { model.onHideBalance() }
),
primaryAmount = AnnotatedString(primaryAmount),
secondaryAmountWithCurrency = secondaryAmount,
hideBalance = model.hideBalance
.pullRefresh(
refreshing = model.isRefreshing,
onRefresh = model.onRefresh
)
) {
LazyColumn(
modifier =
Modifier
.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
state = listState
) {
// Header
item {
Row(
modifier = Modifier.padding(horizontal = 20.dp),
verticalAlignment = Alignment.CenterVertically
) {
Header(
headline = "Home",
headlineTopSpacing = 8.dp,
fillsMaxWidth = false
)
Spacer(Modifier.weight(1F))
ToolbarAccessory(model.trailingToolbarAccessoryModel)
}
Spacer(Modifier.height(48.dp))
}
Spacer(Modifier.height(4.dp))
MoneyHomeButtons(model = model.buttonsModel)
Spacer(Modifier.height(40.dp))
}

// No UI between the action buttons and the tx list so show a divider
if (model.cardsModel.cards.isEmpty() && model.transactionsModel != null) {
// Balance + buttons
item {
Divider(
modifier =
Modifier
.padding(horizontal = 20.dp)
.padding(top = 16.dp)
)
with(model.balanceModel) {
HeroAmount(
modifier = Modifier
.clickable(
interactionSource = MutableInteractionSource(),
indication = null,
onClick = {
model.onHideBalance()
// dismiss the HiddenBalanceCoachmark coachmark if it's showing since you've interacted with the feature
if (model.coachmark?.identifier ==
CoachmarkIdentifier.HiddenBalanceCoachmark
) {
model.coachmark?.dismiss?.invoke()
}
}
).onGloballyPositioned { layoutCoordinates ->
if (model.coachmark?.identifier == CoachmarkIdentifier.HiddenBalanceCoachmark) {
val positionInParent = layoutCoordinates.positionInParent()
val size = layoutCoordinates.size
coachmarkOffset = Offset(
0f,
positionInParent.y + size.height
)
}
},
primaryAmount = AnnotatedString(primaryAmount),
secondaryAmountWithCurrency = secondaryAmount,
hideBalance = model.hideBalance
)
}
Spacer(Modifier.height(4.dp))
MoneyHomeButtons(model = model.buttonsModel)
Spacer(Modifier.height(40.dp))
}
}

// Cards
items(model.cardsModel.cards) { cardModel ->
MoneyHomeCard(
modifier = Modifier.padding(horizontal = 20.dp),
model = cardModel
)
Spacer(modifier = Modifier.height(24.dp))
}
// No UI between the action buttons and the tx list so show a divider
if (model.cardsModel.cards.isEmpty() && model.transactionsModel != null) {
item {
Divider(
modifier =
Modifier
.padding(horizontal = 20.dp)
.padding(top = 16.dp)
)
}
}

model.transactionsModel?.let { transactionsModel ->
item {
Transactions(
model = transactionsModel,
seeAllButtonModel = model.seeAllButtonModel,
hideValue = model.hideBalance
// Cards
items(model.cardsModel.cards) { cardModel ->
MoneyHomeCard(
modifier = Modifier.padding(horizontal = 20.dp),
model = cardModel
)
Spacer(modifier = Modifier.height(24.dp))
}

model.transactionsModel?.let { transactionsModel ->
item {
Transactions(
model = transactionsModel,
seeAllButtonModel = model.seeAllButtonModel,
hideValue = model.hideBalance
)
}
}
}
}

PullRefreshIndicator(
modifier = Modifier.align(Alignment.TopCenter),
refreshing = model.isRefreshing,
onRefresh = model.onRefresh
)
PullRefreshIndicator(
modifier = Modifier.align(Alignment.TopCenter),
refreshing = model.isRefreshing,
onRefresh = model.onRefresh
)
}
}
}
}
Expand Down Expand Up @@ -314,6 +341,7 @@ internal fun MoneyHomeScreenFull(hideBalance: Boolean = false) {
size = Size.Footer,
onClick = StandardClick {}
),
coachmark = null,
buttonsModel =
MoneyHomeButtonsModel.MoneyMovementButtonsModel(
sendButton =
Expand All @@ -334,7 +362,8 @@ internal fun MoneyHomeScreenFull(hideBalance: Boolean = false) {
),
refresh = {},
onRefresh = {},
isRefreshing = false
isRefreshing = false,
badgedSettingsIcon = true
)
)
}
Expand All @@ -352,6 +381,7 @@ internal fun MoneyHomeScreenLite() {
protectedCustomers = immutableListOf(
ProtectedCustomer("", ProtectedCustomerAlias("Alice"))
),
badgedSettingsIcon = false,
onProtectedCustomerClick = {},
onBuyOwnBitkeyClick = {},
onAcceptInviteClick = {}
Expand All @@ -370,6 +400,7 @@ internal fun MoneyHomeScreenLiteWithoutProtectedCustomers() {
onSettings = {},
buttonModel = MoneyHomeButtonsModel.SingleButtonModel(onSetUpBitkeyDevice = { }),
protectedCustomers = immutableListOf(),
badgedSettingsIcon = true,
onProtectedCustomerClick = {},
onBuyOwnBitkeyClick = {},
onAcceptInviteClick = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal fun FwupInstructionsScreenPreview() {
buttonText = "Click me",
onButtonClick = {},
eventTrackerScreenId = null,
eventTrackerScreenIdContext = null
eventTrackerContext = null
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ private fun SettingsSection(model: SettingsBodyModel.SectionModel) {
specialTrailingAccessory = rowModel.specialTrailingIconModel?.let { model ->
ListItemAccessory.IconAccessory(model = model)
},
onClick = rowModel.onClick
onClick = rowModel.onClick,
showNewCoachmark = rowModel.showNewCoachmark
)
Divider()
}
Expand Down Expand Up @@ -116,6 +117,12 @@ internal fun SettingsScreenPreview() {
iconSize = Small,
iconTint = IconTint.Warning
)
) {},
SettingsBodyModel.RowModel(
icon = Icon.SmallIconLock,
title = "App Security",
isDisabled = false,
showNewCoachmark = true
) {}
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ActivationInstructionsFormScreenSnapshots : FunSpec({
onBack = {},
onContinue = {},
isNavigatingBack = false,
eventTrackerScreenIdContext = PairHardwareEventTrackerScreenIdContext.ACCOUNT_CREATION
eventTrackerContext = PairHardwareEventTrackerScreenIdContext.ACCOUNT_CREATION
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class HardwareFingerprintEnrollmentScreenSnapshots : FunSpec({
onSaveFingerprint = {},
onErrorOverlayClosed = {},
isNavigatingBack = false,
eventTrackerScreenIdContext = PairHardwareEventTrackerScreenIdContext.ACCOUNT_CREATION,
eventTrackerContext = PairHardwareEventTrackerScreenIdContext.ACCOUNT_CREATION,
presentationStyle = ScreenPresentationStyle.Root,
headline = "Set up your first fingerprint",
instructions = "Place your finger on the sensor until you see a blue light. Lift your" +
" finger and repeat (15-20 times) adjusting your finger position slightly each time," +
" until the light turns green. Then save your fingerprint.",
" finger and repeat (15-20 times) adjusting your finger position slightly each time," +
" until the light turns green. Then save your fingerprint."
)
PairNewHardwareScreen(
model =
Expand Down
Loading

0 comments on commit db54eb6

Please sign in to comment.