Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11571] Android: opening a modal window from another modal shows a flickering transition

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-12-14T01:07:10.000+0000
Affected Version/sn/a
Fix Version/s2012 Sprint 25, 2012 Sprint 25 Core
ComponentsAndroid
LabelsSupportTeam
ReporterDavide Cassenti
AssigneeIngo Muschenetz
Created2012-10-24T23:09:59.000+0000
Updated2013-11-07T18:28:39.000+0000

Description

Description problem

Opening a modal window from another modal shows a flickering transition; the problem is not happening all the times, but almost (I'd say more than 90%).

Steps to reproduce

- Create an app with this code:
var num = 1;
function createWin() {
    var win = Ti.UI.createWindow({
        backgroundColor: 'black',
        modal: true
    });
    
    var image = Ti.UI.createImageView({
        image: '/images/' + (num++ % 3 + 1) + '.jpg',
        top: 10,
        left: 10,
        width: 300,
        height: 200
    });
    
    win.add(image);
    
    var button = Ti.UI.createButton({
        title: "Next",
        top: 300
    });
    
    button.addEventListener('click', createWin);
    
    win.add(button);
    
    win.open();
}

createWin();
- Put 3 different images in the Resources/images directory (I set 300x200) - Run the app and click Next: most of the times the next window is shown for a fraction of second, then the current window is shown again before the second is fully opened (e.g. you see a flickering effect).

Additional notes

The problem does not happen with lightweight windows, but in that case the back button wouldn't work; if modal is set to false, the problem does not happen as well, but the animation of the opening window is not so nice as well.

Comments

  1. Davide Cassenti 2012-10-29

    I noticed that, adding "opacity: 0" to the window properties, this problem does not occour; however, in that case you see through the window, so you have to add another view to "simulate" the background, which is not ideal at all.
  2. Taka Torimoto 2012-10-29

    Thanks for that suggestion Davide - yes that workaround works for now (I have to attach a view with a background color set - in my case, to white - for each Window created). The screen switching (if you sit there going back and forth) seems noticeably slower with this workaround. Also - if you go back and forth fast - it does seem to go into a weird state (probably related to the Runtime Error I would get previously with a completely blank "white" window) that said: Runtime Error Location: [425,15] ti:/window.js Message: Uncaught TypeError: Cannot call method 'add' of null Source: this.view.add(this._children[i]); I'm using Mobile SDK 2.1.3
  3. Taka Torimoto 2012-10-29

    Sorry - let me reword that one sentence: Also - if you go back and forth fast - it does seem to go into a weird state where it seems to show an "invisible" window (with a cursor stuck NON-blinking on a field on the current window) that you can "escape" from by pressing the BACK button... probably related to the Runtime Error I used to get previously with a completely blank "white" window that said:
  4. Allen Yeung 2012-12-14

    I've tried this on 2.3, 3.0, 4.1 devices with 2.1.3GA/3.0.0 Titanium SDK and I can't reproduce the flicker mentioned. I'm going to mark this as cannot reproduce until we get more information regarding the pictures used / or further information.
  5. Anshu Mittal 2013-05-10

    Tested with: SDK:3.1.1.v20130509173053 Appcelerator Studio: 3.1.1.201305091152 OS: OSX 10.7.5 Device: Nexus7(4.1), Android emulator 2.3.3 Cannot reproduce

JSON Source