Skip to content

Commit

Permalink
init image ui module
Browse files Browse the repository at this point in the history
  • Loading branch information
stslex committed Dec 1, 2024
1 parent 30d4444 commit 49a12c9
Show file tree
Hide file tree
Showing 139 changed files with 279 additions and 252 deletions.
2 changes: 1 addition & 1 deletion commonApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kotlin {
implementation(project(":core:network:client"))
implementation(project(":core:network:api"))
implementation(project(":core:database"))
implementation(project(":core:ui"))
implementation(project(":core:ui:kit"))
implementation(project(":core:navigation"))

implementation(project(":feature:film_feed"))
Expand Down
2 changes: 1 addition & 1 deletion commonApp/src/commonMain/kotlin/com/stslex/wizard/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.stslex.wizard

import androidx.compose.runtime.Composable
import com.stslex.wizard.config.KoinApp
import com.stslex.wizard.core.ui.theme.AppTheme
import com.stslex.wizard.core.ui.kit.theme.AppTheme
import org.koin.core.KoinApplication

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.stslex.wizard.core.database.di.ModuleCoreDatabase
import com.stslex.wizard.core.navigation.di.ModuleCoreNavigation
import com.stslex.wizard.core.network.api.di.ModuleCoreNetworkApi
import com.stslex.wizard.core.network.client.di.ModuleCoreNetworkClient
import com.stslex.wizard.core.ui.di.ModuleCoreUi
import com.stslex.wizard.core.ui.kit.di.ModuleCoreUi
import com.stslex.wizard.feature.auth.di.ModuleFeatureAuth
import com.stslex.wizard.feature.favourite.di.ModuleFeatureFavourite
import com.stslex.wizard.feature.film.di.ModuleFeatureFilm
Expand Down
2 changes: 1 addition & 1 deletion core/navigation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
kotlin {
sourceSets.commonMain.dependencies {
implementation(project(":core:core"))
implementation(project(":core:ui"))
implementation(project(":core:ui:kit"))

api(libs.compose.navigation)
}
Expand Down
21 changes: 21 additions & 0 deletions core/ui/image/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
alias(libs.plugins.convention.kmp.library.compose)
}

kotlin {
sourceSets {
commonMain.dependencies {
implementation(project(":core:core"))
implementation(project(":core:network:client"))
implementation(libs.bundles.coil)
implementation(libs.bundles.ktor)
implementation(libs.slf4j.simple)
}
iosMain.dependencies {
api(libs.ktor.client.darwin)
}
androidMain.dependencies {
api(libs.ktor.client.android)
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.mvi
package com.stslex.wizard.core.ui.kit.mvi

import androidx.lifecycle.ViewModel
import org.koin.androidx.viewmodel.dsl.viewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.viewModel
package com.stslex.wizard.core.ui.kit.viewModel

import androidx.lifecycle.ViewModel
import org.koin.androidx.viewmodel.dsl.viewModelOf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base
package com.stslex.wizard.core.ui.kit.base

import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
Expand All @@ -25,7 +25,7 @@ import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.stslex.wizard.core.ui.theme.toPx
import com.stslex.wizard.core.ui.kit.theme.toPx
import kotlin.math.roundToInt

fun Modifier.shimmerLoadingAnimation(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base
package com.stslex.wizard.core.ui.kit.base

import androidx.compose.runtime.Stable
import com.stslex.wizard.core.core.error.ErrorRefresh
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base
package com.stslex.wizard.core.ui.kit.base

import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base
package com.stslex.wizard.core.ui.kit.base

import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.SwipeableState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base
package com.stslex.wizard.core.ui.kit.base

enum class SwipeState {
COLLAPSE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.image
package com.stslex.wizard.core.ui.kit.base.image

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.BoxScope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.image
package com.stslex.wizard.core.ui.kit.base.image

enum class ImageType {
KAMEL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.paging
package com.stslex.wizard.core.ui.kit.base.paging

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -12,8 +12,8 @@ import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Modifier
import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_APPEND_TYPE
import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_BOTTOM_TYPE
import com.stslex.wizard.core.ui.base.DotsPrintAnimation
import com.stslex.wizard.core.ui.theme.AppDimension
import com.stslex.wizard.core.ui.kit.base.DotsPrintAnimation
import com.stslex.wizard.core.ui.kit.theme.AppDimension
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterNotNull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.paging
package com.stslex.wizard.core.ui.kit.base.paging

import androidx.compose.runtime.Stable
import com.stslex.wizard.core.core.paging.PagingCoreData
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.paging
package com.stslex.wizard.core.ui.kit.base.paging

import androidx.compose.runtime.Stable
import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_PAGING_TYPE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.paging
package com.stslex.wizard.core.ui.kit.base.paging

import androidx.compose.runtime.Stable
import com.stslex.wizard.core.core.asyncMap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.paging
package com.stslex.wizard.core.ui.kit.base.paging

import androidx.compose.runtime.Stable
import kotlinx.collections.immutable.ImmutableList
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.base.subcompose
package com.stslex.wizard.core.ui.kit.base.subcompose

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.stslex.wizard.core.ui.kit.base.subcompose

enum class SubComposeType {
MAIN,
DEPEND
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.components
package com.stslex.wizard.core.ui.kit.components

import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.BoxScope
Expand Down Expand Up @@ -27,8 +27,8 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import com.stslex.wizard.core.ui.theme.AppDimension
import com.stslex.wizard.core.ui.theme.toPx
import com.stslex.wizard.core.ui.kit.theme.AppDimension
import com.stslex.wizard.core.ui.kit.theme.toPx
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlin.math.roundToInt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.components
package com.stslex.wizard.core.ui.kit.components

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand All @@ -15,7 +15,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import com.stslex.wizard.core.ui.theme.AppDimension
import com.stslex.wizard.core.ui.kit.theme.AppDimension

@Composable
fun AppToolbar(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.components
package com.stslex.wizard.core.ui.kit.components

internal enum class SnackbarSwipeState {
LEFT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.components
package com.stslex.wizard.core.ui.kit.components

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Done
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.stslex.wizard.core.ui.di
package com.stslex.wizard.core.ui.kit.di

import com.stslex.wizard.core.core.AppModule
import com.stslex.wizard.core.ui.pager.pager.StorePagerFactory
import com.stslex.wizard.core.ui.pager.pager.StorePagerFactoryImpl
import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorkerFactory
import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorkerFactoryImpl
import com.stslex.wizard.core.ui.kit.pager.pager.StorePagerFactory
import com.stslex.wizard.core.ui.kit.pager.pager.StorePagerFactoryImpl
import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorkerFactory
import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorkerFactoryImpl
import org.koin.core.annotation.Module
import org.koin.core.module.dsl.bind
import org.koin.core.module.dsl.factoryOf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.mvi
package com.stslex.wizard.core.ui.kit.mvi

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand All @@ -8,9 +8,9 @@ import com.stslex.wizard.core.core.Logger
import com.stslex.wizard.core.core.coroutine.AppCoroutineScope
import com.stslex.wizard.core.core.coroutine.AppCoroutineScopeImpl
import com.stslex.wizard.core.core.coroutineExceptionHandler
import com.stslex.wizard.core.ui.mvi.Store.Action
import com.stslex.wizard.core.ui.mvi.Store.Event
import com.stslex.wizard.core.ui.mvi.Store.State
import com.stslex.wizard.core.ui.kit.mvi.Store.Action
import com.stslex.wizard.core.ui.kit.mvi.Store.Event
import com.stslex.wizard.core.ui.kit.mvi.Store.State
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.stslex.wizard.core.ui.mvi
package com.stslex.wizard.core.ui.kit.mvi

import androidx.compose.material3.SnackbarDuration
import androidx.compose.runtime.Stable
import com.stslex.wizard.core.ui.components.SnackbarType
import com.stslex.wizard.core.ui.kit.components.SnackbarType

interface CommonEvents {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.mvi
package com.stslex.wizard.core.ui.kit.mvi

fun interface Router<in E : Store.Action.Navigation> {
operator fun invoke(event: E)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.stslex.wizard.core.ui.mvi
package com.stslex.wizard.core.ui.kit.mvi

import com.stslex.wizard.core.ui.mvi.Store.Action
import com.stslex.wizard.core.ui.mvi.Store.Event
import com.stslex.wizard.core.ui.mvi.Store.State
import com.stslex.wizard.core.ui.kit.mvi.Store.Action
import com.stslex.wizard.core.ui.kit.mvi.Store.Event
import com.stslex.wizard.core.ui.kit.mvi.Store.State
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stslex.wizard.core.ui.mvi
package com.stslex.wizard.core.ui.kit.mvi

import com.stslex.wizard.core.ui.viewModel.viewModelOf
import com.stslex.wizard.core.ui.kit.viewModel.viewModelOf
import org.koin.core.definition.BeanDefinition
import org.koin.core.definition.KoinDefinition
import org.koin.core.module.Module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.stslex.wizard.core.ui.mvi
package com.stslex.wizard.core.ui.kit.mvi

import androidx.compose.runtime.Composable
import androidx.lifecycle.ViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stslex.wizard.core.ui.pager.mapper
package com.stslex.wizard.core.ui.kit.pager.mapper

import com.stslex.wizard.core.core.paging.PagingCoreItem
import com.stslex.wizard.core.ui.base.paging.PagingItem
import com.stslex.wizard.core.ui.kit.base.paging.PagingItem

fun interface PagingMapper<T : PagingCoreItem, R : PagingItem> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.stslex.wizard.core.ui.pager.pager
package com.stslex.wizard.core.ui.kit.pager.pager

import com.stslex.wizard.core.ui.base.paging.PagingItem
import com.stslex.wizard.core.ui.base.paging.PagingState
import com.stslex.wizard.core.ui.pager.states.PagerLoadEvents
import com.stslex.wizard.core.ui.pager.states.PagerLoadState
import com.stslex.wizard.core.ui.kit.base.paging.PagingItem
import com.stslex.wizard.core.ui.kit.base.paging.PagingState
import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadEvents
import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.stslex.wizard.core.ui.pager.pager
package com.stslex.wizard.core.ui.kit.pager.pager

import com.stslex.wizard.core.core.coroutine.AppCoroutineScope
import com.stslex.wizard.core.core.paging.PagingCoreItem
import com.stslex.wizard.core.core.paging.PagingResponse
import com.stslex.wizard.core.ui.base.paging.PagingConfig
import com.stslex.wizard.core.ui.base.paging.PagingItem
import com.stslex.wizard.core.ui.pager.mapper.PagingMapper
import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig
import com.stslex.wizard.core.ui.kit.base.paging.PagingItem
import com.stslex.wizard.core.ui.kit.pager.mapper.PagingMapper

interface StorePagerFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.stslex.wizard.core.ui.pager.pager
package com.stslex.wizard.core.ui.kit.pager.pager

import com.stslex.wizard.core.core.coroutine.AppCoroutineScope
import com.stslex.wizard.core.core.paging.PagingCoreItem
import com.stslex.wizard.core.core.paging.PagingResponse
import com.stslex.wizard.core.ui.base.paging.PagingConfig
import com.stslex.wizard.core.ui.base.paging.PagingItem
import com.stslex.wizard.core.ui.pager.mapper.PagingMapper
import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorkerFactory
import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig
import com.stslex.wizard.core.ui.kit.base.paging.PagingItem
import com.stslex.wizard.core.ui.kit.pager.mapper.PagingMapper
import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorkerFactory

class StorePagerFactoryImpl(
private val workerFactory: PagingWorkerFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.stslex.wizard.core.ui.pager.pager
package com.stslex.wizard.core.ui.kit.pager.pager

import com.stslex.wizard.core.core.paging.PagingCoreData.Companion.DEFAULT_PAGE
import com.stslex.wizard.core.core.paging.PagingCoreItem
import com.stslex.wizard.core.core.paging.PagingResponse
import com.stslex.wizard.core.ui.base.mapToAppError
import com.stslex.wizard.core.ui.base.paging.PagingConfig
import com.stslex.wizard.core.ui.base.paging.PagingItem
import com.stslex.wizard.core.ui.base.paging.PagingState
import com.stslex.wizard.core.ui.base.paging.pagingMap
import com.stslex.wizard.core.ui.pager.states.PagerLoadEvents
import com.stslex.wizard.core.ui.pager.states.PagerLoadState
import com.stslex.wizard.core.ui.pager.mapper.PagingMapper
import com.stslex.wizard.core.ui.pager.paging_worker.PagingRequestType
import com.stslex.wizard.core.ui.pager.paging_worker.PagingWorker
import com.stslex.wizard.core.ui.kit.base.mapToAppError
import com.stslex.wizard.core.ui.kit.base.paging.PagingConfig
import com.stslex.wizard.core.ui.kit.base.paging.PagingItem
import com.stslex.wizard.core.ui.kit.base.paging.PagingState
import com.stslex.wizard.core.ui.kit.base.paging.pagingMap
import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadEvents
import com.stslex.wizard.core.ui.kit.pager.states.PagerLoadState
import com.stslex.wizard.core.ui.kit.pager.mapper.PagingMapper
import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingRequestType
import com.stslex.wizard.core.ui.kit.pager.paging_worker.PagingWorker
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.MutableSharedFlow
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.stslex.wizard.core.ui.kit.pager.paging_worker

enum class PagingRequestType {
DEFAULT,
QUERY
}
Loading

0 comments on commit 49a12c9

Please sign in to comment.