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
1 change: 1 addition & 0 deletions app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<ID>MagicNumber:OWInvestmentWidget.kt$0xFFE8F5EC</ID>
<ID>MagicNumber:OWInvestmentWidget.kt$100.0</ID>
<ID>MagicNumber:OnboardingScreen.kt$0.95f</ID>
<ID>MagicNumber:OnboardingScreen.kt$20</ID>
<ID>MagicNumber:OnboardingScreen.kt$500</ID>
<ID>MagicNumber:PercentageVarianceSwitcher.kt$100</ID>
<ID>MagicNumber:PercentageVarianceSwitcher.kt$5000</ID>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.davidcrespo.onewallet.presentation.onboarding

import android.os.Build
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.tween
Expand All @@ -10,26 +11,30 @@ 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.WindowInsets
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.ScaffoldDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -135,6 +140,11 @@ private fun OnboardingScreen(
)
}
},
contentWindowInsets = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
WindowInsets(0, 0, 0, 0)
} else {
ScaffoldDefaults.contentWindowInsets
},
modifier = modifier.fillMaxSize()
) { paddingValues ->
HorizontalPager(
Expand All @@ -155,16 +165,20 @@ fun OnboardingContent(
Column(
modifier = Modifier
.fillMaxSize()
.padding(32.dp),
.statusBarsPadding()
.padding(horizontal = 32.dp, vertical = 24.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Image(
painter = painterResource(page.icon),
contentDescription = null,
modifier = Modifier
.weight(1f, fill = false)
.fillMaxWidth(0.95f)
.clip(RoundedCornerShape(50.dp))
.aspectRatio(1f, matchHeightConstraintsFirst = true)
.clip(RoundedCornerShape(20)),
contentScale = ContentScale.Fit
)

Spacer(modifier = Modifier.height(32.dp))
Expand All @@ -175,15 +189,15 @@ fun OnboardingContent(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onBackground,
textAlign = TextAlign.Center,
modifier = Modifier.padding(bottom = 16.dp)
modifier = Modifier.padding(bottom = 8.dp)
)

Text(
text = page.description,
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurfaceVariant,
textAlign = TextAlign.Center,
lineHeight = 24.sp
lineHeight = 22.sp
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package com.davidcrespo.onewallet.presentation.onboarding

import android.os.Build
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.RocketLaunch
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.ScaffoldDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -85,12 +89,18 @@ private fun PortfolioOnboardingScreen(
)
}
},
contentWindowInsets = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
WindowInsets(0, 0, 0, 0)
} else {
ScaffoldDefaults.contentWindowInsets
},
modifier = modifier.fillMaxSize()
) { paddingValues ->
Column(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues)
.statusBarsPadding()
.padding(32.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PriceAlertWorker(
private val alertNotificationRepository: PriceAlertNotificationRepository by inject()

override suspend fun doWork(): Result = runCatching {
telemetry.log("alerts")
telemetry.log("${Build.MODEL} alerts")

// 0) Check if it has notifications configured
if (!canSendNotifications()) {
Expand Down
Loading