-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement compose navigator & single activity principle
- Loading branch information
Showing
10 changed files
with
128 additions
and
184 deletions.
There are no files selected for viewing
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
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
67 changes: 67 additions & 0 deletions
67
app/src/main/java/com/rocqjones/mesdk/screens/HomeScreen.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.rocqjones.mesdk.screens | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import androidx.navigation.NavHostController | ||
import com.rocqjones.me_logic.models.Screen | ||
|
||
@Composable | ||
fun HomeScreen(navController: NavHostController) { | ||
|
||
Box { | ||
/** | ||
* When the button is clicked, should navigate to the respective UI | ||
*/ | ||
Column( | ||
modifier = Modifier.fillMaxSize(), | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
val padding = 8.dp | ||
Text( | ||
"Welcome to the Me SDK!", | ||
style = MaterialTheme.typography.headlineMedium, | ||
color = MaterialTheme.colorScheme.secondary, | ||
) | ||
|
||
// list | ||
Button( | ||
modifier = Modifier | ||
.padding(padding) | ||
.fillMaxWidth(), | ||
shape = MaterialTheme.shapes.medium, | ||
onClick = { navController.navigate(Screen.EndlessScreen.route) } | ||
) { | ||
Text( | ||
"Vertical Endless List", | ||
style = MaterialTheme.typography.bodyLarge | ||
) | ||
} | ||
|
||
// Bottom Sheets | ||
Button( | ||
modifier = Modifier | ||
.padding(padding) | ||
.fillMaxWidth(), | ||
shape = MaterialTheme.shapes.medium, | ||
onClick = { navController.navigate(Screen.BottomSheetDialogScreen.route) } | ||
) { | ||
Text( | ||
"Bottom Sheets Dialog", | ||
style = MaterialTheme.typography.bodyLarge | ||
) | ||
} | ||
} | ||
} | ||
} |
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
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
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
10 changes: 10 additions & 0 deletions
10
me-design/src/main/java/com/rocqjones/me_design/screens/BottomSheetDialogScreen.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.rocqjones.me_design.screens | ||
|
||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.navigation.NavHostController | ||
|
||
@Composable | ||
fun BottomSheetDialogScreen(navController: NavHostController) { | ||
Text(text = "BottomSheetDialogScreen") | ||
} |
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
Oops, something went wrong.