Skip to content

Commit

Permalink
Merge pull request #200 from bumptech/master
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Aug 24, 2023
2 parents 0a37cb4 + af0d631 commit 1953aa6
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 83 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/instrumentation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 0 additions & 3 deletions instrumentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ dependencies {
// Not totally clear why this is required, but it seems to be missing when tests are run on
// 4.1.2 and 4.2.0 emulators.
androidTestImplementation libs.findbugs.jsr305

coreLibraryDesugaring libs.android.tools.desugar
}

android {
Expand All @@ -47,7 +45,6 @@ android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
coreLibraryDesugaringEnabled true
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ 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.size
import androidx.compose.foundation.layout.width
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.layout.ContentScale
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.test.assert
Expand Down Expand Up @@ -372,4 +377,18 @@ class GlideImageTest {
.assert(expectDisplayedDrawable(drawable))
}
}

// See #5256
@Test
fun glideImage_withZeroSize_doesNotCrash() {
glideComposeRule.setContent {
GlideImage(
model = android.R.drawable.star_big_on,
contentDescription = null,
modifier = Modifier.width(IntrinsicSize.Min),
contentScale = ContentScale.Crop
)
}
glideComposeRule.waitForIdle()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.Measurable
import androidx.compose.ui.layout.MeasureResult
import androidx.compose.ui.layout.MeasureScope
import androidx.compose.ui.layout.ScaleFactor
import androidx.compose.ui.layout.times
import androidx.compose.ui.node.DrawModifierNode
import androidx.compose.ui.node.LayoutModifierNode
Expand Down Expand Up @@ -477,10 +478,13 @@ internal class GlideNode : DrawModifierNode, LayoutModifierNode, SemanticsModifi
val constrainedHeight = constraints.constrainHeight(intrinsicHeight)

val srcSize = Size(intrinsicWidth.toFloat(), intrinsicHeight.toFloat())
val scaledSize =
srcSize * contentScale.computeScaleFactor(
val scaleFactor = contentScale.computeScaleFactor(
srcSize, Size(constrainedWidth.toFloat(), constrainedHeight.toFloat())
)
if (scaleFactor == ScaleFactor.Unspecified) {
return constraints
}
val scaledSize = srcSize * scaleFactor

val minWidth = constraints.constrainWidth(scaledSize.width.roundToInt())
val minHeight = constraints.constrainHeight(scaledSize.height.roundToInt())
Expand Down
8 changes: 1 addition & 7 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@
"allowedVersions": "<1.6.0"
},
{
"matchPackageNames": [
"androidx.appcompat:appcompat"
],
"matchPackageNames": ["androidx.appcompat:appcompat"],
"allowedVersions": "<1.4.0"
},
{
"matchPackageNames": ["com.android.tools:desugar_jdk_libs"],
"matchPackageNames": ["!/1\.2\.3/"]
}
]
}
4 changes: 1 addition & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ dependencyResolutionManagement {
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')
// 1.2.3 seems broken: https://issuetracker.google.com/issues/290507059
library('android-tools-desugar', 'com.android.tools:desugar_jdk_libs:1.2.2')
library('androidx-cardview', 'androidx.cardview:cardview:1.0.0')
library('androidx-core', 'androidx.core:core:1.6.0')
// 1.6.0 seems to introduce:
Expand Down Expand Up @@ -146,7 +144,7 @@ dependencyResolutionManagement {
library('retrofit-rxjava', 'com.squareup.retrofit2', 'adapter-rxjava').versionRef('retrofit')
library('robolectric', 'org.robolectric:robolectric:4.8.1')
library('rx-android', 'io.reactivex:rxandroid:1.2.1')
library('rx-java', 'io.reactivex:rxjava:1.3.4')
library('rx-java', 'io.reactivex:rxjava:1.3.8')
library('svg', 'com.caverock:androidsvg:1.2.1')
library('truth', 'com.google.truth:truth:1.1.5')
library('violations', 'se.bjurr.violations:violations-gradle-plugin:1.8')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/** Helper for running sections of code on the main thread in emulator tests. */
public class ConcurrencyHelper {
private final Handler handler = new Handler(Looper.getMainLooper());
private static final long TIMEOUT_SECONDS = 20;
private static final long TIMEOUT_SECONDS = 10;
private static final TimeUnit TIMEOUT_UNIT = TimeUnit.SECONDS;

public <T> T get(final Future<T> future) {
Expand Down

0 comments on commit 1953aa6

Please sign in to comment.