Questions tagged [square-flow]

Flow is a small library that helps with describing an Android application as a collection of moderately independent screens.

21 questions
16
votes
2 answers

Mortar + Flow with third party libraries hooked to activity lifecycle

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…
secureboot
  • 1,776
  • 4
  • 20
  • 32
11
votes
1 answer

Square Flow + Mortar tablet examples

I've been experimenting with using flow and mortar as an alternative architecture for our Android apps. I've been working on an app which at the minute is only a single phone layout, but I was wondering how the flow and mortar architecture might…
matto1990
  • 3,766
  • 2
  • 27
  • 32
8
votes
1 answer

Writing Tests for Flow and Mortar Apps

I was wondering if there were any examples of writing unit tests for Flow and Mortar Android apps. Part of the advantage of the MVP pattern that it offers the split of the presentation and view logic, and the presentation logic is what you want to…
spierce7
  • 14,797
  • 13
  • 65
  • 106
7
votes
1 answer

Recommended way to get Activity inside Mortar screen?

I am using Mortar and Flow to power my app. If I have the following View: public class MyView extends LinearLayout { @Inject MyScreen.Presenter presenter; private EditText someText; public MyView(Context context) { super(context); …
user4386126
  • 1,205
  • 5
  • 17
  • 32
6
votes
1 answer

Mortar and Flow libraries vs. ViewPager

I'm trying to adapt Mortar&Flow in my app and faced with an issue, that I can't make PageAdapter works with Screens, instead of Fragments. Anyone managed to get it right? I didn't succeed but, probably someone can guide me from this point: The…
Konstantin Loginov
  • 15,802
  • 5
  • 58
  • 95
6
votes
1 answer

What does Square mean by 'offscreen fragments being brought back to life' and 'no direct control over animations'?

While discovering Android libraries and frameworks, I came across Square's blog post on Flow and Mortar. The author states that some of the motivations for developing Flow and Mortar was because ... Offscreen fragments mysteriously being brought…
Some Noob Student
  • 14,186
  • 13
  • 65
  • 103
5
votes
0 answers

Sub containers in Flow

Is there documentation on how to construct sub containers within flow? For example, I have a Master, a Detail view. I intend to add a popup view which will have it's own backstack. The popup will function as a wizard asking the user to complete…
redDragonzz
  • 1,543
  • 2
  • 15
  • 33
5
votes
4 answers

Using Flow & Mortar with ViewPager

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…
yasith
  • 8,981
  • 7
  • 27
  • 32
5
votes
1 answer

How to @Provide an Activity for the MortarActivityScope, without leaking the Activity on orientation changes?

I have a Mortar application, with a MortarActivityScope as the first child under the root scope. The MortarActivityScope has an ActivityScope which @Provides an activity for injected classes: @Module(addsTo = ApplicationModule.class, injects =…
weefbellington
  • 302
  • 3
  • 8
5
votes
1 answer

Getting user input from a dialog using Mortar + Flow

I'm build my app with Mortar + Flow. I'm trying to figure out the correct way to show a popup that requests some text from the user. I've created this popup class: public class SavedPageTitleInputPopup implements Popup
Edward Dale
  • 29,597
  • 13
  • 90
  • 129
4
votes
0 answers

Can Flow and Mortar load a screen in the background if it is slow to load (e.g. GoogleMap)?

I am having trouble with certain pages in an Android app loading slowly. I have fixed many by pushing the slow parts into services that preempt the user's requirements. I am struggling with GoogleMaps, which are slow to load at around 5 seconds on…
TTransmit
  • 3,270
  • 2
  • 28
  • 43
4
votes
1 answer

Equivalent of onActivityResult for Mortar and Flow?

I'm looking for a way to return a result from a Screen using Flow without losing what's been built up in the previous Screen, similar to what I'd do with onActivityResult. For example here's a screen where I'm creating a new…
kuhnza
  • 731
  • 1
  • 5
  • 15
3
votes
1 answer

How to work with view subcontainers in Flow

what is the intended way to tackle subcontainer navigation with Flow on Android. Let's say I have a couple of Screens where one works like a container screen itself - there I want to do some subnavigation (changing part of this screen). I guess the…
simekadam
  • 7,334
  • 11
  • 56
  • 79
3
votes
0 answers

Mortar / Flow save view and presenter in backstack

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…
lukasz
  • 3,121
  • 1
  • 21
  • 20
1
vote
0 answers

How to switch layouts back and forth using Square's flow library?

I am trying to use Square's flow library to make a very simple app. The idea is that clicking a FAB will switch the screen from blue to red. Clicking the FAB again will cause it to go back to blue. So my code for FAB's click handler looks like…
An SO User
  • 24,612
  • 35
  • 133
  • 221
1
2