Android Open Source - Tasque-for-Android Tutorial Tab Fragment






From Project

Back to project page Tasque-for-Android.

License

The source code is released under:

MIT License

If you think the Android project Tasque-for-Android 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.bustiblelemons.tasque.tutorial;
/*from  w w w.  j a  v  a2  s  . c o m*/
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.widget.TextView;

import com.actionbarsherlock.app.SherlockFragment;
import com.bustiblelemons.tasque.R;

/**
 * Created 10 Jun 2013
 */
public class TutorialTabFragment extends SherlockFragment implements OnTouchListener {

  private Bundle args;
  private int os_type;
  private int step;
  static String STEP = "step";
  public static String OS_TYPE = "os_type";
  private View view;

  static final int STEP_ONE = 1;
  static final int STEP_TWO = 2;
  static final int STEP_THREE = 3;

  private TextView hint;
  private TextView explanation;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    args = getArguments();
    step = args.getInt(STEP);
    os_type = args.getInt(OS_TYPE);
    setRetainInstance(true);
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.fragment_tutorial_step, null);
    hint = (TextView) view.findViewById(R.id.synchronize_step_hint);
    explanation = (TextView) view.findViewById(R.id.synchronize_step_explanation);
    switch (step) {
    case STEP_ONE:
      hint.setText(R.string.tutorial_step_one_hint);
      break;
    case STEP_TWO:
      hint.setText(R.string.tutorial_step_two_hint);
      explanation.setVisibility(View.VISIBLE);
      break;
    case STEP_THREE:
      hint.setText(R.string.tutorial_step_three_hint);
      explanation.setVisibility(View.GONE);
      break;
    }
    setOS(os_type);
    return view;
  }

  @Override
  public boolean onTouch(View v, MotionEvent event) {
    return true;
  }

  public void setOS(int os) {
    switch (step) {
    case STEP_ONE:
      switch (os) {
      case OSChooserFragment.LINUX:
        explanation.setText(R.string.tutorial_step_one_linux_hint);
        break;
      case OSChooserFragment.ANDROID:
        explanation.setText(R.string.tutorial_step_one_android_hint);
        break;
      case OSChooserFragment.WINDOWS:
        explanation.setText(R.string.tutorial_step_one_windows_hint);
        break;
      case OSChooserFragment.OSX:
        explanation.setText(R.string.tutorial_step_one_mac_hint);
        break;
      }
      break;
    case STEP_TWO:
      switch (os) {
      case OSChooserFragment.LINUX:
        explanation.setText(R.string.tutorial_step_two_linux_hint);
        break;
      case OSChooserFragment.ANDROID:
        explanation.setText(R.string.tutorial_step_two_android_hint);
        break;
      case OSChooserFragment.WINDOWS:
        explanation.setText(R.string.tutorial_step_two_windows_hint);
        break;
      case OSChooserFragment.OSX:
        explanation.setText(R.string.tutorial_step_two_mac_hint);
        break;
      }
      break;
    }
  }
}
//





Java Source Code List

com.bustiblelemons.tasque.database.DatabaseAdapter.java
com.bustiblelemons.tasque.database.Database.java
com.bustiblelemons.tasque.frontend.Alarms.java
com.bustiblelemons.tasque.frontend.Category.java
com.bustiblelemons.tasque.frontend.Note.java
com.bustiblelemons.tasque.frontend.Task.java
com.bustiblelemons.tasque.main.CategoriesFragment.java
com.bustiblelemons.tasque.main.CompletedTasksFragment.java
com.bustiblelemons.tasque.main.NotesAdapter.java
com.bustiblelemons.tasque.main.NotesFragment.java
com.bustiblelemons.tasque.main.RightSideFragmentPocketListener.java
com.bustiblelemons.tasque.main.SpinnerAdapter.java
com.bustiblelemons.tasque.main.TasqueAdapter.java
com.bustiblelemons.tasque.main.TasqueCategoryAdapter.java
com.bustiblelemons.tasque.main.TasqueGroupFragment.java
com.bustiblelemons.tasque.main.TasqueRTMCategoryAdapter.java
com.bustiblelemons.tasque.main.Tasque.java
com.bustiblelemons.tasque.rtm.RTMAuthFragment.java
com.bustiblelemons.tasque.rtm.RTMBackend.java
com.bustiblelemons.tasque.rtm.RTMConnectivityReceiver.java
com.bustiblelemons.tasque.rtm.RTMLoginFromSettings.java
com.bustiblelemons.tasque.rtm.RTMSyncBroadcastReceiver.java
com.bustiblelemons.tasque.rtm.RTMSyncService.java
com.bustiblelemons.tasque.rtm.SynchronizingFragment.java
com.bustiblelemons.tasque.settings.RTMBackendFragmentSettings.java
com.bustiblelemons.tasque.settings.SettingsActivity.java
com.bustiblelemons.tasque.settings.SettingsUtil.java
com.bustiblelemons.tasque.splash.ExportToExternalFragment.java
com.bustiblelemons.tasque.splash.ExternalProblemsFragment.java
com.bustiblelemons.tasque.splash.ImporterActivity.java
com.bustiblelemons.tasque.splash.Splash.java
com.bustiblelemons.tasque.tutorial.OSChooserFragment.java
com.bustiblelemons.tasque.tutorial.OSListAdapter.java
com.bustiblelemons.tasque.tutorial.SynchronizeTutorialActivity.java
com.bustiblelemons.tasque.tutorial.SynchronizedFilesAdapter.java
com.bustiblelemons.tasque.tutorial.TutorialTabFragment.java
com.bustiblelemons.tasque.utilities.Connection.java
com.bustiblelemons.tasque.utilities.PermissionParser.java
com.bustiblelemons.tasque.utilities.PriorityParser.java
com.bustiblelemons.tasque.utilities.Utility.java
com.bustiblelemons.tasque.utilities.Values.java