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).
Can you please attach a complete application that shows the problem?
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.
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.3Test 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
ThanksAny news about it ?
We can't seem to reproduce the issue using your code. See above.
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.
{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.
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:
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 ?
Can you please let us know what native integrations are required?
Sorry to say that, but I don't understand your question Ingo. Can you please explain what you mean by "native integrations" ? Thanks.
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.
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.
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
Any news ?
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
Downgrading priority due to lack of bandwidth.