This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun ForgotPassword(navController: NavHostController) { | |
Box(modifier = Modifier.fillMaxSize()) { | |
ScaffoldWithTopBarForgotPass(navController) | |
} | |
} | |
@Composable | |
fun ScaffoldWithTopBarForgotPass(navController: NavHostController) { | |
Scaffold( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun SignUp(navController: NavHostController) { | |
Box(modifier = Modifier.fillMaxSize()) { | |
ScaffoldWithTopBar(navController) | |
} | |
} | |
@Composable | |
fun ScaffoldWithTopBar(navController: NavHostController) { | |
Scaffold( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun CustomTopAppBar(navController: NavHostController, title: String, showBackIcon : Boolean) { | |
TopAppBar( | |
title = { | |
Text(text = title) | |
}, | |
navigationIcon = if (showBackIcon && navController.previousBackStackEntry != null) { | |
{ | |
IconButton(onClick = { navController.navigateUp() }) { | |
Icon( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
JetpackComposeDemoTheme { | |
Surface( | |
modifier = Modifier.fillMaxSize(), | |
color = MaterialTheme.colors.background | |
) { | |
ScreenMain() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun LoginPage(navController: NavHostController) { | |
Box(modifier = Modifier.fillMaxSize()) { | |
ClickableText( | |
text = AnnotatedString("Sign up here"), | |
modifier = Modifier | |
.align(Alignment.BottomCenter) | |
.padding(20.dp), | |
onClick = { }, | |
style = TextStyle( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun ScreenMain(){ | |
val navController = rememberNavController() | |
NavHost(navController = navController, startDestination = Routes.Login.route) { | |
composable(Routes.Login.route) { | |
LoginPage(navController = navController) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class Routes(val route: String) { | |
object Login : Routes("Login") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation "androidx.navigation:navigation-compose:2.4.0-alpha04" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Step 1. Add the JitPack repository to your build file | |
allprojects { | |
repositories { | |
... | |
maven { url 'https://jitpack.io' } | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1. Add the JitPack repository to your build file | |
<repositories> | |
<repository> | |
<id>jitpack.io</id> | |
<url>https://jitpack.io</url> | |
</repository> | |
</repositories> | |