|
@@ -8,14 +8,11 @@ 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.fillMaxSize
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
-import androidx.compose.foundation.layout.navigationBars
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.foundation.layout.width
|
|
|
-import androidx.compose.foundation.layout.windowInsetsPadding
|
|
|
import androidx.compose.material3.Text
|
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.ui.Alignment
|
|
@@ -25,10 +22,13 @@ import androidx.compose.ui.res.colorResource
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
import androidx.compose.ui.text.TextStyle
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
+import androidx.compose.ui.unit.TextUnit
|
|
|
+import androidx.compose.ui.unit.TextUnitType
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
import com.fastest.pass.R
|
|
|
import com.fastest.pass.ui.theme.Gray_Splash
|
|
|
+import com.fastest.pass.ui.theme.Typography
|
|
|
import com.fastest.pass.ui.theme.Welcome_BG
|
|
|
import com.fastest.pass.welcome.domain.model.Welcome
|
|
|
import com.google.accompanist.pager.HorizontalPager
|
|
@@ -74,7 +74,9 @@ fun WelcomeTutorial(onClick: (ClickType) -> Unit) {
|
|
|
.background(colorResource(id = R.color.gray_splash))
|
|
|
) { }
|
|
|
|
|
|
- Box(modifier = Modifier.fillMaxSize()) {
|
|
|
+ Box(modifier = Modifier
|
|
|
+ .fillMaxSize()
|
|
|
+ .padding(bottom = 50.dp)) {
|
|
|
|
|
|
HorizontalPager(
|
|
|
count = pages.size,
|
|
@@ -119,38 +121,63 @@ fun WelcomePage(
|
|
|
.fillMaxSize()
|
|
|
.background(Welcome_BG)
|
|
|
) {
|
|
|
- Column(modifier = Modifier.align(Alignment.Center)) {
|
|
|
- Text(
|
|
|
- text = title,
|
|
|
- style = TextStyle(fontSize = 24.sp, textAlign = TextAlign.Center),
|
|
|
- color = Gray_Splash,
|
|
|
- modifier = Modifier.fillMaxWidth()
|
|
|
- )
|
|
|
+ Column(
|
|
|
+ modifier = Modifier
|
|
|
+ .align(Alignment.TopCenter),
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally
|
|
|
+ ) {
|
|
|
+ // Reserve a fixed height for the title
|
|
|
+ Box(
|
|
|
+ modifier = Modifier
|
|
|
+ .fillMaxWidth()
|
|
|
+ .weight(1f)
|
|
|
+ .height(50.dp), // Adjust this height as needed
|
|
|
+ contentAlignment = Alignment.Center
|
|
|
+ ) {
|
|
|
+ Text(
|
|
|
+ text = title,
|
|
|
+ style = Typography.headlineLarge.copy(textAlign = TextAlign.Center, fontSize = TextUnit(24f,
|
|
|
+ TextUnitType.Sp)),
|
|
|
+ color = Gray_Splash,
|
|
|
+ modifier = Modifier.fillMaxWidth()
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
- Spacer(Modifier.height(120.dp))
|
|
|
- // Image at the Center
|
|
|
+ Spacer(Modifier.height(50.dp))
|
|
|
+
|
|
|
+ // Image in the center
|
|
|
Image(
|
|
|
painter = painterResource(id = imageRes),
|
|
|
contentDescription = null,
|
|
|
modifier = Modifier
|
|
|
+ .weight(1f)
|
|
|
.padding(horizontal = 20.dp)
|
|
|
.fillMaxWidth()
|
|
|
.height(250.dp)
|
|
|
-
|
|
|
)
|
|
|
- Spacer(Modifier.height(120.dp))
|
|
|
- // Description at the Bottom
|
|
|
- Text(
|
|
|
- text = description,
|
|
|
- style = TextStyle(fontSize = 15.sp, textAlign = TextAlign.Center),
|
|
|
- color = Gray_Splash,
|
|
|
- textAlign = TextAlign.Center,
|
|
|
+
|
|
|
+ Spacer(Modifier.height(50.dp))
|
|
|
+
|
|
|
+ // Reserve a fixed height for the description
|
|
|
+ Box(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
+ .weight(1f)
|
|
|
+ .height(80.dp), // Adjust this height as needed
|
|
|
+ contentAlignment = Alignment.Center
|
|
|
+ ) {
|
|
|
+ Text(
|
|
|
+ text = description,
|
|
|
+ style = Typography.displaySmall.copy(textAlign = TextAlign.Center, fontSize = TextUnit(14f,
|
|
|
+ TextUnitType.Sp)),
|
|
|
+ color = Gray_Splash,
|
|
|
+ textAlign = TextAlign.Center,
|
|
|
+ modifier = Modifier.fillMaxWidth()
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
- )
|
|
|
- if (page == 2) {
|
|
|
- Spacer(Modifier.height(50.dp))
|
|
|
+ Column(modifier = Modifier.weight(0.5f)) {
|
|
|
+ Spacer(Modifier.height(10.dp))
|
|
|
Row(
|
|
|
verticalAlignment = Alignment.CenterVertically,
|
|
|
horizontalArrangement = Arrangement.Center,
|
|
@@ -159,8 +186,11 @@ fun WelcomePage(
|
|
|
.padding(vertical = 10.dp)
|
|
|
) {
|
|
|
Text(
|
|
|
- text = "LOG IN",
|
|
|
- style = TextStyle(fontSize = 18.sp),
|
|
|
+ text = if (page == 2) "LOG IN" else "",
|
|
|
+ style = Typography.displaySmall.copy(textAlign = TextAlign.Center,
|
|
|
+ fontSize = TextUnit(18f,
|
|
|
+ TextUnitType.Sp)),
|
|
|
+
|
|
|
color = Gray_Splash,
|
|
|
modifier = Modifier.clickable {
|
|
|
onClick.invoke(ClickType.LOGIN_CLICK)
|
|
@@ -168,14 +198,19 @@ fun WelcomePage(
|
|
|
)
|
|
|
Spacer(modifier = Modifier.width(8.dp)) // Add spacing between "Login" and "|"
|
|
|
Text(
|
|
|
- text = "|",
|
|
|
- style = TextStyle(fontSize = 18.sp),
|
|
|
+ text = if (page == 2) "|" else "",
|
|
|
+ style = Typography.displaySmall.copy(textAlign = TextAlign.Center,
|
|
|
+ fontSize = TextUnit(18f,
|
|
|
+ TextUnitType.Sp)),
|
|
|
+
|
|
|
color = Gray_Splash
|
|
|
)
|
|
|
Spacer(modifier = Modifier.width(8.dp)) // Add spacing between "|" and "SignUp"
|
|
|
Text(
|
|
|
- text = "SIGN UP",
|
|
|
- style = TextStyle(fontSize = 18.sp),
|
|
|
+ text = if (page == 2) "SIGN UP" else "",
|
|
|
+ style = Typography.displaySmall.copy(textAlign = TextAlign.Center, fontSize = TextUnit(18f,
|
|
|
+ TextUnitType.Sp)),
|
|
|
+
|
|
|
color = Gray_Splash,
|
|
|
modifier = Modifier.clickable {
|
|
|
onClick.invoke(ClickType.SIGNUP_CLICK)
|
|
@@ -183,7 +218,6 @@ fun WelcomePage(
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|