fixing visibility

This commit is contained in:
Adam Brown 2022-10-31 22:39:25 +00:00
parent b243a93782
commit 6c3006142b
7 changed files with 14 additions and 14 deletions

View File

@ -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(

View File

@ -15,7 +15,7 @@ class DirectoryModule(
private val chatEngine: ChatEngine,
) : ProvidableModule {
internal fun directoryViewModel(): StateViewModel<DirectoryScreenState, DirectoryEvent> {
fun directoryViewModel(): StateViewModel<DirectoryScreenState, DirectoryEvent> {
return createStateViewModel { directoryReducer(chatEngine, ShortcutHandler(context), JobBag(), it) }
}
}

View File

@ -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
}

View File

@ -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<DirectoryScreenState, DirectoryEvent>
typealias DirectoryState = State<DirectoryScreenState, DirectoryEvent>
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
}

View File

@ -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(),

View File

@ -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() }

View File

@ -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) {