Skip button is grayed out

This commit is contained in:
serso 2015-01-29 19:56:59 +01:00
parent 23bb75d37b
commit 09f2f1307d
3 changed files with 9 additions and 4 deletions

View File

@ -40,6 +40,7 @@ public final class WelcomeWizardStep extends WizardFragment {
final View view = super.onCreateView(inflater, container, savedInstanceState); final View view = super.onCreateView(inflater, container, savedInstanceState);
setupNextButton(R.string.wizard_start); setupNextButton(R.string.wizard_start);
setupPrevButton(R.string.wizard_skip); setupPrevButton(R.string.wizard_skip);
prevButton.setTextColor(getResources().getColor(R.color.cpp_wizard_disabled_text));
return view; return view;
} }
} }

View File

@ -14,10 +14,10 @@ import javax.annotation.Nullable;
public abstract class WizardFragment extends Fragment implements View.OnClickListener { public abstract class WizardFragment extends Fragment implements View.OnClickListener {
@Nullable @Nullable
private TextView nextButton; protected TextView nextButton;
@Nullable @Nullable
private TextView prevButton; protected TextView prevButton;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -54,7 +54,7 @@ public abstract class WizardFragment extends Fragment implements View.OnClickLis
@Override @Override
public void onClick(View v) { public void onClick(View v) {
final int id = v.getId(); final int id = v.getId();
final WizardActivity activity = (WizardActivity) getActivity(); final WizardActivity activity = getWizardActivity();
if (id == R.id.wizard_next) { if (id == R.id.wizard_next) {
if (activity.canGoNext()) { if (activity.canGoNext()) {
activity.goNext(); activity.goNext();
@ -69,4 +69,8 @@ public abstract class WizardFragment extends Fragment implements View.OnClickLis
} }
} }
} }
private WizardActivity getWizardActivity() {
return (WizardActivity) getActivity();
}
} }

View File

@ -43,5 +43,5 @@
<color name="cpp_text_secondary">#89ffffff</color> <color name="cpp_text_secondary">#89ffffff</color>
<color name="cpp_widget_ripple">#40ffffff</color> <color name="cpp_widget_ripple">#40ffffff</color>
<color name="cpp_wizard_text">#707070</color> <color name="cpp_wizard_disabled_text">#88ffffff</color>
</resources> </resources>