From 98d574afbf40914a864c76e9e676a3adcccd1b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 8 Jan 2014 11:34:41 +0100 Subject: [PATCH] Switch was added in the sdk level 14, not 11 --- src/org/fdroid/fdroid/DB.java | 1 - src/org/fdroid/fdroid/compat/SwitchCompat.java | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/org/fdroid/fdroid/DB.java b/src/org/fdroid/fdroid/DB.java index d6688c0ea..076841ba5 100644 --- a/src/org/fdroid/fdroid/DB.java +++ b/src/org/fdroid/fdroid/DB.java @@ -326,7 +326,6 @@ public class DB { private String cpuAbisDesc; private boolean ignoreTouchscreen; - //@SuppressLint("NewApi") public CompatibilityChecker(Context ctx) { SharedPreferences prefs = PreferenceManager diff --git a/src/org/fdroid/fdroid/compat/SwitchCompat.java b/src/org/fdroid/fdroid/compat/SwitchCompat.java index a6e2d26f1..e683fb625 100644 --- a/src/org/fdroid/fdroid/compat/SwitchCompat.java +++ b/src/org/fdroid/fdroid/compat/SwitchCompat.java @@ -17,8 +17,8 @@ public abstract class SwitchCompat extends Compatibility { public abstract CompoundButton createSwitch(); public static SwitchCompat create(ManageRepo activity) { - if (hasApi(11)) { - return new HoneycombSwitch(activity); + if (hasApi(14)) { + return new IceCreamSwitch(activity); } else { return new OldSwitch(activity); } @@ -26,10 +26,10 @@ public abstract class SwitchCompat extends Compatibility { } -@TargetApi(11) -class HoneycombSwitch extends SwitchCompat { +@TargetApi(14) +class IceCreamSwitch extends SwitchCompat { - protected HoneycombSwitch(ManageRepo activity) { + protected IceCreamSwitch(ManageRepo activity) { super(activity); }