Introducing Bourbon: Dribbble, Android, MVP and a Common-Code Module

Joe Birch
Joe Birch
May 5, 2016 · 13 min read
Image for post
Image for post

What is Bourbon?

Image for post
Image for post
Image for post
Image for post
Bourbon is Open Source!

But why?

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Browse Dribbble Shots

void showShots(List<Shot> shots);
@Override
public void onSuccess(List<Shot> shots) {
...
if (!shots.isEmpty()) {
getMvpView().showShots(shots);
} else {
...
}
}
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
From Top-Left to Bottom-Right: Mobile, TV, Wear and Tablet

Handling Browse Errors

void showError();
@Override
public void onError(Throwable error) {
...
getMvpView().showError();
...
}
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
From Top-Left to Bottom-Right: Mobile, TV, Wear and Tablet

Handling Browse Empty States

void showEmpty();
@Override
public void onSuccess(List<Shot> shots) {
...
if (!shots.isEmpty()) {
...
} else {
getMvpView().showEmpty();
}
}
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
From Top-Left to Bottom-Right: Mobile, TV, Wear and Tablet

View Shot Detail with Comments

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
From Top-Left to Bottom-Right: Mobile, TV, Wear and Tablet
Image for post
Image for post
Image for post
Image for post
Shot Comments on Wear and TV
void showComments(List<Comment> comments);
@Override
public void onSuccess(List<Comment> comments) {
...
if (comments.isEmpty()) {
getMvpView().showEmptyComments();
} else {
getMvpView().showComments(comments);
}
...
}

Sharing code with a ‘Common’ module

BourbonApplication

Data Models

DataManager

BourbonService

Dagger Injection Components and Modules

Base Presenter and MvpView

BrowseMvpView & BrowsePresenter

ShotMvpView & ShotPresenter

Colors, String & Dimension files

TestDataFactory

Unit Tests


Project Structure

Image for post
Image for post

Browse Screen Structure

Image for post
Image for post

Testing Bourbon

Unit Tests

Instrumentation Tests

What’s next for Bourbon?

Conclusion

Exploring Android

Deep dives + how-to articles for the latest android…

Joe Birch

Written by

Joe Birch

Android Engineering Lead at Buffer, Google Developer Expert for Android & Flutter - Passionate about mobile development and learning. www.joebirch.co

Exploring Android

Deep dives + how-to articles for the latest android platform features

Joe Birch

Written by

Joe Birch

Android Engineering Lead at Buffer, Google Developer Expert for Android & Flutter - Passionate about mobile development and learning. www.joebirch.co

Exploring Android

Deep dives + how-to articles for the latest android platform features

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store