Skip to content

Commit

Permalink
Merge pull request #6982 from ashcoding/TIMOB-19199
Browse files Browse the repository at this point in the history
[TIMOB-19199] Android: Picker has 'selectionOpens' property to contro…
  • Loading branch information
hieupham007 committed Aug 14, 2015
2 parents 1b0d4a8 + c616a52 commit 7d210cb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import android.widget.TimePicker;

@Kroll.proxy(creatableInModule=UIModule.class, propertyAccessors={
"locale", "visibleItems", "value", TiC.PROPERTY_CALENDAR_VIEW_SHOWN, TiC.PROPERTY_FONT
"locale", TiC.PROPERTY_SELECTION_OPENS, "visibleItems", "value", TiC.PROPERTY_CALENDAR_VIEW_SHOWN, TiC.PROPERTY_FONT
})
public class PickerProxy extends TiViewProxy implements PickerColumnListener
{
Expand Down Expand Up @@ -461,7 +461,9 @@ private void handleSelectRow(int column, int row, boolean animated)
return;
}
((TiUIPicker)peekView()).selectRow(column, row, animated);
((TiUIPicker)peekView()).openPicker();
if (TiConvert.toBoolean(getProperty(TiC.PROPERTY_SELECTION_OPENS), false)) {
((TiUIPicker)peekView()).openPicker();
}
}

public int getColumnCount()
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 @@ -2188,6 +2188,11 @@ public class TiC
*/
public static final String PROPERTY_SELECTION_INDICATOR = "selectionIndicator";

/**
* @module.api
*/
public static final String PROPERTY_SELECTION_OPENS = "selectionOpens";

/**
* @module.api
*/
Expand Down
12 changes: 12 additions & 0 deletions apidoc/Titanium/UI/Picker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,18 @@ properties:
default: true (Android), false (iPhone, iPad)
platforms: [android, iphone, ipad]

- name: selectionOpens
summary: |
Determines whether calling the method `setSelectedRow` opens when called
description: |
If `true`, selection will open when `setSelectedRow` is called.
If `false`, selection will not open when `setSelectedRow` is called.
type: Boolean
default: false (Android)
platforms: [android]
since: "4.3.0"

- name: type
summary: Determines the type of picker displayed
description: |
Expand Down

0 comments on commit 7d210cb

Please sign in to comment.