Skip to content

Instantly share code, notes, and snippets.

@pfn
Created November 13, 2013 16:25
Show Gist options
  • Save pfn/7451900 to your computer and use it in GitHub Desktop.
Save pfn/7451900 to your computer and use it in GitHub Desktop.
Future<Config> config = Feeds.getInstance().getConfig();
Future<Home> homeData = config.flatMap(new Function<Config, Future<Home>>() {
@Override
public Future<Home> apply(Config input) {
return Feeds.getInstance().getHome(input);
}
});
homeData.onSuccess(new Callback<Home>() {
@Override
public void onCallback(Home value) {
long now = System.currentTimeMillis();
if (now - start < SPLASH_TIME) {
new Handler().postDelayed(homeRunner,
SPLASH_TIME - (now - start));
} else {
homeRunner.run();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment