-
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.
- Loading branch information
Showing
17 changed files
with
244 additions
and
136 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 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 |
---|---|---|
@@ -1,61 +1,7 @@ | ||
import androidx.compose.animation.AnimatedVisibility | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
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.material.Button | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.derivedStateOf | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import org.jetbrains.compose.resources.ExperimentalResourceApi | ||
import org.jetbrains.compose.resources.painterResource | ||
import com.stslex.feature.home.HomeScreen | ||
|
||
@OptIn(ExperimentalResourceApi::class) | ||
@Composable | ||
fun InitialApp() { | ||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(MaterialTheme.colors.background) | ||
) { | ||
val defaultGreetState = "Hello World!" | ||
val clickedGreetState = "Compose: ${Greeting().greet()}" | ||
var isClicked by remember { mutableStateOf(false) } | ||
val greetingText by remember { | ||
derivedStateOf { | ||
if (isClicked) { | ||
clickedGreetState | ||
} else { | ||
defaultGreetState | ||
} | ||
} | ||
} | ||
Column( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Button( | ||
onClick = { | ||
isClicked = !isClicked | ||
} | ||
) { | ||
Text(greetingText) | ||
} | ||
AnimatedVisibility(isClicked) { | ||
Image( | ||
painterResource("compose-multiplatform.xml"), | ||
null | ||
) | ||
} | ||
} | ||
} | ||
HomeScreen() | ||
} |
24 changes: 0 additions & 24 deletions
24
composeApp/src/commonMain/kotlin/main_screen/MainScreen.kt
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
composeApp/src/commonMain/resources/compose-multiplatform.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsCompose) | ||
} | ||
|
||
kotlin { | ||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "core" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(libs.kermit) | ||
implementation(projects.shared) | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
} | ||
commonTest.dependencies { | ||
implementation(libs.kotlin.test) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "com.stslex.core.core" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
defaultConfig { | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...src/commonMain/kotlin/core/CommonUtils.kt → ...otlin/com/stslex/core/core/CommonUtils.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package core | ||
package com.stslex.core.core | ||
|
||
import kotlinx.coroutines.CoroutineExceptionHandler | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...eApp/src/commonMain/kotlin/core/Logger.kt → ...ain/kotlin/com/stslex/core/core/Logger.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package core | ||
package com.stslex.core.core | ||
|
||
import co.touchlab.kermit.Logger as Log | ||
|
||
|
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,52 @@ | ||
import org.jetbrains.compose.ExperimentalComposeLibrary | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsCompose) | ||
} | ||
|
||
kotlin { | ||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "ui" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(project(":core:core")) | ||
|
||
implementation(projects.shared) | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
@OptIn(ExperimentalComposeLibrary::class) | ||
implementation(compose.components.resources) | ||
} | ||
commonTest.dependencies { | ||
implementation(libs.kotlin.test) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "com.stslex.core.ui" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
defaultConfig { | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...eApp/src/commonMain/kotlin/store/Store.kt → ...in/kotlin/com/stslex/core/ui/mvi/Store.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package st.slex.csplashscreen.core.ui.mvi | ||
package com.stslex.core.ui.mvi | ||
|
||
interface Store { | ||
|
||
|
4 changes: 3 additions & 1 deletion
4
...App/src/commonMain/kotlin/store/Router.kt → ...n/com/stslex/core/ui/navigation/Router.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
2 changes: 2 additions & 0 deletions
2
composeApp/src/commonMain/kotlin/AppTheme.kt → ...tlin/com/stslex/core/ui/theme/AppTheme.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
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,53 @@ | ||
import org.jetbrains.compose.ExperimentalComposeLibrary | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsCompose) | ||
} | ||
|
||
kotlin { | ||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "home" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(project(":core:core")) | ||
implementation(project(":core:ui")) | ||
|
||
implementation(projects.shared) | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
@OptIn(ExperimentalComposeLibrary::class) | ||
implementation(compose.components.resources) | ||
} | ||
commonTest.dependencies { | ||
implementation(libs.kotlin.test) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "com.stslex.feature.home" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
defaultConfig { | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
} | ||
} |
Oops, something went wrong.