Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15902] Android: No animation using buttongrid widget

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsexalture
ReporterSébastien DELCROIX
AssigneeUnknown
Created2013-11-22T17:47:19.000+0000
Updated2018-02-28T20:04:19.000+0000

Description

Hi, during buttongrid widget relayout, buttons animation doesn't occur. Animation is fine when triggered on click event as following :
function moveToCenter(e) {
	var btn = $.serviceGrid.getButton(e.source.id);
	btn.animate({
		top: 0,
		left: 0,
		duration: 100
	});	
}

$.serviceGrid.init({
    buttons: [
{ id: 'btnSettings', title: "Paramètres", click: moveToCenter }
    ],
    buttonWidth: Alloy.isTablet ? 180: 90,
    buttonHeight: Alloy.isTablet ? 180 : 90,
    duration: 100,
    assetDir: '/images/buttons/'
}); 

From Tester:

Steps to Reproduce:

1. Create(import) a new project from the attached project zip 2. Run the app on an Android device 3. Change to the second tab 4. Change the device orientation several times 5. Notice that the animation occurs, but the grid is not always displayed properly (especially if on tab 2, switch to tab 3, change orientation, then switch back to tab 2)

Additional Notes:

When I tested this on a Galaxy Tab 2, the app would crash when trying to change to tab 2 or 3. I do not see the animations upon pressing the button on Tab 3 and the button becomes inaccessible after pressing it and changing orientations (you have to change the orientation back).

Attachments

FileDateSize
buttongrid broken.png2013-11-25T20:45:41.000+000078143
buttongrid OK on first tab.png2013-11-25T20:45:41.000+0000101613
buttongrid orientation change lost buttons.png2013-11-25T20:45:41.000+000095355
ButtonGridTest.zip2013-11-25T20:33:25.000+00007435151

