Switch was added in the sdk level 14, not 11
This commit is contained in:
parent
c274752477
commit
98d574afbf
@ -326,7 +326,6 @@ public class DB {
|
|||||||
private String cpuAbisDesc;
|
private String cpuAbisDesc;
|
||||||
private boolean ignoreTouchscreen;
|
private boolean ignoreTouchscreen;
|
||||||
|
|
||||||
//@SuppressLint("NewApi")
|
|
||||||
public CompatibilityChecker(Context ctx) {
|
public CompatibilityChecker(Context ctx) {
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
SharedPreferences prefs = PreferenceManager
|
||||||
|
@ -17,8 +17,8 @@ public abstract class SwitchCompat extends Compatibility {
|
|||||||
public abstract CompoundButton createSwitch();
|
public abstract CompoundButton createSwitch();
|
||||||
|
|
||||||
public static SwitchCompat create(ManageRepo activity) {
|
public static SwitchCompat create(ManageRepo activity) {
|
||||||
if (hasApi(11)) {
|
if (hasApi(14)) {
|
||||||
return new HoneycombSwitch(activity);
|
return new IceCreamSwitch(activity);
|
||||||
} else {
|
} else {
|
||||||
return new OldSwitch(activity);
|
return new OldSwitch(activity);
|
||||||
}
|
}
|
||||||
@ -26,10 +26,10 @@ public abstract class SwitchCompat extends Compatibility {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(11)
|
@TargetApi(14)
|
||||||
class HoneycombSwitch extends SwitchCompat {
|
class IceCreamSwitch extends SwitchCompat {
|
||||||
|
|
||||||
protected HoneycombSwitch(ManageRepo activity) {
|
protected IceCreamSwitch(ManageRepo activity) {
|
||||||
super(activity);
|
super(activity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user