Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20461] iPad: Events fired by Slide Over and Split Window not clear/documented

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-03-05T15:13:45.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sRelease 5.4.0
ComponentsiOS
Labelsqe-5.4.0, splitview
ReporterFokke Zandbergen
AssigneeAngel Petkov
Created2016-02-25T11:21:48.000+0000
Updated2016-08-09T20:47:28.000+0000

Description

With TIMOB-19691 we have added support for Split View and Slide Over. When the app Slides Over or changes to/from Split View, the Ti.App:resumed and in one occasion Ti.App:resume events are fired. We have not documented this, but I'm filing this in TIMOB because we might want to find out if there are ways/reasons we should split this out into specific events for Split View and Slide Over. For a list of events in which resume and resumed are fired see the 5.2.0 Sample Source: https://github.com/appcelerator-developer-relations/appc-sample-ti520/blob/master/app/alloy.js#L37-L55 The resumed event actually covers pretty much all scenarios, except for one AFAIK. When your app is on the left side of a Split View and moves back to fullscreen because the other app closes or switches to Slide Over you will not get notified. It would be great if we can somehow detect this as well.

Comments

  1. Fokke Zandbergen 2016-02-25

    /cc [~bimmel]
  2. Fokke Zandbergen 2016-02-25

    Also see http://www.appcelerator.com/blog/2016/02/titanium-5-2-0-launch-files-ipad-pro-slide-over-and-split-view/
  3. Chee Kiat Ng 2016-02-26

    I'm not even sure if we can split this out into specific events. If not, we should open a docs ticket to document the current behavior. [~apetkov] can you investigate please?
  4. Angel Petkov 2016-02-29

    [~fokkezb] The resumed event will get fired every time we modify the application, be it from sliding it left to right or any other instance where we are invoking it.We could check if we can add a message to the event to display what caused the event to get fired ? Other than that I'm not quite sure what you mean. Could you elaborate please ? Thanks!
  5. Fokke Zandbergen 2016-03-01

    [~apetkov] It does except for one: > The resumed event actually covers pretty much all scenarios, except for one AFAIK. When your app is on the left side of a Split View and moves back to fullscreen because the other app closes or switches to Slide Over you will not get notified. It would be great if we can somehow detect this as well. Can we catch that case as well? Then I don't think we need much else then documenting the resumed event is indeed what you need to listen for.
  6. Angel Petkov 2016-03-02

    [~fokkezb] Hey Fokke I'm not able to re-produce a way to miss the resumed event. I tried opening the app from the right side while contacts is open , dragging it backwards and forwards which causes the event to be called.Dragging it all the way to the left to gain all focus. Then while the app is now full screened pulled contacts from the right, backwards and forwards the event was still being called. I slided the contacts all the way to the right until the app gained full screen again in which the resumed was called again. Updated docs, PR :https://github.com/appcelerator/titanium_mobile/pull/7799. [~bimmel] Could you please review the PR.
       
       var win = Titanium.UI.createWindow({
       	title:'Window',
       	backgroundColor:'white'
       });
       
       var smpLabel = Ti.UI.createLabel({
         color:'blue',
         text: 'The one and only label',
         textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
         top: 30,
         width: 100, height: 100
       });
       var i = 0;
       
       Titanium.App.addEventListener('resumed',function(e){
       	Ti.API.info("Appliication RESUMED" + i);
       	i++;
       });
       
       
       win.add(smpLabel);
       win.open();
       
  7. Fokke Zandbergen 2016-03-03

    [~apetkov] to see the missed event: 1. Open the test app 2. Open contacts as slide over 3. Tap the devider to switch to split view (you get resumed event) 4. Tap the devider to switch contacts back to slide over (you don't get resumed event) This can be problematic because with step 4 your app *does* resize, so when you have no event to listen to you can not undo any UI changes you did to accommodate split view.
  8. Angel Petkov 2016-03-04

    [~fokkezb] Ah yeah was able to re-produce it now , thanks for the instructions! The reason the resumed event doesn't get called in that case is because the app is paused , it hasn't resumed yet which is why is darked out. Its running in the background effectively on pause. If you listen for the *pause* event , it gets called soon as the app gets put in the background , ones you tap or slide the application the resumed event will be called straight away. Updated PR by adding documentation to the pause event.
  9. Fokke Zandbergen 2016-03-04

    Thanks [~apetkov], you right. I updated the sample to describe the role of pause and paused: https://github.com/appcelerator-developer-relations/appc-sample-ti520/blob/master/app/controllers/index.js#L133-L139 I also left some notes on the PR. I think we need to add paused and clarify pause a bit more using what I have at the above URL.
  10. Angel Petkov 2016-03-04

    I've updated the PR to match your feedback , ill add the more clear description to match the one in your sample app. For both paused and pause so one can better differentiate from the other.
  11. Hans Knöchel 2016-03-05

    PR approved! Anyway, I agree with Fokke that we should think about specific events for splitviews to ease the client-side handling of those different events. [~fokkezb], naming suggestions, maybe in a new ticket for further discussions?
  12. Fokke Zandbergen 2016-03-07

    As [~cng] mentioned, it's unlikely that we can detect the reason of the resume(d) or pause(d).
  13. Harry Bryant 2016-08-09

    Verified as fixed, documentation has been updated accordingly. Tested On: iPad Pro (9.3.1) Mac OSX El Capitan 10.11.6 Ti SDK: 5.4.0.v20160809033140 Appc Studio: 4.7.0.201607250649 Appc NPM: 4.2.7 App CLI: 5.4.0-40 Xcode 7.3.1 Node v4.4.7 *Closing ticket.*

JSON Source