Skip to content

Commit

Permalink
Merge pull request #57 from KevinSchildhorn/ks/UpdatingImageQueries
Browse files Browse the repository at this point in the history
Updating Queries
  • Loading branch information
KevinSchildhorn authored Oct 16, 2024
2 parents ab1f91e + a48db17 commit 5e6014b
Show file tree
Hide file tree
Showing 113 changed files with 1,078 additions and 1,300 deletions.
4 changes: 4 additions & 0 deletions .editorConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*.{kt,kts}]
ktlint_function_naming_ignore_when_annotated_with=Composable
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Compiled class file
*.class
*.DS_STORE

# Log file
*.log
Expand Down Expand Up @@ -34,7 +35,6 @@ ios/FotoPresenter.xcworkspace/xcuserdata/kevinschildhorn.xcuserdatad/xcdebugger/
ios/FotoPresenter.xcworkspace/xcuserdata/kevinschildhorn.xcuserdatad/UserInterfaceState.xcuserstate
*.hprof
ios/FotoPresenter.xcworkspace/xcuserdata/kevinschildhorn.xcuserdatad/UserInterfaceState.xcuserstate
ios/FotoPresenter.xcworkspace/xcuserdata/kevinschildhorn.xcuserdatad/UserInterfaceState.xcuserstate
common/src/commonMain/kotlin/me/kevinschildhorn/common/network/ftps/TestingLoginInfo.kt
androidApp/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab_i.len

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import coil3.ImageLoader
import coil3.compose.setSingletonImageLoaderFactory
import com.kevinschildhorn.fotopresenter.SMBJFetcher
import com.kevinschildhorn.fotopresenter.data.datasources.image.CachedImageDataSource
import com.kevinschildhorn.fotopresenter.ui.SMBJFetcher
import com.kevinschildhorn.fotopresenter.data.network.NetworkHandler
import com.kevinschildhorn.fotopresenter.data.repositories.ImageRepository
import com.kevinschildhorn.fotopresenter.startKoin
import com.kevinschildhorn.fotopresenter.ui.screens.directory.DirectoryViewModel
import com.kevinschildhorn.fotopresenter.ui.screens.login.LoginViewModel
Expand All @@ -23,7 +25,7 @@ class MainActivity : AppCompatActivity(), KoinComponent {
private val directoryViewModel by viewModel<DirectoryViewModel>()
private val slideshowViewModel by viewModel<SlideshowViewModel>()
private val playlistViewModel by viewModel<PlaylistViewModel>()
private val networkHandler: NetworkHandler by inject()
private val imageRepository: ImageRepository by inject()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -33,7 +35,7 @@ class MainActivity : AppCompatActivity(), KoinComponent {
setSingletonImageLoaderFactory { context ->
ImageLoader.Builder(context)
.components {
add(SMBJFetcher.Factory(networkHandler))
add(SMBJFetcher.Factory(imageRepository))
}
.build()
}
Expand Down
3 changes: 1 addition & 2 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
alias(libs.plugins.jetbrains.compose)
alias(libs.plugins.ktlint)
alias(libs.plugins.sqldelight)
//alias(libs.plugins.crashlytics)
// alias(libs.plugins.crashlytics)
alias(libs.plugins.serialization)
}

Expand Down Expand Up @@ -54,7 +54,6 @@ kotlin {
implementation(libs.kotlinx.datetime)
implementation(libs.kim)
implementation(libs.coil)

}
}
val commonTest by getting {
Expand Down
2 changes: 1 addition & 1 deletion shared/src/androidMain/kotlin/Main.android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ fun MainView(
directoryViewModel: DirectoryViewModel,
slideshowViewModel: SlideshowViewModel,
playlistViewModel: PlaylistViewModel,
) = App(loginViewModel, directoryViewModel, slideshowViewModel, playlistViewModel)
) = App(loginViewModel, directoryViewModel, slideshowViewModel, playlistViewModel)
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,28 @@ fun startKoin(context: Context) {
}
}

