-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
253c946
commit 89497ea
Showing
24 changed files
with
107 additions
and
189 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
23 changes: 0 additions & 23 deletions
23
androidApp/src/main/java/com/mirego/kmp/boilerplate/Greeting.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
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
androidApp/src/main/java/com/mirego/kmp/boilerplate/app/bootstrap/AppInformationImpl.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
18 changes: 18 additions & 0 deletions
18
androidApp/src/main/java/com/mirego/kmp/boilerplate/app/ui/preview/PreviewProvider.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,18 @@ | ||
package com.mirego.kmp.boilerplate.app.ui.preview | ||
|
||
import androidx.compose.runtime.Composable | ||
import com.mirego.kmp.boilerplate.BuildConfig | ||
import com.mirego.kmp.boilerplate.app.resources.AndroidImageProvider | ||
import com.mirego.kmp.boilerplate.viewmodel.factory.ViewModelFactoryPreview | ||
import com.mirego.trikot.kword.android.PreviewI18N | ||
import com.mirego.trikot.viewmodels.declarative.configuration.TrikotViewModelDeclarative | ||
|
||
@Composable | ||
fun PreviewProvider(content: @Composable (ViewModelFactoryPreview) -> Unit) { | ||
TrikotViewModelDeclarative.initialize(AndroidImageProvider()) | ||
val viewModelFactoryPreview = ViewModelFactoryPreview( | ||
i18N = PreviewI18N(BuildConfig.KWORD_TRANSLATION_FILE_PATH) | ||
) | ||
|
||
content(viewModelFactoryPreview) | ||
} |
24 changes: 23 additions & 1 deletion
24
androidApp/src/main/java/com/mirego/kmp/boilerplate/app/ui/root/RootView.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,13 +1,35 @@ | ||
package com.mirego.kmp.boilerplate.app.ui.root | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.mirego.kmp.boilerplate.app.ui.application.ApplicationView | ||
import com.mirego.kmp.boilerplate.app.ui.preview.PreviewProvider | ||
import com.mirego.kmp.boilerplate.viewmodel.root.RootViewModel | ||
import com.mirego.trikot.viewmodels.declarative.compose.extensions.observeAsState | ||
|
||
@Composable | ||
fun RootView(rootViewModel: RootViewModel) { | ||
val viewModel: RootViewModel by rootViewModel.observeAsState() | ||
Text(text = "Hi") | ||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(Color.White) | ||
) { | ||
Text(text = "Hi") | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun PreviewRootView() { | ||
PreviewProvider { | ||
RootView(rootViewModel = it.createRoot()) | ||
} | ||
} |
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
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,25 @@ | ||
import Shared | ||
import SwiftUI | ||
import Trikot | ||
|
||
struct RootView: View { | ||
@ObservedObject private var observableViewModel: ObservableViewModelAdapter<RootViewModel> | ||
|
||
init(viewModel: RootViewModel) { | ||
observableViewModel = viewModel.asObservable() | ||
} | ||
|
||
var viewModel: RootViewModel { | ||
observableViewModel.viewModel | ||
} | ||
|
||
var body: some View { | ||
Text("Hi") | ||
} | ||
} | ||
|
||
struct RootView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
RootView(viewModel: factoryPreview().createRoot()) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
shared/src/androidMain/kotlin/com/mirego/kmp/boilerplate/Platform.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
shared/src/androidMain/kotlin/com/mirego/kmp/boilerplate/utils/CFlow.kt
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
shared/src/androidUnitTest/kotlin/com.mirego.kmp.boilerplate/AndroidGreetingTest.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
shared/src/commonMain/kotlin/com/mirego/kmp/boilerplate/Platform.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
shared/src/commonMain/kotlin/com/mirego/kmp/boilerplate/utils/CFlow.kt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
shared/src/commonMain/kotlin/com/mirego/kmp/boilerplate/viewmodel/Greeting.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.