-
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.
Merge pull request #62 from stslex/dev
Dev
- Loading branch information
Showing
65 changed files
with
444 additions
and
501 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
object AppVersions { | ||
const val versionName = "1.63" | ||
const val versionCode = 9 | ||
const val versionName = "1.64" | ||
const val versionCode = 10 | ||
} |
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
core/ui/src/main/java/st/slex/csplashscreen/core/ui/base/ViewModelFactory.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
core/ui/src/main/java/st/slex/csplashscreen/core/ui/di/builder/Feature.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 st.slex.csplashscreen.core.ui.di.builder | ||
|
||
import androidx.lifecycle.ViewModelProvider | ||
|
||
interface Feature { | ||
|
||
val viewModelFactory: ViewModelProvider.Factory | ||
} |
21 changes: 21 additions & 0 deletions
21
core/ui/src/main/java/st/slex/csplashscreen/core/ui/di/builder/FeatureBuilder.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,21 @@ | ||
package st.slex.csplashscreen.core.ui.di.builder | ||
|
||
import android.content.Context | ||
|
||
interface FeatureBuilder<F : Feature> { | ||
|
||
var feature: F? | ||
|
||
fun create(context: Context): F | ||
|
||
fun build( | ||
context: Context | ||
): F = feature ?: create(context) | ||
.also { createdFeature -> | ||
feature = createdFeature | ||
} | ||
|
||
fun clear() { | ||
feature = null | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
core/ui/src/main/java/st/slex/csplashscreen/core/ui/mvi/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package st.slex.csplashscreen.core.ui.mvi | ||
|
||
fun interface Router<in E : Store.Navigation> { | ||
operator fun invoke(event: E) | ||
} |
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
14 changes: 0 additions & 14 deletions
14
core/ui/src/main/java/st/slex/csplashscreen/core/ui/mvi/StoreImpl.kt
This file was deleted.
Oops, something went wrong.
43 changes: 15 additions & 28 deletions
43
...tion/src/main/java/st/slex/csplashscreen/feature/collection/di/SingleCollectionBuilder.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,36 +1,23 @@ | ||
package st.slex.csplashscreen.feature.collection.di | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalContext | ||
import android.content.Context | ||
import st.slex.csplashscreen.core.network.di.NetworkApiBuilder | ||
import st.slex.csplashscreen.core.ui.base.daggerViewModel | ||
import st.slex.csplashscreen.core.ui.di.NavigationApi | ||
import st.slex.csplashscreen.core.ui.di.builder.FeatureBuilder | ||
import st.slex.csplashscreen.core.ui.di.navigationApi | ||
import st.slex.csplashscreen.feature.collection.ui.SingleCollectionViewModel | ||
|
||
object SingleCollectionBuilder { | ||
object SingleCollectionBuilder : FeatureBuilder<SingleCollectionComponent> { | ||
|
||
fun build( | ||
navigationApi: NavigationApi | ||
): SingleCollectionComponent = DaggerSingleCollectionComponent | ||
.factory() | ||
.create( | ||
dependencies = DaggerSingleCollectionComponent_SingleCollectionDependenciesComponent | ||
.factory() | ||
.create( | ||
networkClientApi = NetworkApiBuilder.build(), | ||
navigationApi = navigationApi | ||
) | ||
override var feature: SingleCollectionComponent? = null | ||
|
||
) | ||
} | ||
|
||
@Composable | ||
fun setupComponent(key: String): SingleCollectionViewModel { | ||
val context = LocalContext.current | ||
return daggerViewModel(key) { | ||
SingleCollectionBuilder | ||
.build(context.navigationApi) | ||
.viewModelFactory | ||
} | ||
override fun create(context: Context): SingleCollectionComponent = | ||
DaggerSingleCollectionComponent | ||
.factory() | ||
.create( | ||
dependencies = DaggerSingleCollectionComponent_SingleCollectionDependenciesComponent | ||
.factory() | ||
.create( | ||
networkClientApi = NetworkApiBuilder.build(), | ||
navigationApi = context.navigationApi | ||
) | ||
) | ||
} |
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
8 changes: 3 additions & 5 deletions
8
...c/main/java/st/slex/csplashscreen/feature/collection/navigation/SingleCollectionRouter.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,8 +1,6 @@ | ||
package st.slex.csplashscreen.feature.collection.navigation | ||
|
||
interface SingleCollectionRouter { | ||
import st.slex.csplashscreen.core.ui.mvi.Router | ||
import st.slex.csplashscreen.feature.collection.ui.store.SingleCollectionStore.Navigation | ||
|
||
fun navToImage(uuid: String) | ||
|
||
fun navToProfile(username: String) | ||
} | ||
interface SingleCollectionRouter : Router<Navigation> |
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
13 changes: 1 addition & 12 deletions
13
...on/src/main/java/st/slex/csplashscreen/feature/collection/ui/SingleCollectionViewModel.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,23 +1,12 @@ | ||
package st.slex.csplashscreen.feature.collection.ui | ||
|
||
import st.slex.csplashscreen.core.ui.base.BaseViewModel | ||
import st.slex.csplashscreen.feature.collection.navigation.SingleCollectionRouter | ||
import st.slex.csplashscreen.feature.collection.ui.store.SingleCollectionStore | ||
import st.slex.csplashscreen.feature.collection.ui.store.SingleCollectionStore.Action | ||
import st.slex.csplashscreen.feature.collection.ui.store.SingleCollectionStore.Event | ||
import st.slex.csplashscreen.feature.collection.ui.store.SingleCollectionStore.Event.Navigation | ||
import st.slex.csplashscreen.feature.collection.ui.store.SingleCollectionStore.State | ||
import javax.inject.Inject | ||
|
||
class SingleCollectionViewModel @Inject constructor( | ||
store: SingleCollectionStore, | ||
private val router: SingleCollectionRouter | ||
) : BaseViewModel<State, Event, Action>(store) { | ||
|
||
fun processNavigation(event: Navigation) { | ||
when (event) { | ||
is Navigation.ImageDetail -> router.navToImage(event.uuid) | ||
is Navigation.Profile -> router.navToProfile(event.username) | ||
} | ||
} | ||
} | ||
) : BaseViewModel<State, Event, Action>(store) |
Oops, something went wrong.