diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2018-12-17 08:18:08 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-01-23 15:21:56 +0000 |
commit | e0dc6dce222173bfa8fe20e1f33d24de70ea9fdd (patch) | |
tree | 8176a2acde789dd00fd4a702e210229a51c0fcb1 /src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java | |
parent | aa32510430d6a5e58cb456faeb072d9f189872fe (diff) |
Android: Set minimum supported version to android-21
With the current distribution, this is 90% of active devices, and
it was released in 2014. Qt 5.12 is LTS and will continue to support
older Android versions for a long time to come.
This is to reduce the testing needed on outdated platforms and
allow ourselves to use some newer APIs unconditionally in Qt.
Android 21 was chosen because it is the minimum version that supports
64 bit builds.
[ChangeLog][Android] Increased the minimum supported Android version
to Android 5.0 (API level 21).
Fixes: QTBUG-70508
Change-Id: Ia7b4345e42ca05a25a292f11ccbb8cbd692cf8f0
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java index 3f74383a82..e6de354ac4 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java +++ b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java @@ -89,8 +89,6 @@ import android.view.inputmethod.EditorInfo; public class ExtractStyle { - native static int[] extractChunkInfo(byte[] chunkData); - native static int[] extractNativeChunkInfo(int nativeChunk); native static int[] extractChunkInfo20(byte[] chunkData); native static int[] extractNativeChunkInfo20(long nativeChunk); @@ -345,10 +343,7 @@ public class ExtractStyle { } public void drawPatch(Bitmap bmp, byte[] chunks, RectF dst, Paint paint) { - if (Build.VERSION.SDK_INT > 19) - chunkData = extractChunkInfo20(chunks); - else - chunkData = extractChunkInfo(chunks); + chunkData = extractChunkInfo20(chunks); } } @@ -698,10 +693,6 @@ public class ExtractStyle { json.put("thicknessRatio",gradientStateClass.getField("mThicknessRatio").getFloat(obj)); json.put("innerRadius",gradientStateClass.getField("mInnerRadius").getInt(obj)); json.put("thickness",gradientStateClass.getField("mThickness").getInt(obj)); - if (Build.VERSION.SDK_INT < 20) { - json.put("solidColor",gradientStateClass.getField("mSolidColor").getInt(obj)); - json.put("strokeColor",gradientStateClass.getField("mStrokeColor").getInt(obj)); - } } catch (Exception e) { e.printStackTrace(); } @@ -802,14 +793,7 @@ public class ExtractStyle { Object state = getAccessibleField(NinePatchDrawable.class, "mNinePatchState").get(d); np = (NinePatch) getAccessibleField(state.getClass(), "mNinePatch").get(state); } - if (Build.VERSION.SDK_INT < 19) - return getJsonChunkInfo(extractChunkInfo((byte[]) getAccessibleField(np.getClass(), "mChunk").get(np))); - else - { - if (Build.VERSION.SDK_INT > 19) - return getJsonChunkInfo(extractNativeChunkInfo20(getAccessibleField(np.getClass(), "mNativeChunk").getLong(np))); - return getJsonChunkInfo(extractNativeChunkInfo(getAccessibleField(np.getClass(), "mNativeChunk").getInt(np))); - } + return getJsonChunkInfo(extractNativeChunkInfo20(getAccessibleField(np.getClass(), "mNativeChunk").getLong(np))); } class DrawableCache @@ -1016,16 +1000,12 @@ public class ExtractStyle { json.put("gravity", bitmapDrawable.getGravity()); json.put("tileModeX", bitmapDrawable.getTileModeX()); json.put("tileModeY", bitmapDrawable.getTileModeY()); - if (Build.VERSION.SDK_INT >= 18) { - json.put("antialias", (Boolean) BitmapDrawable.class.getMethod("hasAntiAlias").invoke(bitmapDrawable)); - json.put("mipMap", (Boolean) BitmapDrawable.class.getMethod("hasMipMap").invoke(bitmapDrawable)); - } - if (Build.VERSION.SDK_INT >= 21) { - json.put("tintMode", (PorterDuff.Mode) BitmapDrawable.class.getMethod("getTintMode").invoke(bitmapDrawable)); - ColorStateList tintList = (ColorStateList) BitmapDrawable.class.getMethod("getTint").invoke(bitmapDrawable); - if (tintList != null) - json.put("tintList", getColorStateList(tintList)); - } + json.put("antialias", (Boolean) BitmapDrawable.class.getMethod("hasAntiAlias").invoke(bitmapDrawable)); + json.put("mipMap", (Boolean) BitmapDrawable.class.getMethod("hasMipMap").invoke(bitmapDrawable)); + json.put("tintMode", (PorterDuff.Mode) BitmapDrawable.class.getMethod("getTintMode").invoke(bitmapDrawable)); + ColorStateList tintList = (ColorStateList) BitmapDrawable.class.getMethod("getTint").invoke(bitmapDrawable); + if (tintList != null) + json.put("tintList", getColorStateList(tintList)); } catch (Exception e) { e.printStackTrace(); } @@ -1758,10 +1738,8 @@ public class ExtractStyle { json.put("Switch_switchPadding", a.getDimensionPixelSize(getField(styleableClass, "Switch_switchPadding"), 0)); json.put("Switch_thumbTextPadding", a.getDimensionPixelSize(getField(styleableClass, "Switch_thumbTextPadding"), 0)); - if (Build.VERSION.SDK_INT >= 21) { - json.put("Switch_showText", a.getBoolean(getField(styleableClass, "Switch_showText"), true)); - json.put("Switch_splitTrack", a.getBoolean(getField(styleableClass, "Switch_splitTrack"), false)); - } + json.put("Switch_showText", a.getBoolean(getField(styleableClass, "Switch_showText"), true)); + json.put("Switch_splitTrack", a.getBoolean(getField(styleableClass, "Switch_splitTrack"), false)); a.recycle(); jsonWriter.name(styleName).value(json); |