From bc3d07b26b3bc1a2f0bffbd52a8e0bb8977dc311 Mon Sep 17 00:00:00 2001 From: veyndan Date: Sat, 17 May 2025 18:21:43 +0200 Subject: [PATCH] Remove unused `androidx.palette:palette-ktx` dependency --- app/build.gradle | 1 - .../fdroid/views/apps/FeatureImage.java | 25 +++++++++---------- gradle/libs.versions.toml | 2 -- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 377e7afb0..77a73b22d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -180,7 +180,6 @@ dependencies { implementation libs.androidx.vectordrawable implementation libs.androidx.constraintlayout implementation libs.androidx.lifecycle.livedata.ktx - implementation libs.androidx.palette.ktx implementation libs.androidx.work.runtime implementation libs.guava // somehow needed for work-runtime to function diff --git a/app/src/main/java/org/fdroid/fdroid/views/apps/FeatureImage.java b/app/src/main/java/org/fdroid/fdroid/views/apps/FeatureImage.java index c02fc6d20..8b8696413 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/apps/FeatureImage.java +++ b/app/src/main/java/org/fdroid/fdroid/views/apps/FeatureImage.java @@ -15,7 +15,6 @@ import androidx.annotation.ColorInt; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatImageView; import androidx.core.content.ContextCompat; -import androidx.palette.graphics.Palette; import com.bumptech.glide.RequestBuilder; import com.bumptech.glide.load.DataSource; @@ -30,9 +29,9 @@ import org.fdroid.fdroid.data.App; import java.util.Random; /** - * A feature image can have a {@link android.graphics.drawable.Drawable} or a {@link Palette}. If - * a Drawable is available, then it will draw that, otherwise it will attempt to fall back to the - * Palette you gave it. If a Palette is given, it will draw a series of triangles like so: + * A feature image can have a {@link android.graphics.drawable.Drawable}. If a Drawable is + * available, then it will draw that, otherwise it will attempt to fall back to the colour you gave + * it. If a colour is given, it will draw a series of triangles like so: *

* +_----+----_+_----+----_+ * | \_ | _/ | \_ | _/ | @@ -42,12 +41,12 @@ import java.util.Random; * | \_|_/ | \_|_/ | * +-----+-----+-----+-----+ *

- * where each triangle is filled with one of two variations of the {@link Palette#getDominantColor(int)} - * that is chosen randomly. The randomness is first seeded with the colour that has been selected. - * This is so that if this repaints itself in the future, it will have the same unique pattern rather - * than picking a new random pattern each time. + * where each triangle is filled with one of two variations of the colour that is chosen randomly. + * The randomness is first seeded with the colour that has been selected. This is so that if this + * repaints itself in the future, it will have the same unique pattern rather than picking a new + * random pattern each time. *

- * It is suggested that you obtain the Palette from the icon of an app. + * It is suggested that you obtain the colour from the icon of an app. */ @SuppressWarnings("LineLength") public class FeatureImage extends AppCompatImageView { @@ -92,9 +91,9 @@ public class FeatureImage extends AppCompatImageView { } /** - * Takes the {@link Palette#getDominantColor(int)} from the palette, dims it substantially, and - * then creates a second variation that is slightly dimmer still. These two colours are then - * randomly allocated to each triangle which is expected to be rendered. + * Takes the {@code colour}, dims it substantially, and then creates a second variation that is + * slightly dimmer still. These two colours are then randomly allocated to each triangle which + * is expected to be rendered. */ public void setColour(@ColorInt int colour) { if (colour == 0) { @@ -207,7 +206,7 @@ public class FeatureImage extends AppCompatImageView { /** * First try to draw whatever image was given to this view. If that doesn't exist, try to draw - * a geometric pattern based on the palette that was given to us. If we haven't had a colour + * a geometric pattern based on the colour that was given to us. If we haven't had a colour * assigned to us (using {@link #setColour(int)}) then clear the view by filling it with white. */ @Override diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 313c77db2..1b047dcef 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,6 @@ androidxLifecycleLivedataKtx = "2.8.7" androidxWork = "2.10.0" androidxRecyclerview = "1.4.0" androidxConstraintlayout = "2.2.1" -androidxPaletteKtx = "1.0.0" androidxVectordrawable = "1.2.0" androidxGridlayout = "1.0.0" androidxComposeBom = "2025.03.00" @@ -80,7 +79,6 @@ androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidxLifecycleLivedataKtx" } androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidxConstraintlayout" } androidx-gridlayout = { module = "androidx.gridlayout:gridlayout", version.ref = "androidxGridlayout" } -androidx-palette-ktx = { module = "androidx.palette:palette-ktx", version.ref = "androidxPaletteKtx" } androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "androidxPreferenceKtx" } androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidxAppcompat" } androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidxRecyclerview" }