Skip to content

Commit 4827c9e

Browse files
committed
MOE automated commit.
Use ResourceIds instead of depending on R.raw.canonical in CanonicalBitmap. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173974844
1 parent aa2711b commit 4827c9e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

instrumentation/src/androidTest/java/com/bumptech/glide/test/CanonicalBitmap.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import android.support.annotation.NonNull;
77
import android.support.annotation.Nullable;
88
import android.support.test.InstrumentationRegistry;
9-
import com.bumptech.glide.instrumentation.R;
109
import com.bumptech.glide.util.Preconditions;
1110

1211
public final class CanonicalBitmap {
@@ -41,7 +40,8 @@ private Bitmap decodeBitmap() {
4140
Context context = InstrumentationRegistry.getTargetContext();
4241
BitmapFactory.Options options = new BitmapFactory.Options();
4342
options.inScaled = false;
44-
Bitmap result = BitmapFactory.decodeResource(context.getResources(), R.raw.canonical, options);
43+
int resourceId = ResourceIds.raw.canonical;
44+
Bitmap result = BitmapFactory.decodeResource(context.getResources(), resourceId, options);
4545
if (scaleFactor != null) {
4646
result = Bitmap.createScaledBitmap(
4747
result,

instrumentation/src/androidTest/java/com/bumptech/glide/test/ResourceIds.java

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ private ResourceIds() {
1515

1616
public interface raw {
1717
int dl_world_anim = getResourceId("raw", "dl_world_anim");
18+
int canonical = getResourceId("raw", "canonical");
1819
}
1920

2021
public interface drawable {

0 commit comments

Comments
 (0)