BetterScreens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class GoalSummary extends Activity | |
{ | |
@Inject | |
GoalSummaryScreen summary | |
onCreate(){ | |
loadModule | |
if(summary.allowGoToScreen) | |
goToScreen(summary.createScreen()) | |
} | |
private void goToScreen(Screen newScreen) | |
{ | |
//animate old screen leaving | |
//animate new screen creation | |
Backstack.addToBackstack(newScreen); | |
Backstack.showCurrent(); | |
} | |
public onBackPressed() | |
{ | |
goToScreen(Backstack.getPreviousScreen()) | |
} | |
} | |
Class GoalSummaryScreen extend GoalSummaryHeader | |
{ | |
@Inject StoreManager manager | |
createScreen() | |
{ | |
inflateView() | |
manager.getModelStore.getNetwork() | |
return this; | |
} | |
public void inflateView() | |
{ | |
super() | |
this.addView(activity.getLayoutInflator(R.id.myView)) | |
bindDataToView() | |
} | |
@Override | |
public void bindDataToView() | |
{ | |
//bind data from module | |
// | |
} | |
modelOnnext() | |
{ | |
//bind some data | |
} | |
accountOnNext | |
{ | |
//bind some data | |
} | |
@onClick(R.id.save) | |
{ | |
doSomething | |
} | |
public void goBack() | |
{ | |
} | |
} | |
Class GoalsModule | |
{ | |
String accountId; | |
getValuesFromIntent() | |
{ | |
accountid=intent.get("accountId"); | |
} | |
provideStoreManager(ModelStore modelStore, AccountStore accountStore) | |
{ | |
return new StoreManager() | |
.withAccountStore(accountStore) | |
.withModelStore(modelStore) | |
} | |
} | |
Activity | |
GoalSummaryDetail | |
GoalSummaryHeaderView | |
GoalSummaryDetailView | |
GoalsActivity | |
summaryScreen extends MyTabBarView (can also contain actionBar) | |
goToScreen(transferScreen) | |
transferScreen extends MyTabBarView | |
goToScreen(portfolioScreen) | |
portfolioScreen extends MyTabBarView | |
have access to anything on the window | |
MyTabBarView extends ViewPager ->onTabSelected (goToScreen()) | |
transferScreen | |
portfolioScreen | |
activityScreen | |
TaxImpactActivity | |
onCreate(goTo(confirmationScreen) | |
confirmationScreen extend Header | |
onNext -> goTo(listScreen) //animate | |
onBack -> goToLastActivity //animate | |
listScreen extend Header | |
onNext -> goTo(detailScreen) //animate | |
onBack ->goTo(summaryScreen) //animate | |
detailScreen extend Header | |
onBack ->goTo(listScreen) //animate | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment