Skip to content

Commit

Permalink
Merge branch 'main' into ks/UpdateIcons
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Oct 16, 2024
2 parents 4fc246b + 2f7508c commit fc3531c
Show file tree
Hide file tree
Showing 205 changed files with 1,704 additions and 3,924 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
32 changes: 20 additions & 12 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.implementation
import org.gradle.kotlin.dsl.java

plugins {
kotlin("multiplatform")
id("com.android.application")
id("org.jetbrains.compose")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
kotlin("multiplatform")
alias(libs.plugins.google.services)
alias(libs.plugins.crashlytics)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.jetbrains.compose)
}

kotlin {
Expand All @@ -12,31 +17,34 @@ kotlin {
val androidMain by getting {
dependencies {
implementation(project(":shared"))
implementation("io.insert-koin:koin-android:3.4.0")
implementation("com.google.firebase:firebase-crashlytics:18.6.0")
implementation(libs.koin.android)
implementation(libs.firebase.crashlytics)
implementation(libs.accompanist.permissions)
implementation(libs.kermit)

}
}
}
}

android {
compileSdk = (findProperty("android.compileSdk") as String).toInt()
compileSdk = libs.versions.compileSdk.get().toInt()
namespace = "com.kevinschildhorn"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

defaultConfig {
applicationId = "com.kevinschildhorn.fotopresenter"
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlin {
jvmToolchain(17)
jvmToolchain(libs.versions.java.get().toInt())
}
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,67 @@
package com.kevinschildhorn

import MainView
import android.Manifest
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import co.touchlab.kermit.Logger
import coil3.ImageLoader
import coil3.compose.setSingletonImageLoaderFactory
import coil3.disk.DiskCache
import coil3.disk.directory
import coil3.memory.MemoryCache
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.rememberPermissionState
import com.kevinschildhorn.fotopresenter.baseLogger
import com.kevinschildhorn.fotopresenter.data.network.SMBJHandler
import com.kevinschildhorn.fotopresenter.data.repositories.ImageRepository
import com.kevinschildhorn.fotopresenter.startKoin
import com.kevinschildhorn.fotopresenter.ui.ByteArrayFetcher
import com.kevinschildhorn.fotopresenter.ui.SMBJFetcher
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
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

class MainActivity : AppCompatActivity(), KoinComponent {

private val loginViewModel by viewModel<LoginViewModel>()
private val directoryViewModel by viewModel<DirectoryViewModel>()
private val slideshowViewModel by viewModel<SlideshowViewModel>()
private val playlistViewModel by viewModel<PlaylistViewModel>()
private val imageRepository: ImageRepository by inject()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
startKoin(this)

setContent {

setSingletonImageLoaderFactory { context ->
ImageLoader.Builder(context)
.components {
add(SMBJFetcher.Factory(imageRepository, baseLogger))
add(ByteArrayFetcher.Factory(Logger.withTag("ByteArrayFetcher")))
}
.memoryCache {
MemoryCache.Builder()
.maxSizePercent(context,0.25)
.build()
}
.diskCache {
DiskCache.Builder()
.directory(context.cacheDir.resolve("image_cache"))
.maxSizePercent(0.02)
.build()
}
.build()
}

MainView(loginViewModel, directoryViewModel, slideshowViewModel, playlistViewModel)
}
}
Expand Down
1 change: 0 additions & 1 deletion atomik/.gitignore

This file was deleted.

123 changes: 0 additions & 123 deletions atomik/build.gradle.kts

This file was deleted.

2 changes: 0 additions & 2 deletions atomik/src/androidMain/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit fc3531c

Please sign in to comment.