diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2015-01-31 07:53:10 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2015-01-31 07:53:10 +0100 |
| commit | a29ffa627fb26d2838fb85de27f479c8b1c22f2c (patch) | |
| tree | 0f1939e2585d1038ddb72b29a9c39339781f769a /main/src | |
| parent | 1cfd08a7db0682548718998edbadd920c12e464d (diff) | |
| download | cgeo-a29ffa627fb26d2838fb85de27f479c8b1c22f2c.zip cgeo-a29ffa627fb26d2838fb85de27f479c8b1c22f2c.tar.gz cgeo-a29ffa627fb26d2838fb85de27f479c8b1c22f2c.tar.bz2 | |
#4605 explicitly set system text selectable after filling
This may or may not fix the issue.
Diffstat (limited to 'main/src')
5 files changed, 46 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/AboutActivity.java b/main/src/cgeo/geocaching/AboutActivity.java index 2f1c20a..d964b3c 100644 --- a/main/src/cgeo/geocaching/AboutActivity.java +++ b/main/src/cgeo/geocaching/AboutActivity.java @@ -4,6 +4,7 @@ import butterknife.ButterKnife; import butterknife.InjectView; import cgeo.geocaching.activity.AbstractViewPagerActivity; +import cgeo.geocaching.compatibility.Compatibility; import cgeo.geocaching.sensors.OrientationProvider; import cgeo.geocaching.sensors.RotationProvider; import cgeo.geocaching.sensors.Sensors; @@ -98,6 +99,7 @@ public class AboutActivity extends AbstractViewPagerActivity<AboutActivity.Page> ButterKnife.inject(this, view); system.setText(systemInformation(AboutActivity.this)); system.setMovementMethod(AnchorAwareLinkMovementMethod.getInstance()); + Compatibility.setTextIsSelectable(system, true); return view; } } diff --git a/main/src/cgeo/geocaching/compatibility/AndroidLevel11.java b/main/src/cgeo/geocaching/compatibility/AndroidLevel11.java new file mode 100644 index 0000000..8398eb3 --- /dev/null +++ b/main/src/cgeo/geocaching/compatibility/AndroidLevel11.java @@ -0,0 +1,15 @@ +package cgeo.geocaching.compatibility; + +import android.annotation.TargetApi; +import android.os.Build; +import android.widget.TextView; + +@TargetApi(Build.VERSION_CODES.HONEYCOMB) +public class AndroidLevel11 implements AndroidLevel11Interface { + + @Override + public void setTextIsSelectable(final TextView textView, final boolean selectable) { + textView.setTextIsSelectable(selectable); + } + +} diff --git a/main/src/cgeo/geocaching/compatibility/AndroidLevel11Emulation.java b/main/src/cgeo/geocaching/compatibility/AndroidLevel11Emulation.java new file mode 100644 index 0000000..b4111ab --- /dev/null +++ b/main/src/cgeo/geocaching/compatibility/AndroidLevel11Emulation.java @@ -0,0 +1,12 @@ +package cgeo.geocaching.compatibility; + +import android.widget.TextView; + +public class AndroidLevel11Emulation implements AndroidLevel11Interface { + + @Override + public void setTextIsSelectable(final TextView textView, final boolean selectable) { + // do nothing + } + +} diff --git a/main/src/cgeo/geocaching/compatibility/AndroidLevel11Interface.java b/main/src/cgeo/geocaching/compatibility/AndroidLevel11Interface.java new file mode 100644 index 0000000..45c06a4 --- /dev/null +++ b/main/src/cgeo/geocaching/compatibility/AndroidLevel11Interface.java @@ -0,0 +1,9 @@ +package cgeo.geocaching.compatibility; + +import android.widget.TextView; + +public interface AndroidLevel11Interface { + + void setTextIsSelectable(TextView textView, boolean selectable); + +} diff --git a/main/src/cgeo/geocaching/compatibility/Compatibility.java b/main/src/cgeo/geocaching/compatibility/Compatibility.java index 54e2966..ad16172 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(); } @@ -30,11 +33,15 @@ public final class Compatibility { 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); + } } |
