ResourcesCompat.java
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package android.support.v4.content.res;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.content.res.Resources.Theme;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
public final class ResourcesCompat
{
@ColorInt
public static int getColor(@NonNull Resources paramResources, @ColorRes int paramInt, @Nullable Resources.Theme paramTheme)
throws Resources.NotFoundException
{
if (Build.VERSION.SDK_INT >= 23) {
return paramResources.getColor(paramInt, paramTheme);
}
return paramResources.getColor(paramInt);
}
@Nullable
public static ColorStateList getColorStateList(@NonNull Resources paramResources, @ColorRes int paramInt, @Nullable Resources.Theme paramTheme)
throws Resources.NotFoundException
{
if (Build.VERSION.SDK_INT >= 23) {
return paramResources.getColorStateList(paramInt, paramTheme);
}
return paramResources.getColorStateList(paramInt);
}
@Nullable
public static Drawable getDrawable(@NonNull Resources paramResources, @DrawableRes int paramInt, @Nullable Resources.Theme paramTheme)
throws Resources.NotFoundException
{
if (Build.VERSION.SDK_INT >= 21) {
return paramResources.getDrawable(paramInt, paramTheme);
}
return paramResources.getDrawable(paramInt);
}
@Nullable
public static Drawable getDrawableForDensity(@NonNull Resources paramResources, @DrawableRes int paramInt1, int paramInt2, @Nullable Resources.Theme paramTheme)
throws Resources.NotFoundException
{
if (Build.VERSION.SDK_INT >= 21) {
return paramResources.getDrawableForDensity(paramInt1, paramInt2, paramTheme);
}
if (Build.VERSION.SDK_INT >= 15) {
return paramResources.getDrawableForDensity(paramInt1, paramInt2);
}
return paramResources.getDrawable(paramInt1);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/content/res/ResourcesCompat.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/