aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/compatibility/Compatibility.java
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-05-08 17:10:06 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-11 23:55:58 +0200
commit8ff62c5f34db48aa15c7252c40fea3381bba0952 (patch)
tree2a0ffd9bcf9a2648c45f170426cf86fb319509f2 /main/src/cgeo/geocaching/compatibility/Compatibility.java
parent1d2b34e71a01d6af118ed89258ad0ecb983e1a9c (diff)
parent59b8b2e26a7fff6072c4d5d96f51035dc900e0bc (diff)
downloadcgeo-8ff62c5f34db48aa15c7252c40fea3381bba0952.zip
cgeo-8ff62c5f34db48aa15c7252c40fea3381bba0952.tar.gz
cgeo-8ff62c5f34db48aa15c7252c40fea3381bba0952.tar.bz2
merge upstream
Diffstat (limited to 'main/src/cgeo/geocaching/compatibility/Compatibility.java')
-rw-r--r--main/src/cgeo/geocaching/compatibility/Compatibility.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/compatibility/Compatibility.java b/main/src/cgeo/geocaching/compatibility/Compatibility.java
index 54e2966..56e18bf 100644
--- a/main/src/cgeo/geocaching/compatibility/Compatibility.java
+++ b/main/src/cgeo/geocaching/compatibility/Compatibility.java
@@ -5,15 +5,18 @@ import org.eclipse.jdt.annotation.NonNull;
import android.app.Activity;
import android.graphics.Point;
import android.os.Build;
+import android.widget.TextView;
public final class Compatibility {
private static final int SDK_VERSION = Build.VERSION.SDK_INT;
+ private static final AndroidLevel11Interface LEVEL_11;
private static final AndroidLevel13Interface LEVEL_13;
private static final AndroidLevel19Interface LEVEL_19;
static {
+ LEVEL_11 = SDK_VERSION >= 11 ? new AndroidLevel11() : new AndroidLevel11Emulation();
LEVEL_13 = SDK_VERSION >= 13 ? new AndroidLevel13() : new AndroidLevel13Emulation();
LEVEL_19 = SDK_VERSION >= 19 ? new AndroidLevel19() : new AndroidLevel19Emulation();
}
@@ -22,19 +25,19 @@ public final class Compatibility {
// utility class
}
- public static int getDisplayWidth() {
- return LEVEL_13.getDisplayWidth();
- }
-
public static Point getDisplaySize() {
return LEVEL_13.getDisplaySize();
}
- public static void importGpxFromStorageAccessFramework(final @NonNull Activity activity, int requestCodeImportGpx) {
+ public static void importGpxFromStorageAccessFramework(final @NonNull Activity activity, final int requestCodeImportGpx) {
LEVEL_19.importGpxFromStorageAccessFramework(activity, requestCodeImportGpx);
}
public static boolean isStorageAccessFrameworkAvailable() {
return SDK_VERSION >= 19;
}
+
+ public static void setTextIsSelectable(final TextView textView, final boolean selectable) {
+ LEVEL_11.setTextIsSelectable(textView, selectable);
+ }
}