Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25678] Android: Amend hasActivityTransitions() for transitions #9740

Merged
merged 5 commits into from Oct 25, 2018

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Jan 16, 2018

  • Fix hasActivityTransitions() to allow transitions when a sharedElement has not been specified
TEST CASE
var win = Ti.UI.createWindow({
        backgroundColor: 'blue',
        layout: 'vertical'
    }),
    lbl = Ti.UI.createLabel({
        left: 5,
        text: 'TEST LABEL',
        transitionName: 'lbl'
    }),
    btn = Ti.UI.createButton({
        title: 'OPEN'
    });

btn.addEventListener('click', function () {
    var win2 = Ti.UI.createWindow({
            backgroundColor: 'red',
            layout: 'vertical',
            activityEnterTransition: Titanium.UI.Android.TRANSITION_SLIDE_RIGHT
        }),
        lbl2 = Ti.UI.createLabel({
            right: 5,
            text: 'TEST LABEL',
            transitionName: 'lbl'
        }),
        btn2 = Ti.UI.createButton({
            title: 'CLOSE'
        });

    btn2.addEventListener('click', function () {
        win2.close();
    });

    win2.add([lbl2, btn2]);
    // win2.addSharedElement(lbl, 'lbl'); // this should not need uncommenting to see a Window transition

    win2.open();
});

win.add([lbl, btn]);
win.open();

JIRA Ticket

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

@hansemannn
Copy link
Collaborator

@garymathews Jenkins still crashes during unit-tests. For this build, it looks like viewSizeAndRectPx crashes the app:


[INFO] : �� � !TEST_START: viewSizeAndRectPx

[ERROR] : �� �Surface: getSlotFromBufferLocked: unknown buffer: 0xa09e10e0

[ERROR] : �� �Surface: getSlotFromBufferLocked: unknown buffer: 0xa09e1680

[INFO] : �� � art: Starting a blocking GC HeapTrim

Sending interrupt signal to process

-- End application log -------------------------------------------------------

@hansemannn hansemannn modified the milestones: 7.4.0, 7.5.0 Aug 24, 2018
@lokeshchdhry
Copy link
Contributor

@garymathews, the window transition does not work on Android 4.1 with or without using win2.addSharedElement(lbl, 'lbl'); & its not just with this fix but with older SDK as well.

@sgtcoolguy
Copy link
Contributor

This is consistently crashing on the CI builds:


[INFO] : �� � !TEST_START: PlainPicker change event
[INFO] : �� � Choreographer: Skipped 37 frames!  The application may be doing too much work on its main thread.
[ERROR] : �� �Surface: getSlotFromBufferLocked: unknown buffer: 0x9fda1980
[ERROR] : �� �Surface: getSlotFromBufferLocked: unknown buffer: 0x9fd9f720
[ERROR] : �� �TiExceptionHandler: (main) [3706,163285]
[ERROR] : �� �TiExceptionHandler:     android.app.EnterTransitionCoordinator.allowOverlappingTransitions(EnterTransitionCoordinator.java:597)
[ERROR] : �� �TiExceptionHandler:     android.app.EnterTransitionCoordinator.sendSharedElementDestination(EnterTransitionCoordinator.java:177)
[ERROR] : �� �TiExceptionHandler:     android.app.EnterTransitionCoordinator.viewsReady(EnterTransitionCoordinator.java:120)
[ERROR] : �� �TiExceptionHandler:     android.app.EnterTransitionCoordinator$2.onPreDraw(EnterTransitionCoordinator.java:145)
[ERROR] : �� �TiExceptionHandler:     android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
[ERROR] : �� �TiExceptionHandler:     android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2055)
[ERROR] : �� �TiExceptionHandler:     android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
[ERROR] : �� �TiExceptionHandler:     android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
[ERROR] : �� �TiExceptionHandler:     android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
[ERROR] : �� �TiExceptionHandler:     android.view.Choreographer.doCallbacks(Choreographer.java:670)
[ERROR] : �� �TiExceptionHandler:     android.view.Choreographer.doFrame(Choreographer.java:606)
[ERROR] : �� �TiExceptionHandler:     android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
[ERROR] : �� �TiExceptionHandler:     android.os.Handler.handleCallback(Handler.java:739)
[ERROR] : �� �TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR] : �� �TiExceptionHandler:     android.os.Looper.loop(Looper.java:148)
[ERROR] : �� �TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:5417)
[ERROR] : �� �TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] : �� �TiExceptionHandler:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] : �� �TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

