Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2365] Android: Spinner-style Picker needs to support dimensions

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:54.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M08
ComponentsAndroid
Labelsandroid, feature, picker, release-1.6.0
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:17:51.000+0000
Updated2011-04-17T01:58:54.000+0000

Description

Comments

  1. Rich Baughman 2011-04-15

    Bill - I don't know if my Helpdesk request #92651 (android-picker-wspinner-limited-to-3-columns) is included in this or the other picker request items, but wanted to put it out there, FYI. We have an iOS app that uses 4 columns - ideal for getting maximum screen real estate use for user input out of the Picker, esp. when the values of each field are relatively limited in range. I would think 5 columns would be a reasonable limit. I do hope that the limit of 3 can be lifted in the 1.6 release(?).

  2. Bill Dawson 2011-04-15

    There is no limit of 3 (you might think that because it's only showing three due to its inability to have column widths applied to it.)

    For example:

       /*global Ti, Titanium, alert, JSON, require, setTimeout, setInterval */
       Titanium.UI.setBackgroundColor('#000');
       var win = Titanium.UI.createWindow({  
           title:'Test',
           backgroundColor:'#000',
           exitOnClose: true
       });
       
       var columns = [];
       for (var i = 0; i < 7; i++) {
           var rows = [];
           for (var j = 0; j < 3; j++) {
               rows.push(Ti.UI.createPickerRow({title:'x'}));
           }
           columns.push(Ti.UI.createPickerColumn({rows:rows}));
       }
       win.add(Ti.UI.createPicker({
           type: Ti.UI.PICKER_TYPE_PLAIN,
           useSpinner: true,
           columns:columns
       }));
       
       win.open();
       

    That will easily show 7 columns on a 320 width screen. But it's also pretty useless. :)

    But yeah, this is exactly the kind of thing I'm working on: the ability to set column dimensions and such, so you can control how it takes up real estate.

  3. Rich Baughman 2011-04-15

    So if I remove the explicit widths, should my app show 4 columns? Not sure why the widths are so large now if it ignores what I provided...? (The contents are not that wide.) Also, will the current version pay attention to font size?

  4. Bill Dawson 2011-04-15

    (from [be86230d6ee9c657c39326efcd04a1d3154d9c7c]) [#2365] First push of re-factored spinner. Still need to apply styles/dimensions. https://github.com/appcelerator/titanium_mobile/commit/be86230d6ee9c657c39326efcd04a1d3154d9c7c"> https://github.com/appcelerator/titanium_mobile/commit/be86230d6ee9...

  5. Bill Dawson 2011-04-15

    (from [30b41a3a4fa5693555afca3c91ca7824eb508dfb]) [#2365 state:fixed-in-qa] support font/text attributes in spinner, as well as removing columns and replacing rows in existing columns. https://github.com/appcelerator/titanium_mobile/commit/30b41a3a4fa5693555afca3c91ca7824eb508dfb"> https://github.com/appcelerator/titanium_mobile/commit/30b41a3a4fa5...

  6. Bill Dawson 2011-04-15

    The test for this is in KitchenSink: Controls -> Picker -> Android "useSpinner" - text (2). It shows a few examples such as setting font characteristics and explicit column widths.

  7. Bill Dawson 2011-04-15

    (from [58d6da5d262768bbe1273c880df98b9a22a29cf4]) [#2365] update the 'Android useSpinner text (2)' test to show the new selectionIndicator property https://github.com/appcelerator/titanium_mobile/commit/58d6da5d262768bbe1273c880df98b9a22a29cf4"> https://github.com/appcelerator/titanium_mobile/commit/58d6da5d2627...

  8. Bill Dawson 2011-04-15

    (from [acf463c9ab59d42d25f0d166e2bfa39caf7a7873]) [#2365] Also support the documented selectionIndicator property and move property change handling to the views as we usually do. https://github.com/appcelerator/titanium_mobile/commit/acf463c9ab59d42d25f0d166e2bfa39caf7a7873"> https://github.com/appcelerator/titanium_mobile/commit/acf463c9ab59...

  9. Opie Cyrus 2011-04-15

    verified on droid2 2.2

  10. Bill Dawson 2011-04-15

    (from [3e6469ab5a206d255d5b3f45d696a3a000063a77]) [#2365 state:fixed-in-qa] Handle required re-layout when visibleItems or font characteristics changed after already layed out. https://github.com/appcelerator/titanium_mobile/commit/3e6469ab5a206d255d5b3f45d696a3a000063a77"> https://github.com/appcelerator/titanium_mobile/commit/3e6469ab5a20...

  11. Opie Cyrus 2011-04-15

    verified again on emulator 2.2

  12. Rich Baughman 2011-04-15

    Bill - the latest builds of 1.6.0 (Feb 16) show that custom attributes for picker rows are not supported in the Android picker - they simply are not accessible. This greatly reduces the utility of the picker if you cannot provide formatted data whose native value or code is not accessible from the event handler object. See picker_basic.js in the Kitchen Sink - custom_item value is always undefined in Android; works in iOS. Would love to know if this is an easy fix likely to make the 1.6.0 release?

  13. Rich Baughman 2011-04-15

    Also - is there any doc on using fonts and other attributes for the Android picker? The online API docs seem to indicate that fontSize is supported, but that has no effect; the doc page also shows "font-size", "font-weight", and "font-family" - are these supported at all? Is there an ability to control the height of the picker itself (e.g., you want 5 rows shown but in a larger size)?

JSON Source