-
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.
- Loading branch information
Showing
14 changed files
with
107 additions
and
48 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
7 changes: 2 additions & 5 deletions
7
...lin/com/client/news/ui/ui/MainActivity.kt → ...in/kotlin/com/client/news/MainActivity.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,19 +1,16 @@ | ||
package com.client.news.ui.ui | ||
package com.client.news | ||
|
||
import android.os.Bundle | ||
import androidx.activity.compose.setContent | ||
import androidx.activity.viewModels | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
private val viewModel: MainViewModel by viewModels() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
setContent { | ||
// MainView(viewModel = viewModel) | ||
NewsApp() | ||
} | ||
} | ||
} |
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,13 @@ | ||
package di | ||
|
||
import dev.icerock.moko.mvvm.viewmodel.ViewModel | ||
import org.koin.androidx.viewmodel.dsl.viewModel | ||
import org.koin.core.definition.Definition | ||
import org.koin.core.definition.KoinDefinition | ||
import org.koin.core.module.Module | ||
import org.koin.core.qualifier.Qualifier | ||
|
||
actual inline fun <reified T : ViewModel> Module.viewModelDefinition( | ||
qualifier: Qualifier?, | ||
noinline definition: Definition<T>, | ||
): KoinDefinition<T> = viewModel(qualifier = qualifier, definition = definition) |
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,6 +1,6 @@ | ||
actual fun getPlatformName(): String = "Android" | ||
import androidx.compose.runtime.Composable | ||
|
||
/*@Composable | ||
fun MainView(viewModel: MainViewModel) { | ||
NewsApp(viewModel = viewModel) | ||
}*/ | ||
@Composable | ||
fun MainView() { | ||
NewsApp() | ||
} |
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,12 @@ | ||
package di | ||
|
||
import dev.icerock.moko.mvvm.viewmodel.ViewModel | ||
import org.koin.core.definition.Definition | ||
import org.koin.core.definition.KoinDefinition | ||
import org.koin.core.module.Module | ||
import org.koin.core.qualifier.Qualifier | ||
|
||
expect inline fun <reified T : ViewModel> Module.viewModelDefinition( | ||
qualifier: Qualifier? = null, | ||
noinline definition: Definition<T> | ||
): KoinDefinition<T> |
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,6 +1,10 @@ | ||
package ui | ||
|
||
/* | ||
expect class MainViewModel() { | ||
import data.repository.MainRepository | ||
import dev.icerock.moko.mvvm.viewmodel.ViewModel | ||
|
||
}*/ | ||
class MainViewModel( | ||
private val repository: MainRepository | ||
) : ViewModel() { | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../commonMain/kotlin/components/NewsItem.kt → ...mmonMain/kotlin/ui/components/NewsItem.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
...ommonMain/kotlin/components/NewsTopBar.kt → ...onMain/kotlin/ui/components/NewsTopBar.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,12 @@ | ||
package di | ||
|
||
import dev.icerock.moko.mvvm.viewmodel.ViewModel | ||
import org.koin.core.definition.Definition | ||
import org.koin.core.definition.KoinDefinition | ||
import org.koin.core.module.Module | ||
import org.koin.core.qualifier.Qualifier | ||
|
||
actual inline fun <reified T : ViewModel> Module.viewModelDefinition( | ||
qualifier: Qualifier?, | ||
noinline definition: Definition<T>, | ||
): KoinDefinition<T> = factory(qualifier = qualifier, definition = definition) |
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,5 +1,3 @@ | ||
import androidx.compose.ui.window.ComposeUIViewController | ||
|
||
actual fun getPlatformName(): String = "iOS" | ||
|
||
fun MainViewController() = ComposeUIViewController { NewsApp() } |