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

Remove fragments #3

Merged
merged 18 commits into from
Apr 10, 2016
Merged

Remove fragments #3

merged 18 commits into from
Apr 10, 2016

Conversation

Sloy
Copy link
Owner

@Sloy Sloy commented Apr 10, 2016

Well, not all of them... for now.

I removed the fragments composing the main screen (which is itself a fragment!!).
I replaced them with presenters and view containers (to decompose the responsibility in the MainPageFragment, where the actual view lives).

In the process I created a Rx LocationProvider to use from the fragments.
I also created flavors, one for Sevilla and another for Barcelona. This doesn't mean that SeviBus supports Barcelona, it's only a flavor with a different database created with the same data from Sevilla, but moved in the map to Barcelona. This way I can test the location features without mocking anything. We'll use a better solution someday.

Sloy added 18 commits April 5, 2016 22:13
Elimina la lógica de presentación del presenter de favoritas y delega el comportamiento al presenter.
De paso añado ButterKnife para ir quitando mierda.
Now its a view inside MainPageFragment.
To avoid having too much noise there I've extracted all the View related stuff to a different class.
This way we can provide a dependency that notifies about location updates via RxJava.
It's implemented using a BehaviourSubject to emit the last item to new subscriptions.
Now we are a bit more decoupled from the activity and the location source.
No, this doesn't mean sevibus supports Barcelona now. It's just the same database from Sevilla, located over Barcelona in the map.
Si la montaña no va a Mahoma...

Update Travis file with flavor
This action provides nearby bus stops based on a given location.
I created a ParadaCercana which contains the pair of a Parada and distance. This is just to ease the usage of the action from the view layer.
Created a presenter for displaying nearby stops in the main page. Replaced the old fragment with presenter + view container. Hey!
This is not going well. Let's disable it since we have the "barna" flavor, and maybe in the future mock the location properly.
LocationProvides now returns optional of location, so we can pass null and get an absent value when the location is not available. Needs some improvement on UX, but at least we are in the same spot as before.

Y had to decompose the subscription in the presenter in two steps, one for the location and another one for the nearby stops.
Modified the model a bit to allow setting line type from constructor, and changing the comparator of lines to fallback to the line's name instead of the type's, which looks like an error.
It's just a wrapper of DBQueries for now
@Sloy
Copy link
Owner Author

Sloy commented Apr 10, 2016

Yup, Github orders chronologically instead of by parent. I rebased my branch and reordered commits, so it's now messed up.

@Sloy Sloy merged commit 367e84b into develop Apr 10, 2016
@Sloy Sloy deleted the feature/remove-fragments branch April 10, 2016 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant