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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PadawanActivity : AppCompatActivity() {

setContent {
PadawanTheme {
HomeNavigation()
HomeNavigation()
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ fun LessonCircle(lessonNumber: Int, completed: Boolean, selected: Boolean, selec
style = Stroke(width = 10f)
)
}
.clickable {
.noRippleClickable {
selectedChapter.value = lessonNumber
Log.i(TAG, "Clicked on chapter $lessonNumber")
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,6 @@ fun IntroNavigation(onBuildWalletButtonClicked: (WalletCreateType) -> Unit) {
},
) { OnboardingScreen(navController = navController, onBuildWalletButtonClicked) }

composable(
route = Screen.WalletChoiceScreen.route,
enterTransition = {
slideIntoContainer(AnimatedContentScope.SlideDirection.Start, animationSpec = tween(animationDuration))
},
exitTransition = {
slideOutOfContainer(AnimatedContentScope.SlideDirection.Start, animationSpec = tween(animationDuration))
},
popEnterTransition = {
slideIntoContainer(AnimatedContentScope.SlideDirection.End, animationSpec = tween(animationDuration))
},
popExitTransition = {
slideOutOfContainer(AnimatedContentScope.SlideDirection.End, animationSpec = tween(animationDuration))
}
) { WalletChoiceScreen(navController = navController, onBuildWalletButtonClicked) }

composable(
route = Screen.WalletRecoveryScreen.route,
enterTransition = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ package com.goldenraven.padawanwallet.ui.intro

import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
Expand All @@ -30,6 +34,8 @@ import com.goldenraven.padawanwallet.theme.*
import com.goldenraven.padawanwallet.ui.Screen
import com.goldenraven.padawanwallet.ui.ShowBars
import com.goldenraven.padawanwallet.ui.standardBorder
import com.goldenraven.padawanwallet.utils.ScreenSizeHeight
import com.goldenraven.padawanwallet.utils.getScreenSizeHeight

private const val TAG = "OnboardingScreen"

Expand All @@ -38,9 +44,130 @@ internal fun OnboardingScreen(
navController: NavController,
onBuildWalletButtonClicked: (WalletCreateType) -> Unit
) {
val screenSizeHeight: ScreenSizeHeight = getScreenSizeHeight(LocalConfiguration.current.screenHeightDp)
val pageScrollState: ScrollState = rememberScrollState()

ShowBars()

if (screenSizeHeight == ScreenSizeHeight.Small) {
SmallOnboarding(
pageScrollState = pageScrollState,
navController = navController,
onBuildWalletButtonClicked = onBuildWalletButtonClicked
)
} else {
PhoneOnboarding(
navController = navController,
onBuildWalletButtonClicked = onBuildWalletButtonClicked
)
}
}

@Composable
internal fun SmallOnboarding(
pageScrollState: ScrollState,
navController: NavController,
onBuildWalletButtonClicked: (WalletCreateType) -> Unit
) {
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.fillMaxWidth()
.fillMaxSize()
.background(Color(0xffffffff))
// .padding(top = 70.dp)
.verticalScroll(pageScrollState)
) {
Image(
painter = painterResource(id = R.drawable.ic_padawan_colour_foreground),
contentDescription = "Padawan Logo",
Modifier.size(140.dp)
)
Text(
text = "Padawan Wallet",
style = PadawanTypography.headlineLarge,
fontSize = 34.sp,
color = Color(0xff1f0208),
modifier = Modifier
.padding(start = 24.dp, end = 24.dp, bottom = 8.dp)
)

Text(
stringResource(R.string.welcome_statement),
style = PadawanTypography.bodyMedium,
fontSize = 16.sp,
color = Color(0xff787878),
modifier = Modifier
.padding(start = 24.dp, end = 24.dp, bottom = 12.dp)
)

Button(
onClick = {
Log.i(TAG, "Creating a wallet")
onBuildWalletButtonClicked(WalletCreateType.FROMSCRATCH)
},
colors = ButtonDefaults.buttonColors(containerColor = Color(0xfff6cf47)),
shape = RoundedCornerShape(20.dp),
border = standardBorder,
modifier = Modifier
.padding(top = 4.dp, start = 4.dp, end = 4.dp, bottom = 4.dp)
.standardShadow(20.dp)
.height(70.dp)
.width(240.dp)
.align(Alignment.CenterHorizontally)
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(vertical = 4.dp)
) {
Text(
text = "Create a wallet",
// style = GargoyleTypography.labelLarge,
color = Color(0xff000000)
)
// Spacer(modifier = Modifier.width(8.dp))
}
}

Row(
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.Bottom,
modifier = Modifier
.padding(bottom = 24.dp)
) {
Text(
text = "Already have a wallet?",
color = Color(0xff787878),
modifier = Modifier
.padding(start = 24.dp, bottom = 8.dp)
.height(40.dp)
)
TextButton(
onClick = {
Log.i("OnboardScreen", "Recovering a wallet")
navController.navigate(Screen.WalletRecoveryScreen.route)
},
modifier = Modifier
.width(120.dp)
.padding(0.dp)
.height(70.dp)
) {
Text(
text = "Recover it here",
color = Color(0xff787878),
style = TextStyle(textDecoration = TextDecoration.Underline)
)
}
}
}
}

@Composable
internal fun PhoneOnboarding(
navController: NavController,
onBuildWalletButtonClicked: (WalletCreateType) -> Unit
) {
ConstraintLayout(
modifier = Modifier
.fillMaxSize()
Expand Down

This file was deleted.

Loading