diff --git a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt index e572b4e..2093b05 100644 --- a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt +++ b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryListingScreen.kt @@ -57,7 +57,7 @@ import java.time.temporal.ChronoUnit import kotlin.math.roundToInt @Composable -internal fun DirectoryScreen(directoryViewModel: DirectoryState) { +fun DirectoryScreen(directoryViewModel: DirectoryState) { val state = directoryViewModel.current val listState: LazyListState = rememberLazyListState( diff --git a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryModule.kt b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryModule.kt index e464af1..6dd5c5f 100644 --- a/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryModule.kt +++ b/features/directory/src/main/kotlin/app/dapk/st/directory/DirectoryModule.kt @@ -15,7 +15,7 @@ class DirectoryModule( private val chatEngine: ChatEngine, ) : ProvidableModule { - internal fun directoryViewModel(): StateViewModel { + fun directoryViewModel(): StateViewModel { return createStateViewModel { directoryReducer(chatEngine, ShortcutHandler(context), JobBag(), it) } } } diff --git a/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryAction.kt b/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryAction.kt index 37b76fa..3392f36 100644 --- a/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryAction.kt +++ b/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryAction.kt @@ -3,16 +3,16 @@ package app.dapk.st.directory.state import app.dapk.st.engine.DirectoryState import app.dapk.state.Action -internal sealed interface ComponentLifecycle : Action { +sealed interface ComponentLifecycle : Action { object OnVisible : ComponentLifecycle object OnGone : ComponentLifecycle } -internal sealed interface DirectorySideEffect : Action { +sealed interface DirectorySideEffect : Action { object ScrollToTop : DirectorySideEffect } -internal sealed interface DirectoryStateChange : Action { +sealed interface DirectoryStateChange : Action { object Empty : DirectoryStateChange data class Content(val content: DirectoryState) : DirectoryStateChange } diff --git a/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryState.kt b/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryState.kt index bb3fe80..3f20567 100644 --- a/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryState.kt +++ b/features/directory/src/main/kotlin/app/dapk/st/directory/state/DirectoryState.kt @@ -3,9 +3,9 @@ package app.dapk.st.directory.state import app.dapk.st.core.State import app.dapk.st.engine.DirectoryState -internal typealias DirectoryState = State +typealias DirectoryState = State -internal sealed interface DirectoryScreenState { +sealed interface DirectoryScreenState { object EmptyLoading : DirectoryScreenState object Empty : DirectoryScreenState data class Content( @@ -13,7 +13,7 @@ internal sealed interface DirectoryScreenState { ) : DirectoryScreenState } -internal sealed interface DirectoryEvent { +sealed interface DirectoryEvent { data class OpenDownloadUrl(val url: String) : DirectoryEvent object ScrollToTop : DirectoryEvent } diff --git a/features/home/src/main/kotlin/app/dapk/st/home/HomeModule.kt b/features/home/src/main/kotlin/app/dapk/st/home/HomeModule.kt index 653579a..12bfd88 100644 --- a/features/home/src/main/kotlin/app/dapk/st/home/HomeModule.kt +++ b/features/home/src/main/kotlin/app/dapk/st/home/HomeModule.kt @@ -13,7 +13,7 @@ class HomeModule( val betaVersionUpgradeUseCase: BetaVersionUpgradeUseCase, ) : ProvidableModule { - fun homeViewModel(directory: DirectoryState, login: LoginViewModel, profileViewModel: ProfileViewModel): HomeViewModel { + internal fun homeViewModel(directory: DirectoryState, login: LoginViewModel, profileViewModel: ProfileViewModel): HomeViewModel { return HomeViewModel( chatEngine, storeModule.credentialsStore(), diff --git a/features/home/src/main/kotlin/app/dapk/st/home/HomeScreen.kt b/features/home/src/main/kotlin/app/dapk/st/home/HomeScreen.kt index 4590076..5f8ce7d 100644 --- a/features/home/src/main/kotlin/app/dapk/st/home/HomeScreen.kt +++ b/features/home/src/main/kotlin/app/dapk/st/home/HomeScreen.kt @@ -18,7 +18,7 @@ import app.dapk.st.profile.ProfileScreen @OptIn(ExperimentalMaterial3Api::class) @Composable -fun HomeScreen(homeViewModel: HomeViewModel) { +internal fun HomeScreen(homeViewModel: HomeViewModel) { LifecycleEffect( onStart = { homeViewModel.start() }, onStop = { homeViewModel.stop() } diff --git a/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt b/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt index 9bf76da..060ab4a 100644 --- a/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt +++ b/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt @@ -18,10 +18,10 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch -class HomeViewModel( +internal class HomeViewModel( private val chatEngine: ChatEngine, private val credentialsProvider: CredentialsStore, - private val directoryViewModel: DirectoryState, + private val directoryState: DirectoryState, private val loginViewModel: LoginViewModel, private val profileViewModel: ProfileViewModel, private val cacheCleaner: StoreCleaner, @@ -32,7 +32,7 @@ class HomeViewModel( private var listenForInvitesJob: Job? = null - fun directory() = directoryViewModel + fun directory() = directoryState fun login() = loginViewModel fun profile() = profileViewModel @@ -93,7 +93,7 @@ class HomeViewModel( } fun scrollToTopOfMessages() { - directoryViewModel.dispatch(DirectorySideEffect.ScrollToTop) + directoryState.dispatch(DirectorySideEffect.ScrollToTop) } fun changePage(page: Page) {