Skip to content

Commit

Permalink
Save favorite filters and templates in main backup file by #1564 (thi…
Browse files Browse the repository at this point in the history
…s will clear existing favorite filters and templates!)
  • Loading branch information
T8RIN committed Jan 5, 2025
1 parent 53ec950 commit b448677
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 52 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ android {
pickFirsts.add("lib/*/libcoder.so")
}
resources {
excludes += "META-INF/*"
excludes += "kotlin/*"
excludes += "org/*"
excludes += "*.properties"
excludes += "*.bin"
excludes += "META-INF/"
excludes += "kotlin/"
excludes += "org/"
excludes += ".properties"
excludes += ".bin"
excludes += "META-INF/versions/9/OSGI-INF/MANIFEST.MF"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@ import ru.tech.imageresizershrinker.core.filters.domain.model.TransferFunc
import ru.tech.imageresizershrinker.core.filters.domain.model.WaterParams
import ru.tech.imageresizershrinker.core.resources.R
import ru.tech.imageresizershrinker.core.ui.utils.helper.toImageModel
import ru.tech.imageresizershrinker.feature.filters.di.FilterInteractorDataStore
import java.io.File
import javax.inject.Inject
import kotlin.reflect.full.primaryConstructor

internal class AndroidFavoriteFiltersInteractor @Inject constructor(
@ApplicationContext private val context: Context,
@FilterInteractorDataStore private val dataStore: DataStore<Preferences>,
private val dataStore: DataStore<Preferences>,
private val fileController: FileController,
private val imageCompressor: ImageCompressor<Bitmap>,
private val imageGetter: ImageGetter<Bitmap, ExifInterface>
Expand Down Expand Up @@ -530,7 +529,7 @@ internal class AndroidFavoriteFiltersInteractor @Inject constructor(
if (includeValue && value != null) {
callBy(mapOf(parameters[0] to value))
} else callBy(emptyMap())
} catch (e: Throwable) {
} catch (_: Throwable) {
callBy(emptyMap())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@

package ru.tech.imageresizershrinker.feature.filters.di

import android.content.Context
import android.graphics.Bitmap
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Path
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStoreFile
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import ru.tech.imageresizershrinker.core.filters.domain.FavoriteFiltersInteractor
import ru.tech.imageresizershrinker.core.filters.domain.FilterProvider
Expand All @@ -56,19 +49,6 @@ internal interface FilterModule {
applier: AndroidFilterMaskApplier
): FilterMaskApplier<Bitmap, Path, Color>

companion object {

@FilterInteractorDataStore
@Singleton
@Provides
fun filterInteractorDataStore(
@ApplicationContext context: Context
): DataStore<Preferences> = PreferenceDataStoreFactory.create(
produceFile = { context.preferencesDataStoreFile("favorite_filters") },
)

}

@Singleton
@Binds
fun favoriteFiltersInteractor(
Expand Down

This file was deleted.

0 comments on commit b448677

Please sign in to comment.