Android Open Source - Android-Wizard-Framework Instructions






From Project

Back to project page Android-Wizard-Framework.

License

The source code is released under:

MIT License

If you think the Android project Android-Wizard-Framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hps.wizard.sample.states;
/*from w ww  .j  a va  2  s  . c  om*/
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.hps.wizard.StateFragment;
import com.hps.wizard.sample.R;

/**
 * Nothing really special here except that the name supplied in the arguments is used to build the title.
 */
public class Instructions extends StateFragment {

  public static final String NAME_ARG = "name";

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View v = inflater.inflate(R.layout.fragment_state_instructions, container, false);

    TextView tv = (TextView) v.findViewById(R.id.textView);
    CharSequence styledText = Html.fromHtml(getString(R.string.nice_html_instructions));
    tv.setText(styledText);

    return v;
  }

  @Override
  public String getTitle() {
    /**
     * Get the name from the state's arguments.
     */
    return "Hi " + getArguments().getString(NAME_ARG) + "!";
  }

  @Override
  public String getPreviousButtonLabel() {
    return null;
  }

  @Override
  public StateDefinition getNextState() {
    /**
     * When they move to the next state, clear out any prior test results.
     */
    SharedPreferences prefs = getWizardActivity().getSharedPreferences("answers", Context.MODE_PRIVATE);
    prefs.edit().clear().commit();

    /**
     * The next state is always BackgroundValidation.
     */
    StateDefinition def = new StateDefinition(BackgroundValidation.class, null);

    return def;
  }

}




Java Source Code List

com.hps.wizard.AbstractWizardActivity.java
com.hps.wizard.StateFragment.java
com.hps.wizard.TaskCallback.java
com.hps.wizard.TaskFragment.java
com.hps.wizard.ValidationAsyncTask.java
com.hps.wizard.WizardActivity.java
com.hps.wizard.WizardDialog.java
com.hps.wizard.sample.activities.MainActivity.java
com.hps.wizard.sample.states.AreYouSure.java
com.hps.wizard.sample.states.BackgroundValidation.java
com.hps.wizard.sample.states.Choice.java
com.hps.wizard.sample.states.Instructions.java
com.hps.wizard.sample.states.MuppetShow.java
com.hps.wizard.sample.states.Results.java
com.hps.wizard.sample.states.SesameStreet.java
com.hps.wizard.sample.states.Seuss.java