Search code examples
androidandroid-holo-everywhere

HoloEverywhere's SlidingMenu & transitioning between activities


I am using HoloEverywhere + ActionBar Sherlock + HoloEverywhere's sliding menu addon. When clicking an item in the sliding menu, I start various activities.

My problem is to implement what Cyril Mottier talks about in his article about Prixing's SlidingMenu: - overriding activity transitions (that's the easy part) - saving/restoring the menu state between activities (that's what I can't manage to do): currently the menu disappears and it does not feel right. I would like to save the menu state and when the next activity starts, restore that state (and animate the close of the menu for instance)

Cyril talks about using the view's saveHierarchyState, ...:

The Activity transition in the Prixing application relies on the exact same technique the Android framework uses to restore an Activity after it has been destroyed in low memory conditions. As a result, everytime a new Activity needs to be opened, we save the the interesting part of the current UI state using View#onSaveInstanceState()/View#saveHierarchyState(SparseArray<Parcelable>) and re-apply it to the newly created Activity thanks to View#onRestoreInstanceState(Parcelable)/View#restoreHierarchyState(SparseArray<Parcelable>)

However I have trouble seeing how to implement that? Would anyone have any clue?

My activities all inherit from a base activity class which keeps its instance of the sliding menu.


Solution

  • See SlidingMenu issue

    You can update code from the last version of SlidingMenu to same module of HoloEverywhere. Or wait 1.4.3, where this module will be updated by me.