internal actual val platformModule: Module = module {
single<Settings> {
SharedPreferencesSettings(
delegate = EncryptedSharedPreferences.create(
get(),
CredentialsDataSource.DATABASE_NAME,
MasterKey.Builder(get())
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build(),
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM,
),
commit = false,
)
internal actual val platformModule: Module =
module {
single<Settings> {
SharedPreferencesSettings(
delegate =
EncryptedSharedPreferences.create(
get(),
CredentialsDataSource.DATABASE_NAME,
MasterKey.Builder(get())
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build(),
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM,
),
commit = false,
)
}
single<NetworkHandler> {
SMBJHandler
}
single<SqlDriver> { DriverFactory(context = get()).createDriver() }
}
single<NetworkHandler> {
SMBJHandler
}
single<SqlDriver> { DriverFactory(context = get()).createDriver() }
}

@OptIn(KoinInternalApi::class)
fun KoinApplication.androidContext(androidContext: Context): KoinApplication {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("ktlint:standard:filename")

package com.kevinschildhorn.fotopresenter

import com.kevinschildhorn.fotopresenter.domain.RetrieveDirectoryContentsUseCase
Expand All @@ -14,7 +16,6 @@ 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()
Expand Down Expand Up @@ -65,4 +66,4 @@ actual object UseCaseFactory : KoinComponent {
val useCase: SaveMetadataForPathUseCase by inject()
return useCase
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("ktlint:standard:class-naming")

package com.kevinschildhorn.fotopresenter.ui.compose

import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -28,10 +30,11 @@ fun ActionSheetPreview() {
ActionSheet(
visible = true,
offset = 200,
values = listOf(
ActionSheetContext(ActionSheetAction.START_SLIDESHOW, 1),
ActionSheetContext(ActionSheetAction.NONE, 2),
),
values =
listOf(
ActionSheetContext(ActionSheetAction.START_SLIDESHOW, 1),
ActionSheetContext(ActionSheetAction.NONE, 2),
),
onClick = {},
onDismiss = {},
)
Expand All @@ -44,10 +47,8 @@ fun ConfirmationDialogPreview() {
"Hello",
"World",
{

},
{

},
)
}
Expand All @@ -59,10 +60,8 @@ fun TextConfirmationDialogPreview() {
title = "",
initialValue = "",
{

},
{

},
)
}
Expand All @@ -73,11 +72,8 @@ fun FilterDialogPreview() {
FilterDialog(
"Hello",
{

},
{

},
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,46 @@ package com.kevinschildhorn.fotopresenter.ui.compose
import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.kevinschildhorn.fotopresenter.data.network.DefaultNetworkDirectoryDetails
import com.kevinschildhorn.fotopresenter.data.network.MockNetworkDirectoryDetails
import com.kevinschildhorn.fotopresenter.data.network.NetworkDirectoryDetails
import com.kevinschildhorn.fotopresenter.ui.screens.directory.DirectoryGridCellState
import com.kevinschildhorn.fotopresenter.ui.screens.directory.composables.grid.DirectoryGridCell
import com.kevinschildhorn.fotopresenter.ui.screens.directory.DirectoryGridState
import com.kevinschildhorn.fotopresenter.ui.screens.directory.composables.grid.DirectoryGrid
import com.kevinschildhorn.fotopresenter.ui.screens.directory.composables.grid.DirectoryGridCell
import com.kevinschildhorn.fotopresenter.ui.screens.directory.composables.grid.FolderDirectoryGridCell
import com.kevinschildhorn.fotopresenter.ui.screens.directory.DirectoryGridState
import com.kevinschildhorn.fotopresenter.ui.screens.directory.composables.navbar.DirectoryNavigationBar
import com.kevinschildhorn.fotopresenter.ui.screens.directory.composables.navbar.DirectoryNavigationItem

@Preview
@Composable
fun BaseDirectoryPreview() {
Column {
DirectoryGridCell() {}
DirectoryGridCell {}
}
}

@Preview
@Composable
fun FolderDirectoryEmptyPreview() {
Column {
FolderDirectoryGridCell(DirectoryGridCellState.Folder("Hello",0))
FolderDirectoryGridCell(DirectoryGridCellState.Folder("Hello", 0))
}
}

@Preview
@Composable
fun DirectoryGridPreview() {
DirectoryGrid(
directoryContent = DirectoryGridState(
folderStates = listOf(
DirectoryGridCellState.Folder("Hello",0),
directoryContent =
DirectoryGridState(
folderStates =
listOf(
DirectoryGridCellState.Folder("Hello", 0),
),
imageStates =
mutableListOf(
DirectoryGridCellState.Image(MockNetworkDirectoryDetails(), "Hello", 1),
),
),
imageStates = mutableListOf(
DirectoryGridCellState.Image(MockNetworkDirectoryDetails(),"Hello", 1)
)
),
onFolderPressed = {},
onImageDirectoryPressed = {},
onActionSheet = {},
Expand All @@ -50,18 +51,17 @@ fun DirectoryGridPreview() {

@Preview
@Composable
fun DirectoryNavigationItemPreview(){
DirectoryNavigationItem("Photos"){

fun DirectoryNavigationItemPreview() {
DirectoryNavigationItem("Photos") {
}
}

@Preview
@Composable
fun DirectoryNavigationBarPreview(){
fun DirectoryNavigationBarPreview() {
DirectoryNavigationBar(
listOf("Photos1", "Subfolder1","Photos2", "Subfolder2","Photos3", "Subfolder3"),
listOf("Photos1", "Subfolder1", "Photos2", "Subfolder2", "Photos3", "Subfolder3"),
{},
{},
{}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package com.kevinschildhorn.fotopresenter.ui.compose
import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.kevinschildhorn.fotopresenter.ui.UiState
import com.kevinschildhorn.fotopresenter.ui.screens.common.composables.ErrorView
import com.kevinschildhorn.fotopresenter.ui.screens.common.composables.TitleView
import com.kevinschildhorn.fotopresenter.ui.screens.login.LoginScreenState
import com.kevinschildhorn.fotopresenter.ui.screens.login.composables.LoginPasswordTextField
import com.kevinschildhorn.fotopresenter.ui.screens.login.composables.LoginTextField
import com.kevinschildhorn.fotopresenter.ui.screens.login.composables.LoginScreenForm
import com.kevinschildhorn.fotopresenter.ui.screens.login.LoginScreenState
import com.kevinschildhorn.fotopresenter.ui.UiState
import com.kevinschildhorn.fotopresenter.ui.screens.login.composables.LoginTextField

@Preview
@Composable
Expand Down
Loading

0 comments on commit 5e6014b

Please sign in to comment.