Android Open Source - SDCardTrac Help Fragment






From Project

Back to project page SDCardTrac.

License

The source code is released under:

GNU General Public License

If you think the Android project SDCardTrac 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.nma.util.sdcardtrac;
/*w  w w  . j  a v a2s  .  co m*/


import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.FragmentManager;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


/**
 * A simple {@link Fragment} subclass.
 * Use the {@link HelpFragment#newInstance} factory method to
 * create an instance of this fragment.
 *
 */
public class HelpFragment extends DialogFragment
    implements DialogInterface.OnClickListener {
    private GraphFragment.OnFragmentInteractionListener mListener;

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     * @return A new instance of fragment HelpFragment.
     */
    // TODO: Rename and change types and number of parameters
    public static HelpFragment newInstance() {
        HelpFragment fragment = new HelpFragment();
        return fragment;
    }

    public HelpFragment() {
        // Required empty public constructor
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
/*        Dialog dialog = super.onCreateDialog(savedInstanceState);
        dialog.setTitle("Help");
        return dialog;*/
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        builder.setTitle(R.string.help)
                .setMessage(R.string.help_text)
                .setNeutralButton(R.string.back, this);

        return builder.create();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
/*
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View retView = super.onCreateView(inflater, container, savedInstanceState);
        TextView help = (TextView)retView.findViewById(R.id.help_textview);
        help.setMovementMethod(LinkMovementMethod.getInstance());
        return retView;
    }
*/
    @Override
    public void onClick(DialogInterface dialog, int which) {
        // Signal exit
        mListener.onFragmentInteraction(getString(R.string.exit_help));
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try {
            mListener = (GraphFragment.OnFragmentInteractionListener) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString()
                    + " must implement OnFragmentInteractionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }

}




Java Source Code List

com.jjoe64.graphview.BarGraphView.java
com.jjoe64.graphview.CustomLabelFormatter.java
com.jjoe64.graphview.GraphViewDataInterface.java
com.jjoe64.graphview.GraphViewSeries.java
com.jjoe64.graphview.GraphViewStyle.java
com.jjoe64.graphview.GraphView.java
com.jjoe64.graphview.LineGraphView.java
com.jjoe64.graphview.ValueDependentColor.java
com.jjoe64.graphview.compatible.RealScaleGestureDetector.java
com.jjoe64.graphview.compatible.ScaleGestureDetector.java
com.nma.util.sdcardtrac.AlarmHelper.java
com.nma.util.sdcardtrac.BitcoinIntegration.java
com.nma.util.sdcardtrac.ChangeLogFragment.java
com.nma.util.sdcardtrac.DatabaseLoader.java
com.nma.util.sdcardtrac.DatabaseManager.java
com.nma.util.sdcardtrac.DeleteDataPreference.java
com.nma.util.sdcardtrac.DeltaCompute.java
com.nma.util.sdcardtrac.FileObserverService.java
com.nma.util.sdcardtrac.GraphActivity.java
com.nma.util.sdcardtrac.GraphFragment.java
com.nma.util.sdcardtrac.GraphTabListener.java
com.nma.util.sdcardtrac.HelpFragment.java
com.nma.util.sdcardtrac.MyExpandableListAdapter.java
com.nma.util.sdcardtrac.SQLiteHelper.java
com.nma.util.sdcardtrac.SearchableActivity.java
com.nma.util.sdcardtrac.SettingsActivity.java
com.nma.util.sdcardtrac.StorageHelper.java
com.nma.util.sdcardtrac.UsageFileObserver.java