-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorganize app code to become more like default M3 theming. Add ui pa…
…ckage name.
- Loading branch information
1 parent
48d6b59
commit bde69a3
Showing
17 changed files
with
74 additions
and
173 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
...geinstaller/src/main/java/dev/atsushieno/cipackageinstaller/CIPackageInstallerActivity.kt
This file was deleted.
Oops, something went wrong.
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
11 changes: 0 additions & 11 deletions
11
cipackageinstaller/src/main/java/dev/atsushieno/cipackageinstaller/ui/theme/Color.kt
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
cipackageinstaller/src/main/java/dev/atsushieno/cipackageinstaller/ui/theme/Type.kt
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
...ler/src/main/java/dev/atsushieno/cipackageinstaller/ui/view/CIPackageInstallerActivity.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,26 @@ | ||
package dev.atsushieno.cipackageinstaller.ui.view | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.ui.Modifier | ||
|
||
open class CIPackageInstallerActivity : ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContent { | ||
CIPackageInstallerTheme { | ||
// A surface container using the 'background' color from the theme | ||
Surface( | ||
modifier = Modifier.fillMaxSize(), | ||
color = MaterialTheme.colorScheme.background | ||
) { | ||
TopLevelNavHost() | ||
} | ||
} | ||
} | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
...ckageinstaller/src/main/java/dev/atsushieno/cipackageinstaller/ui/view/TopLevelNavHost.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,33 @@ | ||
package dev.atsushieno.cipackageinstaller.ui.view | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.compose.rememberNavController | ||
import androidx.navigation.navArgument | ||
|
||
sealed class Routes(val route: String) { | ||
data object Home : Routes("Home") | ||
data object AppDetails : Routes("AppDetails/{index}") { | ||
fun createRoute(index: Int) = "AppDetails/$index" | ||
} | ||
} | ||
|
||
@Composable | ||
fun TopLevelNavHost() { | ||
val navController = rememberNavController() | ||
NavHost(navController = navController, startDestination = Routes.Home.route) { | ||
composable(Routes.Home.route) { | ||
MainScreen(onItemClicked = { index -> | ||
navController.navigate(Routes.AppDetails.createRoute(index)) | ||
}) | ||
} | ||
composable( | ||
Routes.AppDetails.route, | ||
arguments = listOf(navArgument("index") { type = NavType.IntType }) | ||
) { | ||
RepositoryDetails(navController, index = it.arguments!!.getInt("index", 0)) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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