1package io.flutter.embedding.android;
3import static org.robolectric.util.reflector.Reflector.reflector;
5import android.content.res.Resources;
7import android.graphics.drawable.ColorDrawable;
8import android.graphics.drawable.Drawable;
9import androidx.annotation.Nullable;
10import org.robolectric.annotation.Implementation;
11import org.robolectric.annotation.Implements;
12import org.robolectric.annotation.RealObject;
13import org.robolectric.shadows.ShadowResources;
14import org.robolectric.util.reflector.Direct;
15import org.robolectric.util.reflector.ForType;
17@SuppressWarnings(
"deprecation")
19@Implements(Resources.class)
21 @RealObject
private Resources resources;
23 public static final int SPLASH_DRAWABLE_ID = 191919;
24 public static final int THEMED_SPLASH_DRAWABLE_ID = 212121;
26 @ForType(Resources.class)
37 if (
id == SPLASH_DRAWABLE_ID) {
38 return new ColorDrawable(
Color.BLUE);
40 return reflector(Resources.class, resources).getDrawable(
id);
44 protected Drawable
getDrawable(
int id, @Nullable Resources.Theme theme) {
45 if (
id == THEMED_SPLASH_DRAWABLE_ID) {
49 throw new Resources.NotFoundException(
50 "Cannot parse drawable due to missing theme references.");
52 return new ColorDrawable(
Color.GRAY);
54 return reflector(Resources.class, resources).getDrawable(
id, theme);
Drawable getDrawable(int id, @Nullable Resources.Theme theme)
Drawable getDrawable(int id)
Drawable getDrawable(int id)
Drawable getDrawable(int id, Resources.Theme theme)
SK_API sk_sp< SkShader > Color(SkColor)