method extracted

This commit is contained in:
Sergey Solovyev 2013-06-25 23:08:01 +04:00
parent 6c578d7d09
commit bba654f378

View File

@ -86,10 +86,29 @@ public final class CalculatorWizardActivity extends SherlockFragmentActivity {
initTitle();
initNextButton();
initFinishButton();
initPrevButton();
}
}
private void initFinishButton() {
final WizardStep nextStep = flow.getNextStep(step);
if (nextStep == null) {
finishButton.setVisibility(VISIBLE);
finishButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tryGoNext()) {
finishFlow();
}
}
});
} else {
finishButton.setVisibility(GONE);
finishButton.setOnClickListener(null);
}
}
private void initTitle() {
setTitle(step.getTitleResId());
}
@ -115,22 +134,9 @@ public final class CalculatorWizardActivity extends SherlockFragmentActivity {
private void initNextButton() {
final WizardStep nextStep = flow.getNextStep(step);
if (nextStep == null) {
finishButton.setVisibility(VISIBLE);
finishButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (tryGoNext()) {
finishFlow();
}
}
});
nextButton.setVisibility(GONE);
nextButton.setOnClickListener(null);
} else {
finishButton.setVisibility(GONE);
finishButton.setOnClickListener(null);
nextButton.setVisibility(VISIBLE);
nextButton.setOnClickListener(new View.OnClickListener() {
@Override