Android Open Source - iEtueri Priority Dialog Fragment






From Project

Back to project page iEtueri.

License

The source code is released under:

GNU General Public License

If you think the Android project iEtueri 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 utility;
/*from   w w  w.  ja va2  s .c  om*/
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.javils.ietueri.R;

/** This class is a view of Timer Picker dialog */
// TODO: Only for Buttons at this moment, in the future, for more View objects
public class PriorityDialogFragment extends DialogFragment implements OnClickListener {

  /** Builder for the dialog */
  private AlertDialog.Builder builder;

  /** Inflater of the dialog */
  private LayoutInflater inflater;

  /** The handler of the dialog */
  private Button handler;

  /** Button with the 3 priority */
  private Button highPriority;
  private Button normalPriority;
  private Button lowPriority;

  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) {
    builder = new AlertDialog.Builder(getActivity());
    inflater = getActivity().getLayoutInflater();
    View dialogView = inflater.inflate(R.layout.dialog_new_homework_priority, null);
    builder.setView(dialogView);

    highPriority = (Button) dialogView.findViewById(R.id.dialog_new_homework_priority_high);
    normalPriority = (Button) dialogView.findViewById(R.id.dialog_new_homework_priority_normal);
    lowPriority = (Button) dialogView.findViewById(R.id.dialog_new_homework_priority_low);

    highPriority.setOnClickListener(this);
    normalPriority.setOnClickListener(this);
    lowPriority.setOnClickListener(this);

    return builder.create();
  }

  /** Set the handler */
  public void setHandler(Button handler) {
    this.handler = handler;
  }

  @Override
  public void onClick(View v) {
    switch (v.getId()) {
    case R.id.dialog_new_homework_priority_high:
      handler.setHint(getString(R.string.high_priority));
      break;
    case R.id.dialog_new_homework_priority_normal:
      handler.setHint(getString(R.string.normal_priority));
      break;
    case R.id.dialog_new_homework_priority_low:
      handler.setHint(getString(R.string.low_priority));
      break;
    }

    this.dismiss();

  }

}




Java Source Code List

courses.CourseDetailFragment.java
courses.Course.java
courses.CoursesAdapter.java
courses.CoursesFragment.java
courses.NewCourseFragment.java
exams.Exam.java
exams.ExamsAdapter.java
exams.ExamsFragment.java
exams.NewExamFragment.java
homework.HomeworkAdapter.java
homework.HomeworkFragment.java
homework.Homework.java
homework.NewHomeworkFragment.java
navigationdrawer.DrawerListAdapter.java
navigationdrawer.DrawerList.java
navigationdrawer.MainActivity.java
navigationdrawer.NavigationDrawerCallbacks.java
navigationdrawer.NavigationDrawerController.java
navigationdrawer.NavigationDrawerFragment.java
navigationdrawer.OpenBrowser.java
schedule.CalendarManager.java
schedule.Event.java
schedule.EventsManager.java
schedule.FindEvents.java
schedule.RefreshScheduleEventsData.java
schedule.ScheduleFragment.java
schedule.ScheduleTodayAdapter.java
subject.DetailSubjectFragment.java
subject.NewSubjectFragment.java
subject.SubjectFragment.java
subject.SubjectListAdapter.java
subject.Subject.java
today.NewEventRepetitionDialogFragment.java
today.NewEventTodayFragment.java
today.TodayFragment.java
utility.DatabaseContract.java
utility.DatabaseHelper.java
utility.DatePickerDialogFragment.java
utility.OnBackPressed.java
utility.OnClickButtonXml.java
utility.PriorityDialogFragment.java
utility.TimePickerDialogFragment.java