Skip to content

Commit

Permalink
Coil 3.0.0-alpha01.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Jan 3, 2024
1 parent a0ed05d commit 05715ab
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
local.properties
.idea/*
!.idea/icon.png
.kotlin
.kotlin/
.DS_Store
build/
captures
Expand Down
2 changes: 2 additions & 0 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ dependencies {

// Image loading
implementation(libs.coil.svg)
implementation(libs.coil.network)
implementation(libs.ktor.client.okhttp)

// SQLDelight
implementation(libs.sqldelight.androidDriver)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package io.github.reactivecircus.kstreamlined.android

import android.app.Application
import coil.ImageLoader
import coil.ImageLoaderFactory
import coil3.ImageLoader
import coil3.PlatformContext
import coil3.SingletonImageLoader
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.HiltAndroidApp
import javax.inject.Inject

@HiltAndroidApp
open class KSApp : Application(), ImageLoaderFactory {
open class KSApp : Application(), SingletonImageLoader.Factory {

@Inject
lateinit var imageLoader: ImageLoader
Expand All @@ -29,5 +30,5 @@ open class KSApp : Application(), ImageLoaderFactory {
// TODO
}

override fun newImageLoader(): ImageLoader = imageLoader
override fun newImageLoader(context: PlatformContext): ImageLoader = imageLoader
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ package io.github.reactivecircus.kstreamlined.android.di

import android.content.Context
import android.os.Build
import coil.ImageLoader
import coil.decode.SvgDecoder
import coil3.ImageLoader
import coil3.annotation.ExperimentalCoilApi
import coil3.decode.SvgDecoder
import coil3.fetch.NetworkFetcher
import coil3.request.allowHardware
import coil3.request.crossfade
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand All @@ -20,6 +24,8 @@ object AppModule {
fun imageLoader(@ApplicationContext context: Context): ImageLoader {
return ImageLoader.Builder(context)
.components {
@OptIn(ExperimentalCoilApi::class)
add(NetworkFetcher.Factory())
add(SvgDecoder.Factory())
}
.crossfade(enable = true)
Expand Down
2 changes: 1 addition & 1 deletion android/common-ui/feed/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ dependencies {
implementation(libs.androidx.compose.ui.tooling)

// Image loading
implementation(libs.coil)
implementation(libs.coil.compose)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil3.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.designsystem.component.IconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil3.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Icon
import io.github.reactivecircus.kstreamlined.android.designsystem.component.IconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import coil3.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.designsystem.component.IconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Text
Expand Down
2 changes: 1 addition & 1 deletion android/feature/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
implementation(libs.androidx.browser)

// Image loading
api(libs.coil)
api(libs.coil.compose)

// Logging
api(libs.kermit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil3.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.common.ui.feed.KotlinBlogCard
import io.github.reactivecircus.kstreamlined.android.common.ui.feed.KotlinWeeklyCard
import io.github.reactivecircus.kstreamlined.android.common.ui.feed.KotlinYouTubeCard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
import coil.compose.AsyncImage
import coil3.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Button
import io.github.reactivecircus.kstreamlined.android.designsystem.component.FilledIconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.LargeIconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil3.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.common.ui.feed.KotlinBlogCard
import io.github.reactivecircus.kstreamlined.android.common.ui.feed.KotlinWeeklyCard
import io.github.reactivecircus.kstreamlined.android.common.ui.feed.KotlinYouTubeCard
Expand Down
9 changes: 6 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ androidx-browser="1.8.0-beta01"
androidx-profileinstaller = "1.3.1"
androidx-benchmark = "1.2.2"
androidx-metrics = "1.0.0-alpha04"
coil = "2.5.0"
coil = "3.0.0-alpha01"
ktor = "2.3.7"
kermit = "2.0.2"
sqldelight = "2.0.1"
turbine = "1.0.0"
Expand Down Expand Up @@ -86,8 +87,10 @@ androidx-browser = { module = "androidx.browser:browser", version.ref = "android
androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version.ref = "androidx-profileinstaller" }
androidx-benchmark-macroJunit = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "androidx-benchmark" }
androidx-metrics-performance = { module = "androidx.metrics:metrics-performance", version.ref = "androidx-metrics" }
coil = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coil" }
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
coil-network = { module = "io.coil-kt.coil3:coil-network", version.ref = "coil" }
coil-svg = { module = "io.coil-kt.coil3:coil-svg", version.ref = "coil" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
apollo-runtime = { module = "com.apollographql.apollo3:apollo-runtime", version.ref = "apollo" }
apollo-normalizedCache = { module = "com.apollographql.apollo3:apollo-normalized-cache", version.ref = "apollo" }
apollo-adapters = { module = "com.apollographql.apollo3:apollo-adapters", version.ref = "apollo" }
Expand Down

0 comments on commit 05715ab

Please sign in to comment.