Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26035] Android: Application freezes when using "useSpinner" in Ti.UI.Picker

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 7.1.1
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterGilberto Lopez Velazco
AssigneeAbir Mukherjee
Created2018-05-11T19:52:04.000+0000
Updated2018-05-16T21:58:11.000+0000

Description

Steps to Reproduce

Create a picker in android project

Actual Result

When using the Picker element we are receiving the following warning:"PickerProxy: the useSpinner property is deprecated, see the documentation for more information". At any time we are establishing this property and it is causing the application to freeze

Expected Result

--

Attachments

FileDateSize
.log2018-05-11T19:52:19.000+00004132455
diagnostic6285184800303355054.log2018-05-11T19:52:34.000+0000341548

Comments

  1. Abir Mukherjee 2018-05-11

    [~lchoudhary] Can you please see if you can reproduce with GA components?
  2. Lokesh Choudhary 2018-05-11

    [~amukherjee], I am not able to reproduce the issue. I see no app freeze. Used the code below:
       Ti.UI.backgroundColor = 'white';
       var win = Ti.UI.createWindow({
         exitOnClose: true,
         layout: 'vertical'
       });
       
       var picker = Ti.UI.createPicker({
       	useSpinner: true,
         top:50
       });
       
       var data = [];
       data[0]=Ti.UI.createPickerRow({title:'Bananas'});
       data[1]=Ti.UI.createPickerRow({title:'Strawberries'});
       data[2]=Ti.UI.createPickerRow({title:'Mangos'});
       data[3]=Ti.UI.createPickerRow({title:'Grapes'});
       
       picker.add(data);
       picker.selectionIndicator = true;
       
       win.add(picker);
       win.open();
       
       // must be after picker has been displayed
       picker.setSelectedRow(0, 2, false); // select Mangos
       
    Studio Ver: 5.1.0.201804230827 SDK Ver: 7.1.1.GA OS Ver: 10.13.4 Xcode Ver: Xcode 9.3 Appc NPM: 4.2.13 Appc CLI: 7.0.3 Daemon Ver: 1.1.1 Ti CLI Ver: 5.1.0 Alloy Ver: 1.12.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10 Devices: ⇨ google Nexus 6P --- Android 8.1.0 ⇨ google Nexus 5 --- Android 6.0.1 Emulator: ⇨ Android 4.1.2
  3. Abir Mukherjee 2018-05-11

    [~glvelazco] do you have testcode or a test case we may use to reproduce the issue you see?
  4. Joshua Quick 2018-05-16

    If I set the picker type to Ti.UI.PICKER_TYPE_DATE_AND_TIME, then the app will hang on Android and the following warning will be logged...
       [WARN] :   PickerProxy: Date+Time timer not supported in Titanium for Android
       
    For example:
       var window = Ti.UI.createWindow();
       var picker = Ti.UI.createPicker({
       	type: Ti.UI.PICKER_TYPE_DATE_AND_TIME,
       });
       window.add(picker);
       window.open();
       
    [~glvelazco], is this what you're doing?
  5. Gilberto Lopez Velazco 2018-05-16

    That is not what he is doing. I have a form that we need 5 pickers each with 100 numerical data. When the application is generated, I receive the warning "PickerProxy: the useSpinner property is deprecated, check the documentation for more information", but the useSpinner property is never set, the warning is cycled and the application freezes. The data is like this : [100,105,110, .... ]
  6. Joshua Quick 2018-05-16

    [~glvelazco], we still can't reproduce this issue. I've tried the below which creates 5 pickers, each containing 200 rows. It doesn't hang. The app runs fine.
       function createPicker() {
       	var maxItems = 200;
       	var rows = new Array(maxItems);
       	for (var index = 0; index < maxItems; index++) {
       		rows[index] = Ti.UI.createPickerRow({ title: index.toString() });
       	}
       	var picker = Ti.UI.createPicker({
       		top: "40dp",
       		width: "50%",
       //		useSpinner: true,
       		useSpinner: false,
       	});
       	picker.add(rows);
       	return picker;
       }
       
       var window = Ti.UI.createWindow({ layout: "vertical" });
       window.add(createPicker());
       window.add(createPicker());
       window.add(createPicker());
       window.add(createPicker());
       window.add(createPicker());
       window.open();
       
    Note that you will get a "useSpinner property is deprecated" warning message if useSpinner is set false as well. To avoid this message, simply omit the useSpinner property since it defaults to false anyways. That said, I think the useSpinner warning message is a red herring and not the cause of your issue. Can you provide us a reproducible test case please?
  7. Gilberto Lopez Velazco 2018-05-16

    I will try this, it is difficult to show how it is happening unless I send you a video
  8. Gilberto Lopez Velazco 2018-05-16

    As a comment, this did not happen before updating appcelerator
  9. Joshua Quick 2018-05-16

    If you comment out the picker, then does the issue go away? I say this because I suspect something else is the cause here. The logged warning message may be sending us on a wild goose chase. Are you updating a UI from the same UI's "change" event, which might cause it to be put into an infinite loop? I've tried this with a picker (select a different item within a picker's "change" event), but picker's don't have this issue. You may want to add logging messages in your listeners to isolate where the infinite loop is happening. That's the best advise I can give. Other than that, we're at a loss on how to reproduce your issue.
  10. Gilberto Lopez Velazco 2018-05-16

    Exactly! Comment on the part where the selector is shown works correctly. Added screenshots. [without picker](https://drive.google.com/open?id=1cW0areq9QF9TE8_OT7yP5M7bcyXojOCI) [with pickers](https://drive.google.com/open?id=1XbnKn8JMbyt-mCglEFerQqrkAZdksGie) [with pickers, 4 minutes later](https://drive.google.com/open?id=1pY_tiiprSh-wUFFwD58Y-YljfMUosRuG)
  11. Joshua Quick 2018-05-16

    Okay. I see you're using Alloy. Can you give us the XML you're using to set up the window and its pickers? Any code to go with it? At the moment, we can't reproduce your issue. And nobody else (as far as we've seen) is having this issue either. We need something or else we won't be able to help you.

JSON Source