diff --git a/UIViews/build.gradle.kts b/UIViews/build.gradle.kts index 6c411b030..d643893aa 100644 --- a/UIViews/build.gradle.kts +++ b/UIViews/build.gradle.kts @@ -67,7 +67,7 @@ dependencies { implementation(libs.gson) implementation(libs.recyclerview) - implementation(libs.palette) + //implementation(libs.palette) implementation(libs.bundles.roomLibs) implementation(libs.showMoreLess) diff --git a/UIViews/src/main/java/com/programmersbox/uiviews/details/DetailsHeader.kt b/UIViews/src/main/java/com/programmersbox/uiviews/details/DetailsHeader.kt index c1bd12a19..6620bdd3b 100644 --- a/UIViews/src/main/java/com/programmersbox/uiviews/details/DetailsHeader.kt +++ b/UIViews/src/main/java/com/programmersbox/uiviews/details/DetailsHeader.kt @@ -49,6 +49,7 @@ import androidx.compose.ui.draw.drawWithContent import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.style.TextOverflow @@ -110,7 +111,7 @@ internal fun DetailsHeader( GlideImage( imageModel = { imageUrl }, imageOptions = ImageOptions(contentScale = ContentScale.Fit), - previewPlaceholder = R.drawable.ic_baseline_battery_alert_24, + previewPlaceholder = painterResource(id = R.drawable.ic_baseline_battery_alert_24), modifier = Modifier .scaleRotateOffsetReset() .defaultMinSize(ComposableUtils.IMAGE_WIDTH, ComposableUtils.IMAGE_HEIGHT) @@ -140,7 +141,7 @@ internal fun DetailsHeader( GlideImage( imageModel = { imageUrl }, imageOptions = ImageOptions(contentScale = ContentScale.Crop), - previewPlaceholder = R.drawable.ic_baseline_battery_alert_24, + previewPlaceholder = painterResource(id = R.drawable.ic_baseline_battery_alert_24), modifier = Modifier .matchParentSize() .blur(4.dp) diff --git a/UIViews/src/main/java/com/programmersbox/uiviews/lists/OtakuListScreen.kt b/UIViews/src/main/java/com/programmersbox/uiviews/lists/OtakuListScreen.kt index 88f5904d4..eaab9bfa3 100644 --- a/UIViews/src/main/java/com/programmersbox/uiviews/lists/OtakuListScreen.kt +++ b/UIViews/src/main/java/com/programmersbox/uiviews/lists/OtakuListScreen.kt @@ -57,7 +57,7 @@ fun OtakuListScreen( .showListDetail .collectAsStateWithLifecycle(true) - val state = rememberListDetailPaneScaffoldNavigator( + val state = rememberListDetailPaneScaffoldNavigator( scaffoldDirective = calculateStandardPaneScaffoldDirective(currentWindowAdaptiveInfo()) ) diff --git a/UIViews/src/main/java/com/programmersbox/uiviews/settings/ExtensionListScreen.kt b/UIViews/src/main/java/com/programmersbox/uiviews/settings/ExtensionListScreen.kt index 024958f16..9566cb61e 100644 --- a/UIViews/src/main/java/com/programmersbox/uiviews/settings/ExtensionListScreen.kt +++ b/UIViews/src/main/java/com/programmersbox/uiviews/settings/ExtensionListScreen.kt @@ -169,7 +169,7 @@ fun ExtensionList( ) } - val navigator = rememberListDetailPaneScaffoldNavigator( + val navigator = rememberListDetailPaneScaffoldNavigator( scaffoldDirective = calculateStandardPaneScaffoldDirective(currentWindowAdaptiveInfo()) ) diff --git a/UIViews/src/main/java/com/programmersbox/uiviews/utils/BindingUtils.kt b/UIViews/src/main/java/com/programmersbox/uiviews/utils/BindingUtils.kt index a80e49043..c0fff6783 100644 --- a/UIViews/src/main/java/com/programmersbox/uiviews/utils/BindingUtils.kt +++ b/UIViews/src/main/java/com/programmersbox/uiviews/utils/BindingUtils.kt @@ -1,12 +1,8 @@ package com.programmersbox.uiviews.utils -import android.graphics.Bitmap -import android.graphics.Canvas import android.graphics.Color import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable -import androidx.core.graphics.drawable.toBitmap -import androidx.palette.graphics.Palette import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.ListPreloader import com.bumptech.glide.RequestBuilder @@ -52,7 +48,7 @@ abstract class DragSwipeGlideAdapter? = fullRequest.thumbnail(thumbRequest.load(item)).load(item) } -fun Drawable.getPalette() = Palette.from(toBitmap()).generate() +/*fun Drawable.getPalette() = Palette.from(toBitmap()).generate() fun Bitmap.getPalette() = Palette.from(this).generate() fun Int.getPaletteFromColor(): Palette { @@ -61,7 +57,7 @@ fun Int.getPaletteFromColor(): Palette { return b.getPalette() } -fun String.getPaletteFromHexColor(): Palette = Color.parseColor(this@getPaletteFromHexColor).getPaletteFromColor() +fun String.getPaletteFromHexColor(): Palette = Color.parseColor(this@getPaletteFromHexColor).getPaletteFromColor()*/ fun Int.toColorDrawable() = ColorDrawable(this) fun String.toColorDrawable() = ColorDrawable(Color.parseColor(this)) diff --git a/UIViews/src/main/java/com/programmersbox/uiviews/utils/components/DynamicColorScheme.kt b/UIViews/src/main/java/com/programmersbox/uiviews/utils/components/DynamicColorScheme.kt index 1228a37f8..e14a6e67e 100644 --- a/UIViews/src/main/java/com/programmersbox/uiviews/utils/components/DynamicColorScheme.kt +++ b/UIViews/src/main/java/com/programmersbox/uiviews/utils/components/DynamicColorScheme.kt @@ -1,28 +1,12 @@ package com.programmersbox.uiviews.utils.components -import android.content.Context import android.util.LruCache -import androidx.compose.animation.animateColorAsState -import androidx.compose.animation.core.Spring -import androidx.compose.animation.core.spring import androidx.compose.material.icons.filled.Palette -import androidx.compose.material3.ColorScheme -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.* -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.platform.LocalContext -import androidx.core.graphics.drawable.toBitmap import androidx.palette.graphics.Palette import coil.Coil -import coil.imageLoader -import coil.request.ImageRequest -import coil.request.SuccessResult -import coil.size.Scale -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext - -@Composable +/*@Composable fun rememberDominantColorState( context: Context = LocalContext.current, defaultColor: Color = MaterialTheme.colorScheme.primary, @@ -40,7 +24,7 @@ fun rememberDynamicColorState( cacheSize: Int = 12 ): DynamicColorState = remember { DynamicColorState(context, defaultColorScheme, cacheSize) -} +}*/ //TODO: Try converting DetailsFragment to use this @@ -66,7 +50,7 @@ DynamicThemePrimaryColorsFromImage(dominantColor) { /** * A composable which allows dynamic theming of the [androidx.compose.material.Colors.primary] * color from an image. - */ + *//* @Composable fun DynamicThemePrimaryColorsFromImage( dominantColorState: DominantColorState = rememberDominantColorState(), @@ -125,7 +109,7 @@ fun FullDynamicThemePrimaryColorsFromImage( ).value, ) MaterialTheme(colorScheme = colors, content = content) -} +}*/ /** * A class which stores and caches the result of any calculated dominant colors @@ -138,7 +122,7 @@ fun FullDynamicThemePrimaryColorsFromImage( * @param cacheSize The size of the [LruCache] used to store recent results. Pass `0` to * disable the cache. * @param isColorValid A lambda which allows filtering of the calculated image colors. - */ + *//* @Stable class DominantColorState( private val context: Context, @@ -187,9 +171,10 @@ class DominantColorState( ?.also { result -> cache?.put(url, result) } } - /** + */ +/** * Reset the color values to [defaultColor]. - */ + *//* fun reset() { color = defaultColor onColor = defaultColor @@ -238,19 +223,20 @@ class DynamicColorState( // Then we want to find the first valid color //.firstOrNull { swatch -> isColorValid(Color(swatch.rgb)) } // If we found a valid swatch, wrap it in a [DominantColors] - /*?.let { swatch -> + *//*?.let { swatch -> DominantColors( color = Color(swatch.rgb), onColor = Color(swatch.bodyTextColor).copy(alpha = 1f) ) - }*/ + }*//* // Cache the resulting [DominantColors] ?.also { result -> cache?.put(url, result) } } - /** + */ +/** * Reset the color values to [defaultColor]. - */ + *//* fun reset() { colorScheme = defaultColorScheme } @@ -259,9 +245,10 @@ class DynamicColorState( @Immutable private data class DominantColors(val color: Color, val onColor: Color) +*/ /** * Fetches the given [imageUrl] with [Coil], then uses [Palette] to calculate the dominant color. - */ + *//* private suspend fun calculateSwatchesInImage( context: Context, imageUrl: String @@ -333,4 +320,4 @@ private suspend fun calculateAllSwatchesInImage( palette } } -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a8be71db6..b833d366f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,6 +25,5 @@ android.enableJetifier=true kotlin.code.style=official android.nonTransitiveRClass=false android.nonFinalResIds=false -android.experimental.lint.version=8.3.0-alpha10 kotlin.experimental.tryK2=true android.lint.useK2Uast=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c1bcf02a4..0789fe02e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,38 +1,38 @@ [versions] +gradle = "8.4.0-alpha07" + androidxBaselineprofileGradlePlugin = "1.2.0" composeCollapsable = "0.3.0" dragselect = "2.2.6" easylauncher = "6.2.0" firebaseCrashlyticsGradle = "2.9.9" googleServices = "4.4.0" -gradle = "8.3.0-alpha10" -haze = "0.5.0" +haze = "0.5.1" kamelImage = "0.9.1" kotlin = "1.9.22" latestAboutLibsRelease = "10.10.0" coroutinesVersion = "1.7.3" glideVersion = "4.16.0" -material3AdaptiveNavigationSuite = "1.0.0-alpha02" pagingVersion = "3.2.1" roomVersion = "2.6.1" -navVersion = "2.7.6" +navVersion = "2.8.0-alpha02" koinVersion = "3.5.3" coil = "2.5.0" lifecycle = "2.7.0" jetpack = "1.6.0-alpha03" -jetpackCompiler = "1.5.8" +jetpackCompiler = "1.5.9" jetbrainsCompiler = "1.5.1" accompanist = "0.34.0" okhttpVersion = "4.12.0" -ktorVersion = "2.3.7" +ktorVersion = "2.3.8" tvCompose = "1.0.0-alpha10" workVersion = "2.9.0" ziplineVersion = "1.1.0" -landscapist = "2.2.13" +landscapist = "2.3.0" protobufVersion = "3.25.2" sketchVersion = "3.2.5" activity = "1.8.2" -composeBomVersion = "2024.01.00-alpha03" +composeBomVersion = "2024.02.00-alpha01" ### MangaWorld piasy = "1.8.1" @@ -79,7 +79,7 @@ composeMaterial = { group = "androidx.compose.material", name = "material" } materialYou = { group = "androidx.compose.material3", name = "material3" } materialWindow = { group = "androidx.compose.material3", name = "material3-window-size-class" } materialAdaptive = { group = "androidx.compose.material3", name = "material3-adaptive" } -material-adaptive-navigation-suite = { module = "androidx.compose.material3:material3-adaptive-navigation-suite", version.ref = "material3AdaptiveNavigationSuite" } +material-adaptive-navigation-suite = { group = "androidx.compose.material3", name = "material3-adaptive-navigation-suite" } composeMaterialIconsCore = { group = "androidx.compose.material", name = "material-icons-core" } composeMaterialIconsExtended = { group = "androidx.compose.material", name = "material-icons-extended" } composeViewBinding = { group = "androidx.compose.ui", name = "ui-viewbinding" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e6aba2515..d3c0e6ba7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME