Skip to content

Instantly share code, notes, and snippets.

View blundell's full-sized avatar
😶‍🌫️

Paul Blundell blundell

😶‍🌫️
View GitHub Profile
@blundell
blundell / Otto event bus for Android Notification
Created October 23, 2013 10:46
Otto event bus for Notifications. Really easy to show a notification from an unrelated piece of code. Nice and easy to test. Good use of the bus!
public class ParseNotificationWatcher {
private final ParseNotificationManager notificationManager;
private final NotificationBuilder notificationBuilder;
public ParseNotificationWatcher(ParseNotificationManager notificationManager, NotificationBuilder notificationBuilder) {
this.notificationManager = notificationManager;
this.notificationBuilder = notificationBuilder;
}
@blundell
blundell / Navigator Pattern
Last active December 26, 2015 07:39
Navigator Pattern - not really copy and paste-able. Packages intents for re-use nicely. Helps testing? Redundant now we can use espresso?
public class Navigator {
private final ImplicitNavigator implicitNavigator;
private final ExplicitNavigator explicitNavigator;
private final AccountNavigator accountNavigator;
public Navigator(Activity activity, TescoLoginFacade tescoLoginFacade) {
implicitNavigator = new ImplicitNavigator(activity);
explicitNavigator = new ExplicitNavigator(activity);
accountNavigator = new AccountNavigator(activity, tescoLoginFacade);
println "test"