Skip to content

Replace Glide with Coil #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if (useKeystoreProperties) {
plugins {
id("com.android.application")
kotlin("android")
id("com.google.devtools.ksp")
id("androidx.navigation.safeargs")
id("kotlin-parcelize")
}
Expand Down Expand Up @@ -90,7 +89,7 @@ dependencies {
implementation("androidx.core:core-ktx:1.13.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.activity:activity-ktx:1.8.2")
implementation("androidx.activity:activity-ktx:1.9.0")
implementation("androidx.fragment:fragment-ktx:1.6.2")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
Expand All @@ -109,7 +108,5 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-viewmodel:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")

val glideVersion = "4.16.0"
implementation("com.github.bumptech.glide:glide:$glideVersion")
ksp("com.github.bumptech.glide:ksp:$glideVersion")
implementation("io.coil-kt:coil:2.6.0")
}
14 changes: 6 additions & 8 deletions app/src/main/java/app/grapheneos/apps/ui/PackageListAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import app.grapheneos.apps.core.PackageState
import app.grapheneos.apps.core.ReleaseChannel
import app.grapheneos.apps.databinding.PackageListItemBinding
import app.grapheneos.apps.util.maybeSetText
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import coil.load
import coil.transform.RoundedCornersTransformation

class ViewBindingVH<T : ViewBinding>(val binding: T) : ViewHolder(binding.root)

Expand Down Expand Up @@ -78,12 +78,10 @@ fun PackageListItemBinding.set(fragment: Fragment, pkgState: PackageState) {

val iconUrl = rPackage.common.iconUrl
if (iconUrl != null && pkgIcon.tag != iconUrl) {
Glide.with(fragment)
.load(iconUrl)
.placeholder(R.drawable.ic_placeholder_app_icon)
.centerInside()
.transform(RoundedCorners(20))
.into(pkgIcon)
pkgIcon.load(iconUrl) {
transformations(RoundedCornersTransformation(20f))
placeholder(R.drawable.ic_placeholder_app_icon)
}
}

if (iconUrl == null) {
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id("com.android.application") version "8.3.2" apply false
id("org.jetbrains.kotlin.android") version "1.9.23" apply false
id("androidx.navigation.safeargs") version "2.7.7" apply false
id("com.google.devtools.ksp") version "1.9.23-1.0.20" apply false
}

allprojects {
Expand Down
Loading