-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from luongvo/feat/migrate-to-compose-multiplatform
[feat] Migrate Android and iOS apps to Compose Multiplatform
- Loading branch information
Showing
44 changed files
with
193 additions
and
124 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
3 changes: 0 additions & 3 deletions
3
androidApp/src/androidMain/kotlin/vn/luongvo/kmp/ecommerce/android/AppViewModel.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
8 changes: 0 additions & 8 deletions
8
...c/androidMain/kotlin/vn/luongvo/kmp/ecommerce/android/navigation/AccountAppDestination.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
.../src/androidMain/kotlin/vn/luongvo/kmp/ecommerce/android/navigation/HomeAppDestination.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
.../src/androidMain/kotlin/vn/luongvo/kmp/ecommerce/android/navigation/MenuAppDestination.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...rc/androidMain/kotlin/vn/luongvo/kmp/ecommerce/android/navigation/OrdersAppDestination.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">ecommerce-kmp</string> | ||
|
||
<string name="bottom_nav_account">Account</string> | ||
<string name="bottom_nav_home">Home</string> | ||
<string name="bottom_nav_menu">Menu</string> | ||
<string name="bottom_nav_orders">Orders</string> | ||
</resources> |
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,8 +1,11 @@ | ||
import androidx.compose.ui.window.Window | ||
import androidx.compose.ui.window.application | ||
import vn.luongvo.kmp.ecommerce.presentation.AppViewModel | ||
import vn.luongvo.kmp.ecommerce.presentation.MainApp | ||
|
||
fun main() = application { | ||
val viewModel = AppViewModel() | ||
Window(title = "ecommerce-kmp", onCloseRequest = ::exitApplication) { | ||
// TODO | ||
MainApp(viewModel) | ||
} | ||
} |
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,14 @@ | ||
|
||
import Foundation | ||
import SwiftUI | ||
import shared | ||
|
||
struct ComposeView: UIViewControllerRepresentable { | ||
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { | ||
// ignore | ||
} | ||
|
||
func makeUIViewController(context: Context) -> some UIViewController { | ||
MainKt.MainViewController() | ||
} | ||
} |
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,14 @@ | ||
import SwiftUI | ||
import shared | ||
|
||
struct ContentView: View { | ||
var body: some View { | ||
Text("Home") | ||
} | ||
var body: some View { | ||
ComposeView() | ||
} | ||
} | ||
|
||
struct ContentView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContentView() | ||
} | ||
static var previews: some View { | ||
ContentView() | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
...dMain/kotlin/vn/luongvo/kmp/ecommerce/presentation/screens/main/home/HomeScreenPreview.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,25 @@ | ||
package vn.luongvo.kmp.ecommerce.presentation.screens.main.home | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import vn.luongvo.kmp.ecommerce.data.model.PostResponse | ||
import vn.luongvo.kmp.ecommerce.presentation.theme.ComposeTheme | ||
|
||
@Preview(showSystemUi = true) | ||
@Composable | ||
private fun HomeScreenPreview() { | ||
ComposeTheme { | ||
HomeScreenContent( | ||
isLoading = false, | ||
posts = listOf( | ||
PostResponse( | ||
id = "1", | ||
userId = "1", | ||
title = "title", | ||
body = "body", | ||
) | ||
), | ||
error = null, | ||
) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,6 @@ | ||
<resources> | ||
<string name="bottom_nav_account">Account</string> | ||
<string name="bottom_nav_home">Home</string> | ||
<string name="bottom_nav_menu">Menu</string> | ||
<string name="bottom_nav_orders">Orders</string> | ||
</resources> |
2 changes: 1 addition & 1 deletion
2
...luongvo/kmp/ecommerce/android/AppState.kt → ...vo/kmp/ecommerce/presentation/AppState.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
3 changes: 3 additions & 0 deletions
3
shared/src/commonMain/kotlin/vn/luongvo/kmp/ecommerce/presentation/AppViewModel.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,3 @@ | ||
package vn.luongvo.kmp.ecommerce.presentation | ||
|
||
class AppViewModel |
8 changes: 4 additions & 4 deletions
8
.../luongvo/kmp/ecommerce/android/MainApp.kt → ...gvo/kmp/ecommerce/presentation/MainApp.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: 1 addition & 1 deletion
2
...mmerce/android/base/BaseAppDestination.kt → ...e/presentation/base/BaseAppDestination.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
8 changes: 8 additions & 0 deletions
8
...mmonMain/kotlin/vn/luongvo/kmp/ecommerce/presentation/navigation/AccountAppDestination.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,8 @@ | ||
package vn.luongvo.kmp.ecommerce.presentation.navigation | ||
|
||
import vn.luongvo.kmp.ecommerce.presentation.base.BaseAppDestination | ||
|
||
class AccountAppDestination : BaseAppDestination() { | ||
|
||
object Account : BaseAppDestination("account") | ||
} |
4 changes: 2 additions & 2 deletions
4
...erce/android/navigation/AppDestination.kt → ...presentation/navigation/AppDestination.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
8 changes: 8 additions & 0 deletions
8
.../commonMain/kotlin/vn/luongvo/kmp/ecommerce/presentation/navigation/HomeAppDestination.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,8 @@ | ||
package vn.luongvo.kmp.ecommerce.presentation.navigation | ||
|
||
import vn.luongvo.kmp.ecommerce.presentation.base.BaseAppDestination | ||
|
||
class HomeAppDestination : BaseAppDestination() { | ||
|
||
object Home : BaseAppDestination("home") | ||
} |
10 changes: 5 additions & 5 deletions
10
.../android/navigation/MainBottomNavGraph.kt → ...entation/navigation/MainBottomNavGraph.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
8 changes: 8 additions & 0 deletions
8
.../commonMain/kotlin/vn/luongvo/kmp/ecommerce/presentation/navigation/MenuAppDestination.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,8 @@ | ||
package vn.luongvo.kmp.ecommerce.presentation.navigation | ||
|
||
import vn.luongvo.kmp.ecommerce.presentation.base.BaseAppDestination | ||
|
||
sealed class MenuAppDestination : BaseAppDestination() { | ||
|
||
object Menu : BaseAppDestination("menu") | ||
} |
8 changes: 8 additions & 0 deletions
8
...ommonMain/kotlin/vn/luongvo/kmp/ecommerce/presentation/navigation/OrdersAppDestination.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,8 @@ | ||
package vn.luongvo.kmp.ecommerce.presentation.navigation | ||
|
||
import vn.luongvo.kmp.ecommerce.presentation.base.BaseAppDestination | ||
|
||
class OrdersAppDestination : BaseAppDestination() { | ||
|
||
object Orders : BaseAppDestination("orders") | ||
} |
Oops, something went wrong.