diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28a05f8b23..cecc4d6377 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Build and run unit tests with Gradle run: ./scripts/ci_unit.sh - name: Build javadocs - run: ./gradlew dokkaHtmlMultiModule + run: ./gradlew :dokkaHtmlMultiModule - name: Publish a source snapshot to Sonatype env: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} diff --git a/annotation/compiler/build.gradle b/annotation/compiler/build.gradle index 7329c93608..4fee5b9666 100644 --- a/annotation/compiler/build.gradle +++ b/annotation/compiler/build.gradle @@ -2,6 +2,14 @@ import proguard.gradle.ProGuardTask apply plugin: 'java' +// This package is stuck at java 7 for as long as we use jarjar. +// We should re-evaluate whether we need to continue to worry +// about this. +java { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 +} + configurations { // adapted from https://android.googlesource.com/platform/frameworks/testing/+/976c423/espresso/espresso-lib/build.gradle // compileOnly dependencies will be repackaged, see rules in jarjar ant task below diff --git a/annotation/compiler/test/build.gradle b/annotation/compiler/test/build.gradle index d862ce572f..421f2c5796 100644 --- a/annotation/compiler/test/build.gradle +++ b/annotation/compiler/test/build.gradle @@ -37,8 +37,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } testOptions { diff --git a/benchmark/build.gradle b/benchmark/build.gradle index 65a8fb817f..b4962d4513 100644 --- a/benchmark/build.gradle +++ b/benchmark/build.gradle @@ -5,13 +5,12 @@ plugins { android { namespace 'com.bumptech.glide.benchmark' - compileSdkVersion libs.versions.compile.sdk.version.get() - - buildToolsVersion "30.0.3" + compileSdkVersion 34 + buildToolsVersion "34.0.0" compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } defaultConfig { diff --git a/build.gradle b/build.gradle index 77064c167d..d2d5889865 100644 --- a/build.gradle +++ b/build.gradle @@ -72,15 +72,6 @@ subprojects { project -> gradlePluginPortal() } - afterEvaluate { - if (!project.plugins.hasPlugin("org.jetbrains.kotlin.jvm")) { - tasks.withType(JavaCompile) { - sourceCompatibility = 1.7 - targetCompatibility = 1.7 - } - } - } - // Exclude packages not intended for public use. if ([ "testutil", diff --git a/glide/build.gradle b/glide/build.gradle index ed2d27f754..3ee3c8ad32 100644 --- a/glide/build.gradle +++ b/glide/build.gradle @@ -151,7 +151,7 @@ jar { artifacts { archives releaseJavadocJar { - classifier 'javadoc' + archiveClassifier = 'javadoc' } } diff --git a/gradle.properties b/gradle.properties index 37794c20c6..3444b14b82 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,13 +12,6 @@ # org.gradle.parallel=true #Sun Jun 05 16:53:18 EST 2022 - -# upload.gradle manually generates the artifacts for each library, we don't appear to use -# these automatically generated components anyway. We may however be able to use the Android -# DSL to simplify our logic in the future though: -# https://developer.android.com/studio/publish-library/configure-pub-variants -android.disableAutomaticComponentCreation=true - ## Grouping GROUP=com.github.bumptech.glide diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa7..afba109285 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4e86b92707..c30b486a89 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-7.6.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f13..6689b85bee 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,92 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/integration/avif/build.gradle b/integration/avif/build.gradle index ca795e3b9c..685f607a6d 100644 --- a/integration/avif/build.gradle +++ b/integration/avif/build.gradle @@ -20,8 +20,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/integration/compose/build.gradle b/integration/compose/build.gradle index e879c9216e..8202823048 100644 --- a/integration/compose/build.gradle +++ b/integration/compose/build.gradle @@ -53,7 +53,6 @@ dependencies { } implementation libs.compose.foundation implementation libs.compose.ui - implementation libs.drawablepainter implementation libs.androidx.core.ktx debugImplementation libs.compose.ui.testmanifest androidTestImplementation libs.junit @@ -67,3 +66,28 @@ dependencies { } apply from: "${rootProject.projectDir}/scripts/upload.gradle" + +task cleanGoldensOnDevice(type: Exec) { + commandLine = ['adb', 'shell', 'rm -rf /storage/emulated/0/DCIM/compose_goldens'] +} + +task pullGoldens(type: Exec) { + commandLine = [ + 'bash', + '-c', + 'adb shell \'find /storage/emulated/0/DCIM/compose_goldens -iname "*.png"\' ' + + '| tr -d "\015" ' + + '| while read line; do adb pull "$line" src/androidTest/assets/; done' + ] + +} + +afterEvaluate { + task rebuildGoldens(type: Exec) { + ignoreExitValue = true + dependsOn( + cleanGoldensOnDevice, + tasks.getByName("connectedDebugAndroidTest").finalizedBy(pullGoldens) + ) + } +} diff --git a/integration/compose/src/androidTest/assets/glideImage_startsAnimatedDrawable_2.625_33.png b/integration/compose/src/androidTest/assets/glideImage_startsAnimatedDrawable_2.625_33.png new file mode 100644 index 0000000000..abb7321218 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideImage_startsAnimatedDrawable_2.625_33.png differ diff --git a/integration/compose/src/androidTest/assets/glideImage_startsAnimatedDrawable_2.75_34.png b/integration/compose/src/androidTest/assets/glideImage_startsAnimatedDrawable_2.75_34.png new file mode 100644 index 0000000000..42daa9ab03 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideImage_startsAnimatedDrawable_2.75_34.png differ diff --git a/integration/compose/src/androidTest/assets/glideImage_withDrawBehind_drawsImageOnTopOfBackground_2.625_33.png b/integration/compose/src/androidTest/assets/glideImage_withDrawBehind_drawsImageOnTopOfBackground_2.625_33.png new file mode 100644 index 0000000000..e6da9a36a8 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideImage_withDrawBehind_drawsImageOnTopOfBackground_2.625_33.png differ diff --git a/integration/compose/src/androidTest/assets/glideImage_withDrawBehind_drawsImageOnTopOfBackground_2.75_34.png b/integration/compose/src/androidTest/assets/glideImage_withDrawBehind_drawsImageOnTopOfBackground_2.75_34.png new file mode 100644 index 0000000000..ac722d0a77 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideImage_withDrawBehind_drawsImageOnTopOfBackground_2.75_34.png differ diff --git a/integration/compose/src/androidTest/assets/glideImage_withPadding_appliesPaddingOnce_2.625_33.png b/integration/compose/src/androidTest/assets/glideImage_withPadding_appliesPaddingOnce_2.625_33.png new file mode 100644 index 0000000000..2fbf3bc474 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideImage_withPadding_appliesPaddingOnce_2.625_33.png differ diff --git a/integration/compose/src/androidTest/assets/glideImage_withPadding_appliesPaddingOnce_2.75_34.png b/integration/compose/src/androidTest/assets/glideImage_withPadding_appliesPaddingOnce_2.75_34.png new file mode 100644 index 0000000000..2fbf3bc474 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideImage_withPadding_appliesPaddingOnce_2.75_34.png differ diff --git a/integration/compose/src/androidTest/assets/glideSubcomposition_withPadding_appliesPaddingOnce_2.625_33.png b/integration/compose/src/androidTest/assets/glideSubcomposition_withPadding_appliesPaddingOnce_2.625_33.png new file mode 100644 index 0000000000..be29ef15e3 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideSubcomposition_withPadding_appliesPaddingOnce_2.625_33.png differ diff --git a/integration/compose/src/androidTest/assets/glideSubcomposition_withPadding_appliesPaddingOnce_2.75_34.png b/integration/compose/src/androidTest/assets/glideSubcomposition_withPadding_appliesPaddingOnce_2.75_34.png new file mode 100644 index 0000000000..d3b2adc913 Binary files /dev/null and b/integration/compose/src/androidTest/assets/glideSubcomposition_withPadding_appliesPaddingOnce_2.75_34.png differ diff --git a/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideImageTest.kt b/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideImageTest.kt index 46e351a475..8d5dc40e43 100644 --- a/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideImageTest.kt +++ b/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideImageTest.kt @@ -1,25 +1,30 @@ package com.bumptech.glide.integration.compose import android.content.Context +import android.graphics.drawable.AnimationDrawable import android.graphics.drawable.Drawable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.aspectRatio -import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.lazy.LazyRow import androidx.compose.material.Text import androidx.compose.material.TextButton import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.drawBehind +import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.testTag import androidx.compose.ui.test.assert +import androidx.compose.ui.test.captureToImage import androidx.compose.ui.test.hasTestTag import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithText @@ -40,17 +45,23 @@ import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.target.Target +import com.bumptech.glide.test.compareToGolden +import com.bumptech.glide.test.pxToDp import com.google.common.truth.Truth.assertThat import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicReference import org.junit.Rule import org.junit.Test +import org.junit.rules.TestName @OptIn(ExperimentalGlideComposeApi::class, InternalGlideApi::class) class GlideImageTest { private val context: Context = ApplicationProvider.getApplicationContext() - @get:Rule + @get:Rule(order = 1) + val testName = TestName() + + @get:Rule(order = 2) val glideComposeRule = GlideComposeRule() @Test @@ -382,7 +393,7 @@ class GlideImageTest { @Test fun glideImage_withZeroSize_doesNotCrash() { glideComposeRule.setContent { - GlideImage( + GlideImage( model = android.R.drawable.star_big_on, contentDescription = null, modifier = Modifier.width(IntrinsicSize.Min), @@ -391,4 +402,70 @@ class GlideImageTest { } glideComposeRule.waitForIdle() } + + @Test + fun glideImage_startsAnimatedDrawable() { + val drawable = AnimationDrawable() + val firstFrame = context.getDrawable(android.R.drawable.star_big_on)!! + val secondFrame = context.getDrawable(android.R.drawable.star_big_off)!! + drawable.addFrame(firstFrame, 0) + drawable.addFrame(secondFrame, 10000) + val description = "test" + glideComposeRule.setContent { + GlideImage( + model = drawable, + contentDescription = description, + modifier = Modifier.wrapContentSize(), + ) { + it.override(20).dontTransform() + } + } + glideComposeRule + .onNodeWithContentDescription(description) + .captureToImage() + .compareToGolden(testName.methodName) + } + + @Test + fun glideImage_withDrawBehind_drawsImageOnTopOfBackground() { + glideComposeRule.setContent { + GlideImage( + android.R.drawable.star_big_on, + "test", + Modifier + .size(100.pxToDp()) + .drawBehind { drawRect(Color.Red) }) { + it.override(100) + } + } + + glideComposeRule + .onNodeWithContentDescription("test") + .captureToImage() + .compareToGolden(testName.methodName) + } + + // See #5272 + @Test + fun glideImage_withPadding_appliesPaddingOnce() { + glideComposeRule.setContent { + GlideImage( + model = android.R.drawable.star_big_on, + contentDescription = "test", + modifier = Modifier + .size(400.pxToDp()) + .aspectRatio(1f) + .drawBehind { + drawRect(Color.Blue) + } + .padding(80.pxToDp()), + ) + } + glideComposeRule.waitForIdle() + + glideComposeRule + .onNodeWithContentDescription("test") + .captureToImage() + .compareToGolden(testName.methodName) + } } diff --git a/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideSubcompositionTest.kt b/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideSubcompositionTest.kt index 9084194c6c..f4f51821c8 100644 --- a/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideSubcompositionTest.kt +++ b/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlideSubcompositionTest.kt @@ -3,22 +3,43 @@ package com.bumptech.glide.integration.compose import android.content.Context import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Email +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.drawBehind +import androidx.compose.ui.geometry.Size +import androidx.compose.ui.geometry.isUnspecified +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.test.captureToImage +import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.unit.dp import androidx.test.core.app.ApplicationProvider import com.bumptech.glide.Glide import com.bumptech.glide.integration.compose.test.GlideComposeRule import com.bumptech.glide.load.DataSource +import com.bumptech.glide.test.compareToGolden +import com.bumptech.glide.test.pxToDp import com.google.common.truth.Truth.assertThat import org.junit.Rule import org.junit.Test +import org.junit.rules.TestName @OptIn(ExperimentalGlideComposeApi::class) class GlideSubcompositionTest { - val context: Context = ApplicationProvider.getApplicationContext() + private val context: Context = ApplicationProvider.getApplicationContext() - @get:Rule + @get:Rule(order = 1) + val testName = TestName() + @get:Rule(order = 2) val glideComposeRule = GlideComposeRule() @Test @@ -162,5 +183,49 @@ class GlideSubcompositionTest { glideComposeRule.waitForIdle() assertThat(dataSource).isEqualTo(DataSource.MEMORY_CACHE) } + + // See #5272 + @Test + fun glideSubcomposition_withPadding_appliesPaddingOnce() { + glideComposeRule.setContent { + val lastSize = remember { mutableStateOf(Size.Unspecified) } + + GlideSubcomposition( + model = null, + modifier = Modifier + .semantics { + contentDescription = "test" + } + .width(400.pxToDp()) + .aspectRatio(1f) + .drawBehind { + if (lastSize.value.isUnspecified) { + lastSize.value = size + drawRect(Color.Blue) + } else if (lastSize.value != this.size) { + drawRect(Color.Red) + } else { + drawRect(Color.Blue) + } + } + .padding(80.pxToDp()), + ) { + when (state) { + RequestState.Failure -> Image( + imageVector = Icons.Default.Email, + contentDescription = "placeholder", + modifier = Modifier.width(400.pxToDp()) + ) + RequestState.Loading -> Spacer(modifier = Modifier.size(100.pxToDp())) + is RequestState.Success -> Image(painter = painter, contentDescription = null) + } + } + } + glideComposeRule.waitForIdle() + glideComposeRule.onNodeWithContentDescription("test") + .captureToImage() + .compareToGolden(testName.methodName) + } } + diff --git a/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/test/expectations.kt b/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/test/expectations.kt index 620502eeaf..0895394473 100644 --- a/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/test/expectations.kt +++ b/integration/compose/src/androidTest/java/com/bumptech/glide/integration/compose/test/expectations.kt @@ -5,6 +5,7 @@ package com.bumptech.glide.integration.compose.test import android.content.Context import android.content.res.Resources import android.graphics.Bitmap +import android.graphics.drawable.Animatable import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.util.TypedValue @@ -42,6 +43,11 @@ fun expectDisplayedDrawableSize(expectedSize: Size): SemanticsMatcher = fun expectDisplayedDrawable(expectedValue: Drawable?): SemanticsMatcher = expectDisplayedDrawable(expectedValue.bitmapOrThrow(), ::compareBitmaps) { it.bitmapOrThrow() } +fun expectAnimatingDrawable(): SemanticsMatcher = + expectDisplayedDrawable(true) { + (it as Animatable).isRunning + } + fun expectNoDrawable(): SemanticsMatcher = expectDisplayedDrawable(null) private fun compareBitmaps(first: Bitmap?, second: Bitmap?): Boolean { diff --git a/integration/compose/src/androidTest/java/com/bumptech/glide/test/goldens.kt b/integration/compose/src/androidTest/java/com/bumptech/glide/test/goldens.kt new file mode 100644 index 0000000000..6e680616bc --- /dev/null +++ b/integration/compose/src/androidTest/java/com/bumptech/glide/test/goldens.kt @@ -0,0 +1,107 @@ +package com.bumptech.glide.test + +import android.content.Context +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.os.Build +import android.os.Environment +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.ImageBitmap +import androidx.compose.ui.graphics.toPixelMap +import androidx.compose.ui.platform.LocalDensity +import androidx.test.core.app.ApplicationProvider +import java.io.BufferedOutputStream +import java.io.File +import java.io.FileNotFoundException +import java.io.FileOutputStream +import java.io.IOException +import java.io.OutputStream +import java.lang.IllegalStateException + +const val GENERATED_FILES_DIR = "compose_goldens" +const val EXTENSION = "png" +const val SEPARATOR = "_" + +@Composable +fun Int.pxToDp() = with(LocalDensity.current) { toDp() } + +fun ImageBitmap.compareToGolden(testName: String) { + val bitmap = toBitmap() + val existingGolden = readExistingGolden(testName) + val reasonForWrite = if (existingGolden == null) { + "Missing golden" + } else if (!existingGolden.sameAs(bitmap)) { + "Different golden" + } else { + null + } + if (reasonForWrite != null) { + val filePath = writeBitmap(bitmap, testName) + throw IllegalStateException("$reasonForWrite for $testName, wrote a new one. cd to androidTest/assets and run: adb pull $filePath") + } +} + +private fun ImageBitmap.toBitmap(): Bitmap { + val pixels = toPixelMap() + val bitmap = Bitmap.createBitmap(pixels.width, pixels.height, Bitmap.Config.ARGB_8888) + bitmap.setPixels( + pixels.buffer, + pixels.bufferOffset, + pixels.stride, + 0, + 0, + pixels.width, + pixels.height + ) + return bitmap +} + +private fun readExistingGolden(testName: String): Bitmap? { + return try { + ApplicationProvider.getApplicationContext() + .assets + .open(testFileName(testName)).use { + val options = BitmapFactory.Options() + options.inScaled = false + BitmapFactory.decodeStream(it, null, options) + } + } catch (e: FileNotFoundException) { + null + } +} + +private fun testFileName(testName: String) = "$testName$SEPARATOR${getDeviceString()}.$EXTENSION" +private fun getTestFilesDir(): File { + val dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + return File(dir, GENERATED_FILES_DIR) +} + +private fun getDeviceString() = + "${ApplicationProvider.getApplicationContext() + .resources + .displayMetrics + .density}$SEPARATOR${Build.VERSION.SDK_INT}" + +private fun writeBitmap(bitmap: Bitmap, testName: String): String { + val testFilesDir = getTestFilesDir() + require(!(!testFilesDir.exists() && !testFilesDir.mkdirs())) { "Failed to make directory: $testFilesDir" } + val file = File(testFilesDir, testFileName(testName)) + check(!(file.exists() && !file.delete())) { "Failed to remove existing file: $file" } + var os: OutputStream? = null + try { + os = BufferedOutputStream(FileOutputStream(file)) + bitmap.compress(Bitmap.CompressFormat.PNG, 100, os) + os.close() + } catch (e: IOException) { + throw RuntimeException(e) + } finally { + if (os != null) { + try { + os.close() + } catch (e: IOException) { + // Ignored. + } + } + } + return file.absolutePath +} \ No newline at end of file diff --git a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt index d61fc1cb59..12c5232e17 100644 --- a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt +++ b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt @@ -1,7 +1,10 @@ package com.bumptech.glide.integration.compose import android.graphics.PointF +import android.graphics.drawable.Animatable import android.graphics.drawable.Drawable +import android.os.Handler +import android.os.Looper import androidx.compose.ui.Alignment import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier @@ -86,16 +89,14 @@ internal fun Modifier.glideNode( requestListener, draw, transitionFactory, - ) then - clipToBounds() then + ) + .clipToBounds() + .semantics { if (contentDescription != null) { - semantics { - this@semantics.contentDescription = contentDescription - role = Role.Image - } - } else { - Modifier + this@semantics.contentDescription = contentDescription } + role = Role.Image + } } @ExperimentalGlideComposeApi @@ -147,6 +148,10 @@ internal data class GlideNodeElement constructor( } } +private val MAIN_HANDLER by lazy(LazyThreadSafetyMode.NONE) { + Handler(Looper.getMainLooper()) +} + @ExperimentalGlideComposeApi @OptIn(InternalGlideApi::class) internal class GlideNode : DrawModifierNode, LayoutModifierNode, SemanticsModifierNode, @@ -179,6 +184,23 @@ internal class GlideNode : DrawModifierNode, LayoutModifierNode, SemanticsModifi private var transition: Transition = DoNotTransition + + private val callback: Drawable.Callback by lazy { + object : Drawable.Callback { + override fun invalidateDrawable(d: Drawable) { + invalidateDraw() + } + + override fun scheduleDrawable(d: Drawable, what: Runnable, time: Long) { + MAIN_HANDLER.postAtTime(what, time) + } + + override fun unscheduleDrawable(d: Drawable, what: Runnable) { + MAIN_HANDLER.removeCallbacks(what) + } + } + } + private fun RequestBuilder<*>.maybeImmediateSize() = this.overrideSize()?.let { ImmediateGlideSize(it) } @@ -399,7 +421,15 @@ internal class GlideNode : DrawModifierNode, LayoutModifierNode, SemanticsModifi private fun updateDrawable(drawable: Drawable?) { this.drawable = drawable + + this.drawable?.callback = null + this.drawable?.setVisible(false, false) + (this.drawable as? Animatable)?.stop() + painter = drawable?.toPainter() + drawable?.callback = callback + drawable?.setVisible(true, true) + (drawable as? Animatable)?.start() drawablePositionAndSize = null } diff --git a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Painter.kt b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Painter.kt index 5b1c2cea8a..04477f8a7b 100644 --- a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Painter.kt +++ b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Painter.kt @@ -3,12 +3,24 @@ package com.bumptech.glide.integration.compose import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable +import android.os.Build +import android.view.View +import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.graphics.asAndroidColorFilter import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.graphics.drawscope.DrawScope +import androidx.compose.ui.graphics.drawscope.drawIntoCanvas +import androidx.compose.ui.graphics.nativeCanvas import androidx.compose.ui.graphics.painter.BitmapPainter import androidx.compose.ui.graphics.painter.ColorPainter import androidx.compose.ui.graphics.painter.Painter -import com.google.accompanist.drawablepainter.DrawablePainter +import androidx.compose.ui.graphics.withSave +import androidx.compose.ui.unit.IntSize +import androidx.compose.ui.unit.LayoutDirection +import androidx.compose.ui.unit.toSize +import kotlin.math.roundToInt internal fun Drawable?.toPainter(): Painter = when (this) { @@ -17,3 +29,59 @@ internal fun Drawable?.toPainter(): Painter = null -> ColorPainter(Color.Transparent) else -> DrawablePainter(mutate()) } + +private class DrawablePainter( + val drawable: Drawable +) : Painter() { + init { + if (drawable.isIntrinsicSizeValid) { + drawable.setBounds(0, 0, drawable.intrinsicWidth, drawable.intrinsicHeight) + } + } + + private var drawableIntrinsicSize = drawable.intrinsicSize + + private val Drawable.isIntrinsicSizeValid + get() = intrinsicWidth >= 0 && intrinsicHeight >= 0 + + private val Drawable.intrinsicSize: Size + get() = if (isIntrinsicSizeValid) { + IntSize(intrinsicWidth, intrinsicHeight).toSize() + } else { + Size.Unspecified + } + + override fun applyAlpha(alpha: Float): Boolean { + drawable.alpha = (alpha * 255).roundToInt().coerceIn(0, 255) + return true + } + + override fun applyColorFilter(colorFilter: ColorFilter?): Boolean { + drawable.colorFilter = colorFilter?.asAndroidColorFilter() + return true + } + + override fun applyLayoutDirection(layoutDirection: LayoutDirection): Boolean { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + return drawable.setLayoutDirection( + when (layoutDirection) { + LayoutDirection.Ltr -> View.LAYOUT_DIRECTION_LTR + LayoutDirection.Rtl -> View.LAYOUT_DIRECTION_RTL + } + ) + } + return false + } + + override val intrinsicSize: Size get() = drawableIntrinsicSize + + override fun DrawScope.onDraw() { + drawIntoCanvas { canvas -> + drawable.setBounds(0, 0, size.width.roundToInt(), size.height.roundToInt()) + + canvas.withSave { + drawable.draw(canvas.nativeCanvas) + } + } + } +} diff --git a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Transition.kt b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Transition.kt index 8b30e0bfa9..3fc938d205 100644 --- a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Transition.kt +++ b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/Transition.kt @@ -12,6 +12,8 @@ import androidx.compose.ui.graphics.drawscope.DrawScope import androidx.compose.ui.graphics.drawscope.clipRect import androidx.compose.ui.graphics.drawscope.translate import androidx.compose.ui.graphics.painter.Painter +import kotlinx.coroutines.NonCancellable +import kotlinx.coroutines.withContext /** * Transition between a given request's optional placeholder and the resource. @@ -141,7 +143,9 @@ internal class CrossFadeImpl( animatable.animateTo(OPAQUE_ALPHA, animationSpec) invalidate() } finally { - animatable.snapTo(OPAQUE_ALPHA) + withContext(NonCancellable) { + animatable.snapTo(OPAQUE_ALPHA) + } invalidate() } } @@ -161,4 +165,4 @@ internal class CrossFadeImpl( draw(size, animatable.value * alpha, colorFilter) } } -} \ No newline at end of file +} diff --git a/integration/concurrent/build.gradle b/integration/concurrent/build.gradle index 280ddacb5b..2e978dbc99 100644 --- a/integration/concurrent/build.gradle +++ b/integration/concurrent/build.gradle @@ -25,8 +25,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/integration/cronet/build.gradle b/integration/cronet/build.gradle index a33c65df5c..2cb7cef229 100644 --- a/integration/cronet/build.gradle +++ b/integration/cronet/build.gradle @@ -27,8 +27,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/integration/gifencoder/build.gradle b/integration/gifencoder/build.gradle index b31d416d99..d3d27a0a01 100644 --- a/integration/gifencoder/build.gradle +++ b/integration/gifencoder/build.gradle @@ -31,8 +31,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/integration/okhttp/build.gradle b/integration/okhttp/build.gradle index 15b1fa91d3..ec7b728f5f 100644 --- a/integration/okhttp/build.gradle +++ b/integration/okhttp/build.gradle @@ -20,8 +20,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/integration/okhttp3/build.gradle b/integration/okhttp3/build.gradle index 2c80d7a020..4c079f98a2 100644 --- a/integration/okhttp3/build.gradle +++ b/integration/okhttp3/build.gradle @@ -20,8 +20,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/integration/recyclerview/build.gradle b/integration/recyclerview/build.gradle index f5a2d4939f..a2984a63e3 100644 --- a/integration/recyclerview/build.gradle +++ b/integration/recyclerview/build.gradle @@ -18,8 +18,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/integration/volley/build.gradle b/integration/volley/build.gradle index 06bd1b7466..323deb2f53 100644 --- a/integration/volley/build.gradle +++ b/integration/volley/build.gradle @@ -29,8 +29,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/library/build.gradle b/library/build.gradle index d3c3df12e5..404072620c 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -70,8 +70,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/library/test/build.gradle b/library/test/build.gradle index baa1f700f5..8cc5a90add 100644 --- a/library/test/build.gradle +++ b/library/test/build.gradle @@ -29,7 +29,7 @@ afterEvaluate { android.testOptions.unitTests.all { Test testTask -> // configure max heap size of the test JVM testTask.maxHeapSize = TEST_JVM_MEMORY_SIZE as String - if (JavaVersion.current() <= JavaVersion.VERSION_1_7) { + if (JavaVersion.current() <= JavaVersion.VERSION_1_8) { // Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2048m; support was removed in 8.0 testTask.jvmArgs "-XX:MaxPermSize=${TEST_JVM_MEMORY_SIZE}" } diff --git a/mocks/build.gradle b/mocks/build.gradle index 92be3ffd96..52f4a64b1b 100644 --- a/mocks/build.gradle +++ b/mocks/build.gradle @@ -19,8 +19,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/renovate.json b/renovate.json index 3e936818e8..03d3193a27 100644 --- a/renovate.json +++ b/renovate.json @@ -11,15 +11,7 @@ }, { "matchPackageNames": ["androidx.fragment:fragment"], - "allowedVersions": "1.3.6" - }, - { - "matchPackageNames": ["androidx.annotation:annotation"], - "allowedVersions": "<1.6.0" - }, - { - "matchPackageNames": ["androidx.appcompat:appcompat"], - "allowedVersions": "<1.4.0" + "allowedVersions": "1.4.1" } ] } diff --git a/samples/contacturi/build.gradle b/samples/contacturi/build.gradle index 88574ad4d5..189807df1e 100644 --- a/samples/contacturi/build.gradle +++ b/samples/contacturi/build.gradle @@ -19,8 +19,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/samples/flickr/build.gradle b/samples/flickr/build.gradle index 5ae6ab1cd6..370ca12f6d 100644 --- a/samples/flickr/build.gradle +++ b/samples/flickr/build.gradle @@ -25,8 +25,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/samples/giphy/build.gradle b/samples/giphy/build.gradle index 1bd128298c..c30983a595 100644 --- a/samples/giphy/build.gradle +++ b/samples/giphy/build.gradle @@ -23,8 +23,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/samples/imgur/build.gradle b/samples/imgur/build.gradle index 2ae096994b..63a4a94e5c 100644 --- a/samples/imgur/build.gradle +++ b/samples/imgur/build.gradle @@ -13,8 +13,8 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } buildTypes { release { diff --git a/samples/svg/build.gradle b/samples/svg/build.gradle index 2b59bb4e98..52d2cabdbc 100644 --- a/samples/svg/build.gradle +++ b/samples/svg/build.gradle @@ -20,8 +20,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } diff --git a/scripts/update_javadocs.sh b/scripts/update_javadocs.sh index 481231bb09..76380eab20 100755 --- a/scripts/update_javadocs.sh +++ b/scripts/update_javadocs.sh @@ -43,7 +43,7 @@ fi git checkout master GIT_COMMIT_SHA="$(git rev-parse HEAD)" -./gradlew dokkaHtmlMultiModule +./gradlew :dokkaHtmlMultiModule rm -rf $TEMP_DIR cp -r build/dokka/htmlMultiModule $TEMP_DIR diff --git a/settings.gradle b/settings.gradle index 2d425d86ef..a1688999cf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -61,25 +61,20 @@ dependencyResolutionManagement { version('kotlin', '1.7.0') version('mockito', '5.3.1') version('retrofit', '2.3.0') - version('androidx-benchmark', '1.1.1') + version('androidx-benchmark', '1.2.0-beta05') version('androidx-espresso', '3.5.1') - // At least versions 1.5 and later require java 8 desugaring, which Glide can't - // currently use, so we're stuck on an older version. - version('androidx-fragment', '1.3.6') + // Newer versions depend on different kotlin versions causing duplicate class paths: + version('androidx-fragment', '1.4.1') version('ksp', '1.7.0-1.0.6') library('androidx-multidex', "androidx.multidex:multidex:2.0.1") library('autoservice', 'com.google.auto.service:auto-service:1.0-rc3') library('autoservice.annotations', 'com.google.auto.service:auto-service-annotations:1.0.1') - library('android-gradle', 'com.android.tools.build:gradle:7.3.0') + library('android-gradle', 'com.android.tools.build:gradle:8.1.0') library('androidx-cardview', 'androidx.cardview:cardview:1.0.0') library('androidx-core', 'androidx.core:core:1.6.0') - // 1.6.0 seems to introduce: - // The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle - // in the samples. - library('androidx-annotation', 'androidx.annotation:annotation:1.5.0') - // 1.4+ requires java8. - library('androidx-appcompat', 'androidx.appcompat:appcompat:1.3.1') + library('androidx-annotation', 'androidx.annotation:annotation:1.6.0') + library('androidx-appcompat', 'androidx.appcompat:appcompat:1.4.0') library('androidx-benchmark.gradle', 'androidx.benchmark', 'benchmark-gradle-plugin').versionRef('androidx-benchmark') library('androidx-benchmark.junit', 'androidx.benchmark', 'benchmark-junit4').versionRef('androidx-benchmark') library('androidx-core.ktx', 'androidx.core:core-ktx:1.8.0') @@ -90,7 +85,7 @@ dependencyResolutionManagement { library('androidx-fragment.ktx', 'androidx.fragment', 'fragment-ktx').versionRef('androidx-fragment') library('androidx-futures', 'androidx.concurrent:concurrent-futures:1.1.0') library('androidx-junit', 'androidx.test.ext:junit:1.1.5') - library('androidx-recyclerview','androidx.recyclerview:recyclerview:1.2.1') + library('androidx-recyclerview','androidx.recyclerview:recyclerview:1.3.1') library('androidx-test.core', 'androidx.test:core:1.4.0') library('androidx-test.ktx', 'androidx.test:core-ktx:1.5.0') library('androidx-test.ktx.junit', 'androidx.test.ext:junit-ktx:1.1.5') @@ -114,8 +109,7 @@ dependencyResolutionManagement { library('dagger-android', 'com.google.dagger', 'dagger-android').versionRef('dagger') library('dagger-android.support', 'com.google.dagger', 'dagger-android-support').versionRef('dagger') library('dagger-android.processor', 'com.google.dagger', 'dagger-android-processor').versionRef('dagger') - library('dokka-gradle', 'org.jetbrains.dokka:dokka-gradle-plugin:1.7.10') - library('drawablepainter', 'com.google.accompanist:accompanist-drawablepainter:0.25.1') + library('dokka-gradle', 'org.jetbrains.dokka:dokka-gradle-plugin:1.8.20') library('errorprone-annotations', 'com.google.errorprone', 'error_prone_annotations').versionRef('errorprone') library('errorprone-core', 'com.google.errorprone', 'error_prone_core').versionRef('errorprone') library('errorprone-gradle', 'net.ltgt.gradle:gradle-errorprone-plugin:2.0.2') diff --git a/third_party/disklrucache/build.gradle b/third_party/disklrucache/build.gradle index 1fef6b67b0..e9190b2803 100644 --- a/third_party/disklrucache/build.gradle +++ b/third_party/disklrucache/build.gradle @@ -22,8 +22,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } }