Android Open Source - ProjectStudio Professors Dialog Fragment






From Project

Back to project page ProjectStudio.

License

The source code is released under:

Apache License

If you think the Android project ProjectStudio 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

/**
 */*from w  w w.  j a v a  2 s.com*/
 */
package dialog_fragments;

import android.support.v4.app.DialogFragment;

/**
 * @author desmond
 */
public class ProfessorsDialogFragment extends DialogFragment {

    /*
    private EditText professor_name;
    private EditText professor_course;
    private EditText professor_course_room;
    private EditText professor_email;

    public static ProfessorsDialogFragment newInstance(String title) {
        ProfessorsDialogFragment frag = new ProfessorsDialogFragment();
        Bundle args = new Bundle();
        args.putString("professors_title", title);
        frag.setArguments(args);

        return frag;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        String btnOk = "Submit";
        String btnCancel = "Cancel";

        // create the new fragment using the alert builder
        String title = getArguments().getString("professors_title");
        AlertDialog.Builder ad = new AlertDialog.Builder(getActivity());
        ad.setTitle(title);

        // Get the Layout inflater
        // pass null as the parent view because its going in the dialog layout
        LayoutInflater inflater = getActivity().getLayoutInflater();
        View view = inflater.inflate(R.layout.professor_addview, null);

        // Inflate and set the layout for the dialog
        ad.setView(view);

        // get views
        professor_name = (EditText) view
                .findViewById(R.id.professor_dialog_pname);
        professor_email = (EditText) view
                .findViewById(R.id.professor_dialog_email);
        professor_course = (EditText) view
                .findViewById(R.id.professor_dialog_course);
        professor_course_room = (EditText) view
                .findViewById(R.id.professor_dialog_room);

        // add action buttons
        ad.setPositiveButton(btnOk, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                // Send the positive button event back to the host activity
                doPositiveClick();
            }
        });

        ad.setNegativeButton(btnCancel, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                // Send the negative button event back to the host activity
                doNegativeClick();

            }
        });

        // Create the dialog box and perform other operations on it
        final AlertDialog dialog = ad.create();

        // Call the keyboard to show automatically
        dialog.getWindow().setSoftInputMode(
                WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

        return dialog;
    }

    // Methods for custom dialog fragment
    private void doPositiveClick() {
        Toast.makeText(getActivity(), "OK button pressed", Toast.LENGTH_LONG)
                .show();
        Log.i("FragmentAlertDialog", "Positive click!");
    }

    private void doNegativeClick() {
        Toast.makeText(getActivity(), "Negative button pressed",
                Toast.LENGTH_LONG).show();
        Log.i("FragmentAlertDialog", "Negative click!");
    }
    */
}




Java Source Code List

DB_Provider.CourseDataSource.java
DB_Provider.DBManager.java
DB_Provider.DB_ABSTRACTS.java
DB_Provider.ProfessorDataSource.java
DB_Provider.TaskDataSource.java
Drawables.DrawableAlignedButton.java
FontPackage.TypefaceSpan.java
adapters.CourseCardAdapter.java
adapters.ExamsPassedCardAdapter.java
adapters.ExamsPendingCardAdapter.java
adapters.Exams_TabsPagerAdapter.java
adapters.HomeCardAdapter.java
adapters.MatesCardAdapter.java
adapters.NavDrawerListAdapter.java
adapters.ProfessorCardAdapter.java
adapters.TaskCardAdapter.java
adapters.TasksTabPagerAdapter.java
com.example.uniutilproject.BuildConfig.java
com.example.uniutilproject.UniUtil_MainActivity.java
days_fragments.FridayTaskFragment.java
days_fragments.MondayTaskFragment.java
days_fragments.SaturdayTaskFragment.java
days_fragments.SundayTaskFragment.java
days_fragments.ThursdayTaskFragment.java
days_fragments.TuesdayTaskFragment.java
days_fragments.WednesdayTaskFragment.java
dialog_fragments.DatePickerDialogFragment.java
dialog_fragments.MatesDialogFragment.java
dialog_fragments.ProfessorsDialogFragment.java
dialog_fragments.TimePickerDialogFragment.java
fragments.AddCourseFragment.java
fragments.AddProfFragment.java
fragments.AddTaskFragment.java
fragments.CoursesFragment.java
fragments.CursorLoaderListFragment.java
fragments.ExamsFragment.java
fragments.ExamsPassedFragment.java
fragments.ExamsPendingFragment.java
fragments.HomeFragment.java
fragments.MatesFragment.java
fragments.ProfessorsFragment.java
fragments.StudyPlanFragment.java
fragments.TasksFragment.java
fragments.UpdateCourseFragment.java
fragments.UpdateProfessorFragment.java
interfaces.NoticeDialogListener.java
interfaces.package-info.java
model.Course.java
model.Days.java
model.MyParcelable.java
model.NavDrawerItem.java
model.Professor.java
model.Task.java