Skip to content

Commit

Permalink
[TIMOB-19199] Android: Picker has 'selectionOpens' property to contro…
Browse files Browse the repository at this point in the history
…l expanded behavior
  • Loading branch information
Ashraf committed Jul 24, 2015
1 parent fcbe5fa commit d2cf26c
Show file tree
Hide file tree
Showing 2 changed files with 16 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", "selectionOpens", "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("selectionOpens"), true)) {
((TiUIPicker)peekView()).openPicker();
}
}

public int getColumnCount()
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: true (Android)
platforms: [android]
since: "4.3.0"

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

0 comments on commit d2cf26c

Please sign in to comment.