From 09f2f1307d440e7730b2299dfe2c091e093198db Mon Sep 17 00:00:00 2001 From: serso Date: Thu, 29 Jan 2015 19:56:59 +0100 Subject: [PATCH] Skip button is grayed out --- .../android/calculator/wizard/WelcomeWizardStep.java | 1 + .../android/calculator/wizard/WizardFragment.java | 10 +++++++--- android-app/src/main/res/values/colors.xml | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/android-app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java b/android-app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java index 3961107c..ccf492e2 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java @@ -40,6 +40,7 @@ public final class WelcomeWizardStep extends WizardFragment { final View view = super.onCreateView(inflater, container, savedInstanceState); setupNextButton(R.string.wizard_start); setupPrevButton(R.string.wizard_skip); + prevButton.setTextColor(getResources().getColor(R.color.cpp_wizard_disabled_text)); return view; } } diff --git a/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java b/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java index 73e7e899..3b03fce5 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java @@ -14,10 +14,10 @@ import javax.annotation.Nullable; public abstract class WizardFragment extends Fragment implements View.OnClickListener { @Nullable - private TextView nextButton; + protected TextView nextButton; @Nullable - private TextView prevButton; + protected TextView prevButton; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -54,7 +54,7 @@ public abstract class WizardFragment extends Fragment implements View.OnClickLis @Override public void onClick(View v) { final int id = v.getId(); - final WizardActivity activity = (WizardActivity) getActivity(); + final WizardActivity activity = getWizardActivity(); if (id == R.id.wizard_next) { if (activity.canGoNext()) { activity.goNext(); @@ -69,4 +69,8 @@ public abstract class WizardFragment extends Fragment implements View.OnClickLis } } } + + private WizardActivity getWizardActivity() { + return (WizardActivity) getActivity(); + } } diff --git a/android-app/src/main/res/values/colors.xml b/android-app/src/main/res/values/colors.xml index 4f4c0e4e..da064e67 100644 --- a/android-app/src/main/res/values/colors.xml +++ b/android-app/src/main/res/values/colors.xml @@ -43,5 +43,5 @@ #89ffffff #40ffffff - #707070 + #88ffffff \ No newline at end of file