Skip to content

Commit

Permalink
TIMOB-20267 Android: fix slider track
Browse files Browse the repository at this point in the history
  • Loading branch information
fmerzadyan committed Jun 8, 2017
1 parent 8093ab9 commit e253a37
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@Kroll.proxy(creatableInModule=UIModule.class, propertyAccessors = {
"min", "max", "minRange",
"maxRange", "thumbImage",
TiC.PROPERTY_SPLIT_TRACK,
"leftTrackImage","rightTrackImage",
TiC.PROPERTY_VALUE
})
Expand All @@ -25,6 +26,7 @@ public class SliderProxy extends TiViewProxy
public SliderProxy()
{
super();
defaultValues.put(TiC.PROPERTY_SPLIT_TRACK, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ public void processProperties(KrollDict d)
} else {
maxRange = max;
}

if (d.containsKey("thumbImage")) {
updateThumb(seekBar, d);
}

if (d.containsKey(TiC.PROPERTY_SPLIT_TRACK)) {
seekBar.setSplitTrack(TiConvert.toBoolean(d.get(TiC.PROPERTY_SPLIT_TRACK)));
}
if (d.containsKey("leftTrackImage") || d.containsKey("rightTrackImage")) {
updateTrackingImages(seekBar, d);
}
Expand Down Expand Up @@ -267,6 +268,8 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
//updateThumb(seekBar, proxy.getDynamicProperties());
//seekBar.invalidate();
Log.i(TAG, "Dynamically changing thumbImage is not yet supported. Native control doesn't draw");
} else if (key.equals(TiC.PROPERTY_SPLIT_TRACK)) {
seekBar.setSplitTrack(TiConvert.toBoolean(newValue));
} else if (key.equals("leftTrackImage") || key.equals("rightTrackImage")) {
//updateTrackingImages(seekBar, proxy.getDynamicProperties());
//seekBar.invalidate();
Expand Down
5 changes: 5 additions & 0 deletions android/titanium/src/java/org/appcelerator/titanium/TiC.java
Original file line number Diff line number Diff line change
Expand Up @@ -2553,6 +2553,11 @@ public class TiC
*/
public static final String PROPERTY_SPLIT_ACTIONBAR = "splitActionBar";

/**
* @module.api
*/
public static final String PROPERTY_SPLIT_TRACK = "splitTrack";

/**
* @module.api
*/
Expand Down
7 changes: 7 additions & 0 deletions apidoc/Titanium/UI/Slider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,13 @@ properties:
type: String
platforms: [iphone, ipad]

- name: splitTrack
summary: Separates the thumbImage from the slider track.
type: Boolean
default: false
since: 6.2.0
platforms: [android]

- name: thumbImage
summary: Image for the slider thumb.
description: |
Expand Down

0 comments on commit e253a37

Please sign in to comment.