Android 5.0: extract new Switch style attributes

Switch_showText specifies whether the on/off text is shown in the
thumb and Switch_splitTrack specifies whether the track is clipped
underneath the thumb.

Change-Id: I03fc6b799fe714e7b6e604328901c8c5a418ca6e
Reviewed-by: BogDan Vatra <bogdan@kde.org>
bb10
J-P Nurmi 2014-11-09 13:01:35 +01:00 committed by J-P Nurmi
parent 3d70925ee5
commit d9715108c1
1 changed files with 5 additions and 0 deletions

View File

@ -1544,6 +1544,11 @@ 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));
}
a.recycle();
jsonWriter.name(styleName).value(json);
} catch (Exception e) {