Comments

  1. Ingo Muschenetz 2013-11-25

    Can you please attach a complete application that shows the problem?
  2. Sébastien DELCROIX 2013-11-25

    Here is a fresh 3-tabs app with a buttongrid on the second one. More info since I've opened this issue : *animation is OK but buttons positioning fails. It's like the buttons "consider" the scrollview center as the top-left coordinate and start positioning from that point. *problem only occurs when buttongrid is added to a tab that's not the first one. *when I rotate the device, sometimes it works, sometimes it doesn't. Some screenshots added illustrating all of that.
  3. Mostafizur Rahman 2013-11-28

    Hello [~mpmiranda] I have tested this issue. It’s working good for me. I can't reproduce this issue.

    Testing environment:

    OS: MAC OS X 10.8.5 Ti SDK: 3.2.0.v20131126144841 Ti CLI: 3.3.0 Android SDK 4.0.3

    Test case:

    Run this code in Android emulator or Device

    Select Tab 2 (Services)

    Rotate this Emulator/Device then button grid will rearrange

    Expected Result

    Animation and Button Grid working good

    Thanks
  4. Sébastien DELCROIX 2013-12-03

    Any news about it ?
  5. Ingo Muschenetz 2013-12-03

    We can't seem to reproduce the issue using your code. See above.
  6. Sébastien DELCROIX 2013-12-03

    Thanks for testing and feedback. I also confirm that it works with Android SDK 4.0.3. Issue occurs with Android SDK version >= 4.1.2 and apparently when the buttongrid is displayed for the first time. Buttons get into a mess. After that, if you change orientation, buttons rearrange well. Tested on emulator and Genymotion.
  7. Sébastien DELCROIX 2013-12-05

    {quote} Additional Notes: When I tested this on a Galaxy Tab 2, the app would crash when trying to change to tab 2 or 3. {quote} Note that app may crash if tested on a device for which I didn't include specific assets for dpi/ratio/orientation. It also happened to me on Galaxy Tab 2.
  8. Hieu Pham 2013-12-06

    I was able to reproduce this half the time on 4.2.2 device. It would help if we can get a smaller and reliable test case. Edit: I also ran the project against 3.1.3.GA and 3.1.2.GA and I get crashes when I attempt to change orientation in the 2nd tab. The error in the log indicates that some resources can't be found:
        Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f020012
       E/AndroidRuntime( 2707): 	at android.content.res.Resources.getValue(Resources.java:1014)
       E/AndroidRuntime( 2707): 	at android.content.res.Resources.getDrawable(Resources.java:659)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.util.TiUIHelper.getResourceDrawable(TiUIHelper.java:845)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.util.TiUIHelper.getResourceDrawable(TiUIHelper.java:840)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.util.TiFileHelper.loadDrawable(TiFileHelper.java:279)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.util.TiUIHelper.buildBackgroundDrawable(TiUIHelper.java:508)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.util.TiUIHelper.buildBackgroundDrawable(TiUIHelper.java:562)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:943)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:685)
       E/AndroidRuntime( 2707): 	at ti.modules.titanium.ui.widget.TiUIButton.processProperties(TiUIButton.java:54)
       E/AndroidRuntime( 2707): 	at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1162)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:469)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:476)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:476)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)
       E/AndroidRuntime( 2707): 	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)
       E/AndroidRuntime( 2707): 	at ti.modules.titanium.ui.widget.tabgroup.TiUIAbstractTab.getContentView(TiUIAbstractTab.java:58)
       E/AndroidRuntime( 2707): 	at ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab.initializeFragment(TiUIActionBarTab.java:9
       
  9. Sébastien DELCROIX 2013-12-07

    Hi Hieu, As I said, this small app may crash if tested on a device for which I didn't include specific assets for dpi/ratio/orientation. I guess you can simply copy assets to the right res-xxx folder and it would not. So, for a smaller test case, do you want me to attach an app without specific assets folders for example ?
  10. Ingo Muschenetz 2013-12-16

    Can you please let us know what native integrations are required?
  11. Sébastien DELCROIX 2013-12-18

    Sorry to say that, but I don't understand your question Ingo. Can you please explain what you mean by "native integrations" ? Thanks.
  12. Ingo Muschenetz 2013-12-18

    I'm actually not sure what I meant there. I might have accidentally commented on the wrong ticket. A smaller test case would be appreciated, yes.
  13. Sébastien DELCROIX 2013-12-18

    That's what I thought ;) OK, I'll do that tomorrow. I have precisely created a more simple app with only one window and problem still occurs. Edit: I don't have the ability to attach a file to the report. Can you please allow me or do I have to put it somewhere online ? Thanks.
  14. Sébastien DELCROIX 2013-12-20

    Here is the simplified app : https://github.com/sdelcroix/SimpleButtongridTest You'll find a folder named "Bug Screens" containing some screenshots illustrating the buttongrid behavior after rotations. *Testing environment:* OS: MAC OS X 10.8.5 Ti SDK: 3.2.0.v20131218153242 Ti CLI: 3.2.0-cr3 Alloy: 1.3.0-cr2 (but 1.0 is specified in tiapp.xml) Android SDK 4.2.2 *Test case:* Run this code in Android emulator or Device Rotate this Emulator/Device then button grid will rearrange *Expected Result* Some images randomly disappear and sometimes buttons rearrangement is not working good
  15. Sébastien DELCROIX 2014-01-13

    Any news ?
  16. Lokesh Choudhary 2014-01-31

    The issue is reproducible. Used the simplified app from here : https://github.com/sdelcroix/SimpleButtongridTest Some of the icons disappear, some rearrange while some overlap when orientation is changed from landscape to portrait & viceversa. Environment: Appc Studio : 3.2.1.201401281409 Ti SDK : 3.2.1.v20140130101648 Mac OSX : 10.8.5 Alloy : 1.3.1-cr CLI - 3.2.1 beta3 Samsung Galaxy S4 running android 4.2.2, genymotion emulator 4.1.1 android
  17. Ingo Muschenetz 2014-04-21

    Downgrading priority due to lack of bandwidth.

JSON Source