@longton95
Copy link
Contributor

@garymathews I am only seeing the transition if win2.addSharedElement(lbl, 'lbl'); is uncommented

@garymathews
Copy link
Contributor Author

@longton95 Forgot one of my changes; try now?

@garymathews
Copy link
Contributor Author

garymathews commented Oct 17, 2018

@longton95 I realized that my comment in the test case was unclear, you need the addSharedElement to see the label transition. But you should not need the addSharedElement to see the Window transition.

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Oct 19, 2018

@garymathews , When I run on Android 4.1 I see:

[ERROR] :  [Android SDK built for x86] TiExceptionHandler: (main) [155,155] ti:/window.js:76
[ERROR] :  [Android SDK built for x86] TiExceptionHandler: 		_open.call(this, options);
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:         ^
[ERROR] :  [Android SDK built for x86] TiExceptionHandler: Error: android.app.ActivityOptions.makeBasic
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at Window.open (ti:/window.js:76:9)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at /app.js:40:5
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at Module._runScript (ti:/module.js:613:9)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at Module.load (ti:/module.js:105:7)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at Module.loadJavascriptText (ti:/module.js:457:9)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at Module.loadAsFile (ti:/module.js:512:15)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at Module.loadAsFileOrDirectory (ti:/module.js:429:20)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at Module.require (ti:/module.js:256:17)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at require (ti:/module.js:570:15)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     at /ti.main.js:27:3
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiWindowProxy.createActivityOptionsBundle(TiWindowProxy.java:516)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:165)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiWindowProxy.open(TiWindowProxy.java:154)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     ti.modules.titanium.ui.WindowProxy.open(WindowProxy.java:125)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:180)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:247)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:135)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:190)
[ERROR] :  [Android SDK built for x86] TiExceptionHandler:     org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:185)
[ERROR] :  [Android SDK built for x86] V8Exception: Exception occurred at ti:/window.js:76: Uncaught Error: android.app.ActivityOptions.makeBasic

Also, I see the window & label transition with win2.addSharedElement(lbl, 'lbl'); uncommented (i.e present). But, I don't see the window transition with it commented (i.e not present).

@garymathews
Copy link
Contributor Author

@lokeshchdhry Updated PR

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Oct 22, 2018

@garymathews , Without win2.addSharedElement(lbl, 'lbl');. I still don't see the window transition on all android versions. But with win2.addSharedElement(lbl, 'lbl'); I see both window & label transition.

@lokeshchdhry
Copy link
Contributor

FR Passed.

Transitions works as expected when sharedElement has not been specified.

FYI : Transitions are not supported on Android 4.1

Studio Ver: 5.1.2.201810080801
SDK Ver: 7.5.0 local build
OS Ver: 10.14
Xcode Ver: Xcode 10.0
Appc NPM: 4.2.14-2
Appc CLI: 7.0.7-master.9
Daemon Ver: 1.1.3
Ti CLI Ver: 5.1.1
Alloy Ver: 1.13.3
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 10.0.2
Devices: ⇨ google Nexus 5 (Android 6.0.1)
⇨ google Pixel (Android 9)
Emulator: ⇨ Android 4.1.2

@build
Copy link
Contributor

build commented Oct 24, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@lokeshchdhry lokeshchdhry merged commit a36557c into tidev:master Oct 25, 2018
garymathews added a commit that referenced this pull request Oct 26, 2018
eric34 pushed a commit that referenced this pull request Oct 26, 2018
…nsitions" (#10404)

* Revert "[TIMOB-26491] Update ti.cloudpush to 3.2.0 (#10403)"

This reverts commit c77b295.

* Revert "[TIMOB-26484] Android: Added "sound" support to NotificationChannel (#10400)"

This reverts commit 24ece5b.

* Revert "[TIMOB-25678] Android: Amend hasActivityTransitions() for transitions (#9740)"

This reverts commit a36557c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants