-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
97 additions
and
482 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,41 @@ | ||
package dev.dimension.flare | ||
|
||
import android.app.Application | ||
import android.os.Build | ||
import coil.ImageLoader | ||
import coil.ImageLoaderFactory | ||
import coil.decode.GifDecoder | ||
import coil.decode.ImageDecoderDecoder | ||
import coil.decode.SvgDecoder | ||
import dev.dimension.flare.common.AnimatedPngDecoder | ||
import dev.dimension.flare.common.AnimatedWebPDecoder | ||
import dev.dimension.flare.di.androidModule | ||
import dev.dimension.flare.di.appModule | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.core.context.startKoin | ||
|
||
class App : Application() { | ||
class App : Application(), ImageLoaderFactory { | ||
override fun onCreate() { | ||
super.onCreate() | ||
startKoin { | ||
androidContext(this@App) | ||
modules(appModule() + androidModule) | ||
} | ||
} | ||
|
||
override fun newImageLoader(): ImageLoader { | ||
return ImageLoader.Builder(this) | ||
.components { | ||
if (Build.VERSION.SDK_INT >= 28) { | ||
add(ImageDecoderDecoder.Factory()) | ||
} else { | ||
add(GifDecoder.Factory()) | ||
} | ||
add(AnimatedPngDecoder.Factory()) | ||
add(SvgDecoder.Factory()) | ||
add(AnimatedWebPDecoder.Factory()) | ||
} | ||
.crossfade(true) | ||
.build() | ||
} | ||
} |
19 changes: 9 additions & 10 deletions
19
app/src/main/java/dev/dimension/flare/common/AnimatedPngDecoder.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
19 changes: 8 additions & 11 deletions
19
app/src/main/java/dev/dimension/flare/common/AnimatedWebPDecoder.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
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
55 changes: 0 additions & 55 deletions
55
app/src/main/java/dev/dimension/flare/ui/component/SubSamplingEligibility.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.