-
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 #47 from KevinSchildhorn/FixingDesktopVersion
Fixing desktop version
- Loading branch information
Showing
36 changed files
with
777 additions
and
180 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
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,9 +1,32 @@ | ||
import androidx.compose.material.Text | ||
import androidx.compose.ui.window.Window | ||
import androidx.compose.ui.window.application | ||
import com.kevinschildhorn.fotopresenter.UseCaseFactory | ||
import com.kevinschildhorn.fotopresenter.ui.screens.directory.DirectoryViewModel | ||
import com.kevinschildhorn.fotopresenter.ui.screens.login.LoginViewModel | ||
import com.kevinschildhorn.fotopresenter.ui.screens.playlist.PlaylistViewModel | ||
import com.kevinschildhorn.fotopresenter.ui.screens.slideshow.SlideshowViewModel | ||
|
||
|
||
object KoinPurse { | ||
val loginViewModel = | ||
LoginViewModel(UseCaseFactory.baseLogger, UseCaseFactory.credentialsRepository) | ||
val directoryViewModel = | ||
DirectoryViewModel(UseCaseFactory.playlistRepository, UseCaseFactory.baseLogger) | ||
val slideshowViewModel = SlideshowViewModel(UseCaseFactory.baseLogger) | ||
val playlistViewModel = | ||
PlaylistViewModel(UseCaseFactory.playlistRepository, UseCaseFactory.baseLogger) | ||
} | ||
|
||
fun main() = application { | ||
Window(onCloseRequest = ::exitApplication) { | ||
Text("") | ||
Window( | ||
title = "FotoPresenter", | ||
onCloseRequest = ::exitApplication | ||
) { | ||
MainView( | ||
KoinPurse.loginViewModel, | ||
KoinPurse.directoryViewModel, | ||
KoinPurse.slideshowViewModel, | ||
KoinPurse.playlistViewModel, | ||
) | ||
} | ||
} |
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
62 changes: 62 additions & 0 deletions
62
shared/src/androidMain/kotlin/com/kevinschildhorn/fotopresenter/UseCaseFactoryAndroid.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,62 @@ | ||
package com.kevinschildhorn.fotopresenter | ||
|
||
import com.kevinschildhorn.fotopresenter.domain.RetrieveDirectoryContentsUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.AutoConnectUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.ConnectToServerUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.DisconnectFromServerUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.SaveCredentialsUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.directory.ChangeDirectoryUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.image.RetrieveImageDirectoriesUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.image.RetrieveImageUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.image.RetrieveSlideshowFromPlaylistUseCase | ||
import org.koin.core.component.KoinComponent | ||
import org.koin.core.component.inject | ||
|
||
actual object UseCaseFactory : KoinComponent { | ||
|
||
actual val connectToServerUseCase: ConnectToServerUseCase | ||
get() { | ||
val useCase: ConnectToServerUseCase by inject() | ||
return useCase | ||
} | ||
actual val changeDirectoryUseCase: ChangeDirectoryUseCase | ||
get() { | ||
val useCase: ChangeDirectoryUseCase by inject() | ||
return useCase | ||
} | ||
actual val autoConnectUseCase: AutoConnectUseCase | ||
get() { | ||
val useCase: AutoConnectUseCase by inject() | ||
return useCase | ||
} | ||
actual val saveCredentialsUseCase: SaveCredentialsUseCase | ||
get() { | ||
val useCase: SaveCredentialsUseCase by inject() | ||
return useCase | ||
} | ||
actual val disconnectFromServerUseCase: DisconnectFromServerUseCase | ||
get() { | ||
val useCase: DisconnectFromServerUseCase by inject() | ||
return useCase | ||
} | ||
actual val retrieveImageDirectoriesUseCase: RetrieveImageDirectoriesUseCase | ||
get() { | ||
val useCase: RetrieveImageDirectoriesUseCase by inject() | ||
return useCase | ||
} | ||
actual val retrieveSlideshowFromPlaylistUseCase: RetrieveSlideshowFromPlaylistUseCase | ||
get() { | ||
val useCase: RetrieveSlideshowFromPlaylistUseCase by inject() | ||
return useCase | ||
} | ||
actual val retrieveDirectoryContentsUseCase: RetrieveDirectoryContentsUseCase | ||
get() { | ||
val useCase: RetrieveDirectoryContentsUseCase by inject() | ||
return useCase | ||
} | ||
actual val retrieveImageUseCase: RetrieveImageUseCase | ||
get() { | ||
val useCase: RetrieveImageUseCase by inject() | ||
return useCase | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/UseCaseFactory.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,23 @@ | ||
package com.kevinschildhorn.fotopresenter | ||
|
||
import com.kevinschildhorn.fotopresenter.domain.RetrieveDirectoryContentsUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.AutoConnectUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.ConnectToServerUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.DisconnectFromServerUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.connection.SaveCredentialsUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.directory.ChangeDirectoryUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.image.RetrieveImageDirectoriesUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.image.RetrieveImageUseCase | ||
import com.kevinschildhorn.fotopresenter.domain.image.RetrieveSlideshowFromPlaylistUseCase | ||
|
||
expect object UseCaseFactory { | ||
val connectToServerUseCase: ConnectToServerUseCase | ||
val changeDirectoryUseCase: ChangeDirectoryUseCase | ||
val autoConnectUseCase: AutoConnectUseCase | ||
val saveCredentialsUseCase: SaveCredentialsUseCase | ||
val disconnectFromServerUseCase: DisconnectFromServerUseCase | ||
val retrieveImageDirectoriesUseCase: RetrieveImageDirectoriesUseCase | ||
val retrieveSlideshowFromPlaylistUseCase: RetrieveSlideshowFromPlaylistUseCase | ||
val retrieveDirectoryContentsUseCase: RetrieveDirectoryContentsUseCase | ||
val retrieveImageUseCase: RetrieveImageUseCase | ||
} |
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
35 changes: 32 additions & 3 deletions
35
...monMain/kotlin/com/kevinschildhorn/fotopresenter/data/datasources/ImageCacheDataSource.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
Oops, something went wrong.