MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / Compatibility

Class Compatibility

src/com/cloudream/ishow/util/Compatibility.java:6–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import android.graphics.drawable.Drawable;
5
6public class Compatibility
7{
8
9 @SuppressWarnings("deprecation")
10 public static Drawable getDrawable(Context context, int id)
11 {
12 // Context.getDrawable() added in API level 21
13 if(android.os.Build.VERSION.SDK_INT >= 21)
14 return context.getDrawable(id/*, context.getTheme()*/);
15 else
16 return context.getResources().getDrawable(id);
17 }
18
19 @SuppressWarnings("deprecation")
20 public static int getColor(Context context, int id)
21 {
22 // Context.getColor() added in API level 23
23 if(android.os.Build.VERSION.SDK_INT >= 23)
24 return context.getColor(id/*, context.getTheme()*/);
25 else
26 return context.getResources().getColor(id);
27 }
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected