square-flow

Mortar / Flow save view and presenter in backstack

纵饮孤独 提交于 2019-12-12 16:18:36
问题 I'm playing with Mortar / Flow / Dagger2. My app has 2 screens : Screen 1 shows a Google map. I'm using directly the MapView object rather than the MapFragment, and I hooked it properly to the root activity lifecycle events. Screen 2 shows some info from a map marker. We go from screen 1 to screen 2 through Flow.get(context).goTo(new Screen2()); The problem is that when I come back from screen 2 to screen 1, using Flow.get(context).goBack(); , the screen 1 and its MapView are recreated from

Using Flow & Mortar with ViewPager

北慕城南 提交于 2019-12-07 04:48:16
问题 I'm in the process of writing an app using Flow and Mortar. I'm having trouble figuring out how to use this when it comes to a view pager with tabs. Only way I can think of is to treat the ViewPager screen as a single screen, and end up using Fragments to build it. But the whole point of using Flow & Mortar is to get rid of Fragments and simplify the lifecycle. Any help is appreciated. Thanks. 回答1: I made a view pager example, up to date with Mortar and Flow versions (based on adapter from

Mortar + Flow with third party libraries hooked to activity lifecycle

与世无争的帅哥 提交于 2019-12-04 07:44:08
问题 Some third party libraries use hooks into the activity lifecycle to work correctly - for instance, the Facebook SDK (https://developers.facebook.com/docs/android/login-with-facebook/). I'm having some trouble figuring out how to reconcile this model cleanly with a single-activity flow+mortar setup. For instance, if I want to use Facebook login as part of a login Flow (w/ FlowView/FlowOwner), but not otherwise in the activity, what's the smartest way to pull this off if you need hooks for that

Mortar + Flow with third party libraries hooked to activity lifecycle

て烟熏妆下的殇ゞ 提交于 2019-12-02 17:11:50
Some third party libraries use hooks into the activity lifecycle to work correctly - for instance, the Facebook SDK ( https://developers.facebook.com/docs/android/login-with-facebook/ ). I'm having some trouble figuring out how to reconcile this model cleanly with a single-activity flow+mortar setup. For instance, if I want to use Facebook login as part of a login Flow (w/ FlowView/FlowOwner), but not otherwise in the activity, what's the smartest way to pull this off if you need hooks for that particular flow in onCreate, onResume, onPause, onDestroy, onSaveInstanceState, onActivityResult,