Skip to content

Commit

Permalink
updating heap and cache
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Dec 13, 2024
1 parent bbf0300 commit a2c1ade
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions androidApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:largeHeap="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
import app.cash.sqldelight.db.SqlDriver
import co.touchlab.kermit.Logger
import co.touchlab.kermit.koin.getLoggerWithTag
import co.touchlab.kermit.koin.kermitLoggerModule
import com.kevinschildhorn.fotopresenter.data.datasources.CredentialsDataSource
import com.kevinschildhorn.fotopresenter.data.network.NetworkHandler
import com.kevinschildhorn.fotopresenter.data.network.SMBJHandler
import com.kevinschildhorn.fotopresenter.extension.LoggerTagSuffix
import com.kevinschildhorn.fotopresenter.ui.shared.CacheInterface
import com.kevinschildhorn.fotopresenter.ui.shared.DriverFactory
import com.kevinschildhorn.fotopresenter.ui.shared.SharedFileCache
import com.kevinschildhorn.fotopresenter.ui.shared.SharedInMemoryCache
import com.russhwolf.settings.Settings
import com.russhwolf.settings.SharedPreferencesSettings
import org.koin.core.KoinApplication
Expand Down Expand Up @@ -53,6 +58,11 @@ internal actual val platformModule: Module =
SMBJHandler
}
single<SqlDriver> { DriverFactory(context = get()).createDriver() }
/*
single<CacheInterface> {
val context: Context = get()
SharedFileCache(context.filesDir.path, getLoggerWithTag("SharedFileCache$LoggerTagSuffix"))
}*/
}

@OptIn(KoinInternalApi::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ val commonModule =
single { PlaylistRepository(get(), get(), getLoggerWithTag("PlaylistRepository$LoggerTagSuffix")) }
factory { ImageMetadataDataSource(getLoggerWithTag("ImageMetadataDataSource$LoggerTagSuffix"), get()) }
single { ImageRepository(get(), get(), getLoggerWithTag("ImageRepository$LoggerTagSuffix")) }
single<CacheInterface> {
//val context: Context = get()
//SharedFileCache(context.filesDir.path, getLoggerWithTag("SharedFileCache$LoggerTagSuffix"))
SharedInMemoryCache
}
single<CacheInterface> { SharedInMemoryCache }

// Domain
factory { ConnectToServerUseCase(get(), getLoggerWithTag("ConnectToServerUseCase$LoggerTagSuffix")) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fun LoadingAsyncImage(
modifier = modifier,
onLoading = { loading = true },
onSuccess = { loading = false },
onError = { loading = false },
error = painterResource(Res.drawable.error),
)
if (loading) {
Expand Down

0 comments on commit a2c1ade

Please sign in to comment.