diff --git a/.idea/artifacts/ese_core_js_0_0_B.xml b/.idea/artifacts/ese_core_js_0_0_B.xml
index 0dcb678..0d4e409 100644
--- a/.idea/artifacts/ese_core_js_0_0_B.xml
+++ b/.idea/artifacts/ese_core_js_0_0_B.xml
@@ -2,7 +2,7 @@
$PROJECT_DIR$/ese-core/build/libs
-
+
\ No newline at end of file
diff --git a/.idea/artifacts/ese_core_jvm_0_0_B.xml b/.idea/artifacts/ese_core_jvm_0_0_B.xml
index 9fe8bd4..f3dda90 100644
--- a/.idea/artifacts/ese_core_jvm_0_0_B.xml
+++ b/.idea/artifacts/ese_core_jvm_0_0_B.xml
@@ -2,7 +2,7 @@
$PROJECT_DIR$/ese-core/build/libs
-
+
\ No newline at end of file
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 1bec35e..fc3105b 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -1,5 +1,8 @@
+
+
+
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index f1e33a2..2c89b79 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -12,10 +12,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 58e76bb..3f93fcb 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -26,22 +26,9 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 7e49269..0ad7d74 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -4,6 +4,6 @@
-
+
\ No newline at end of file
diff --git a/clients/androidApp/build.gradle.kts b/clients/androidApp/build.gradle.kts
index e758a78..10414d9 100644
--- a/clients/androidApp/build.gradle.kts
+++ b/clients/androidApp/build.gradle.kts
@@ -12,6 +12,8 @@ kotlin {
val androidMain by getting {
dependencies {
implementation(projects.composeShared)
+ val nav_version = "2.5.3"
+ implementation("androidx.navigation:navigation-compose:$nav_version")
}
}
}
diff --git a/clients/androidApp/src/main/java/me/naotiki/ese/MainActivity.kt b/clients/androidApp/src/main/java/me/naotiki/ese/MainActivity.kt
index 91a1b53..e848686 100644
--- a/clients/androidApp/src/main/java/me/naotiki/ese/MainActivity.kt
+++ b/clients/androidApp/src/main/java/me/naotiki/ese/MainActivity.kt
@@ -1,36 +1,114 @@
package me.naotiki.ese
import AppContainer
-import LocalDefaultFont
import Terminal
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
-import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.text.BasicText
-import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.material.Text
-import androidx.compose.material.TextField
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.*
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Settings
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
-import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.text.AnnotatedString
-import androidx.compose.ui.text.TextStyle
-import androidx.compose.ui.text.input.KeyboardType
-import androidx.compose.ui.text.style.TextOverflow
-import androidx.compose.ui.unit.sp
+import androidx.navigation.NavBackStackEntry
+import androidx.navigation.NavGraphBuilder
+import androidx.navigation.compose.NavHost
+import androidx.navigation.compose.composable
+import androidx.navigation.compose.rememberNavController
import initializeComposeCommon
+import kotlinx.coroutines.CoroutineScope
+import me.naotiki.ese.Screen.Companion.buildRoute
+import me.naotiki.ese.core.PlatformImpl
import me.naotiki.ese.core.appName
+import me.naotiki.ese.core.initializePlatformImpl
import targetActivity
+import java.io.File
+
+
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
println("Starting... ${appName}")
- targetActivity=this
+
+ targetActivity = this
initializeComposeCommon()
+ initializePlatformImpl(object :PlatformImpl{
+ override fun getEseHomeDir(): File? {
+ return getExternalFilesDir(null)
+ }
+ })
+ var file: File? = null
+ /*val launcher = registerForActivityResult(object : ActivityResultContracts.OpenDocumentTree() {
+ override fun createIntent(context: Context, input: Uri?): Intent {
+ return super.createIntent(context, input).apply {
+ flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
+ }
+ }
+ }) {
+ if (it != null) {
+ contentResolver.takePersistableUriPermission(it, Intent.FLAG_GRANT_READ_URI_PERMISSION)
+ DocumentFile.fromTreeUri(this, it)
+
+ }
+ }*/
+
setContent {
AppContainer {
- Terminal()
+ val navController = rememberNavController()
+ Scaffold(topBar = {
+ TopAppBar(title = {
+ Text("Ese Android")
+ }, actions = {
+ IconButton({
+ navController.navigate(Screen.Settings.route) {
+ // Pop up to the start destination of the graph to
+ // avoid building up a large stack of destinations
+ // on the back stack as users select items
+
+ popUpTo(navController.graph.startDestinationId) {
+ saveState = true
+
+ }
+ // Avoid multiple copies of the same destination when
+ // reselecting the same item
+ launchSingleTop = true
+ // Restore state when reselecting a previously selected item
+ restoreState = true
+ }
+ }) {
+ Icon(Icons.Default.Settings,null)
+ }
+ })
+ }) { paddingValues ->
+ val coroutineScope= rememberCoroutineScope()
+ NavHost(navController, Screen.Terminal.route, Modifier.padding(paddingValues)) {
+ buildRoute(coroutineScope)
+ }
+
+ }
+ }
+ }
+ }
+}
+
+enum class Screen(val route: String, val content: @Composable (NavBackStackEntry,CoroutineScope) -> Unit) {
+ Terminal("terminal", {_,c->
+ Terminal()
+ }),
+ Settings("settings", {a,b->
+ Text("設定")
+ });
+
+ companion object{
+ fun NavGraphBuilder.buildRoute(coroutineScope: CoroutineScope) {
+ values().forEach {
+ composable(it.route,content={nav->
+ it.content(nav,coroutineScope)
+
+ })
}
}
}
diff --git a/clients/androidApp/src/main/res/values-night/themes.xml b/clients/androidApp/src/main/res/values-night/themes.xml
index 4d801c4..fb8175a 100644
--- a/clients/androidApp/src/main/res/values-night/themes.xml
+++ b/clients/androidApp/src/main/res/values-night/themes.xml
@@ -1,6 +1,6 @@
-
+
-