Android Open Source - timestatistic Period Setup Dialog Fragment






From Project

Back to project page timestatistic.

License

The source code is released under:

GNU General Public License

If you think the Android project timestatistic 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 maximsblog.blogspot.com.timestatistic;
/*from  www.j a v a  2 s . c  o m*/
import maximsblog.blogspot.com.timestatistic.AreYouSureResetAllDialogFragment.ResetAllDialog;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

public class PeriodSetupDialogFragment extends DialogFragment implements OnClickListener {
  
  private IPeriodSetupDialog mListener;
  private long mPeriod;
  public interface IPeriodSetupDialog {
    void setupNewPeriod(long time);
  }
  public void setPeriodSetupDialog(IPeriodSetupDialog listener) {
    mListener = listener;
  }
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
      mPeriod = getArguments().getLong(PeriodAnalyseActivity.PERIOD);
      int index=0;
      if(mPeriod == 1000*60*60)
        index = 0;
      else if(mPeriod == 1000*60*60*24)
        index = 1;
          else
            if(mPeriod == 1000*60*60*24 * 7)
              index = 2;
                else
                  if(mPeriod == 1000*60*60 * 12)
                    index = 3;
        return new AlertDialog.Builder(getActivity())
            .setTitle(R.string.interval)
            .setSingleChoiceItems(R.array.periods, index, this)
            .create();
    }
  @Override
  public void onClick(DialogInterface dialog, int which) {
    long time;
    switch (which) {
    case 0:
      time = 1000*60*60;
      break;
    case 1:
      time = 1000*60*60*24;
      break;
    case 2:
      time = 1000*60*60*24 * 7;
      break;
    case 3:
      time = 1000*60*60 * 12;
      break;
    default:
      time = 1000*60*60;
      break;
    }
    mListener.setupNewPeriod(time);
    this.dismiss();
  }
}




Java Source Code List

maximsblog.blogspot.com.timestatistic.AboutActivity.java
maximsblog.blogspot.com.timestatistic.AboutFragment.java
maximsblog.blogspot.com.timestatistic.AlarmManagerBroadcastReceiver.java
maximsblog.blogspot.com.timestatistic.AreYouSureResetAllDialogFragment.java
maximsblog.blogspot.com.timestatistic.AreYouSureResetAllDialog.java
maximsblog.blogspot.com.timestatistic.BootUpReceiver.java
maximsblog.blogspot.com.timestatistic.CalendarSetupDialogFragment.java
maximsblog.blogspot.com.timestatistic.ColorPickerDialogFragment.java
maximsblog.blogspot.com.timestatistic.ColorPickerDialog.java
maximsblog.blogspot.com.timestatistic.CounterEditorDialogFragment.java
maximsblog.blogspot.com.timestatistic.CountersCursorAdapter.java
maximsblog.blogspot.com.timestatistic.CountersFragment.java
maximsblog.blogspot.com.timestatistic.CountersPeriodSetupDialogFragment.java
maximsblog.blogspot.com.timestatistic.CustomDateTimePicker.java
maximsblog.blogspot.com.timestatistic.DiagramFragment.java
maximsblog.blogspot.com.timestatistic.DiaryCursorAdapter.java
maximsblog.blogspot.com.timestatistic.DiaryEditorDialogFragment.java
maximsblog.blogspot.com.timestatistic.DiaryFragment.java
maximsblog.blogspot.com.timestatistic.ExportImportBackupActivity.java
maximsblog.blogspot.com.timestatistic.ExportToCSVActivity.java
maximsblog.blogspot.com.timestatistic.ExportToCSVService.java
maximsblog.blogspot.com.timestatistic.ExportToGoogleCalendarActivity.java
maximsblog.blogspot.com.timestatistic.ExportToGoogleCalendarService.java
maximsblog.blogspot.com.timestatistic.FileDialog.java
maximsblog.blogspot.com.timestatistic.FilterDateOption.java
maximsblog.blogspot.com.timestatistic.FilterDateSetDialogFragment.java
maximsblog.blogspot.com.timestatistic.FilterDialogFragment.java
maximsblog.blogspot.com.timestatistic.GdriveUpload.java
maximsblog.blogspot.com.timestatistic.HelpActivity.java
maximsblog.blogspot.com.timestatistic.HistoryFragment.java
maximsblog.blogspot.com.timestatistic.ICustomDateTimeListener.java
maximsblog.blogspot.com.timestatistic.IRecordDialog.java
maximsblog.blogspot.com.timestatistic.IdateChange.java
maximsblog.blogspot.com.timestatistic.Item.java
maximsblog.blogspot.com.timestatistic.MainActivity.java
maximsblog.blogspot.com.timestatistic.OpenHelper.java
maximsblog.blogspot.com.timestatistic.PeriodAnalyseActivity.java
maximsblog.blogspot.com.timestatistic.PeriodAnalyseFragment.java
maximsblog.blogspot.com.timestatistic.PeriodData.java
maximsblog.blogspot.com.timestatistic.PeriodSetupDialogFragment.java
maximsblog.blogspot.com.timestatistic.RecordsDbHelper.java
maximsblog.blogspot.com.timestatistic.SelectionMode.java
maximsblog.blogspot.com.timestatistic.SettingsActivity.java
maximsblog.blogspot.com.timestatistic.SplitRecordDialogFragment.java
maximsblog.blogspot.com.timestatistic.TimeRecordsFragment.java
maximsblog.blogspot.com.timestatistic.TimesCursorAdapter.java
maximsblog.blogspot.com.timestatistic.TopicActivity.java
maximsblog.blogspot.com.timestatistic.UnionRecordDialogFragment.java
maximsblog.blogspot.com.timestatistic.XYMultipleSeriesDatasetLoader.java
maximsblog.blogspot.com.timestatistic.app.java