Android Open Source - Android-Project-Manager Custom Status






From Project

Back to project page Android-Project-Manager.

License

The source code is released under:

GNU General Public License

If you think the Android project Android-Project-Manager 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.vaquerosisd.dialog;
/* ww w.  jav  a 2s .  c  o m*/
import com.vaquerosisd.projectmanager.R;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.EditText;

public class CustomStatus extends DialogFragment {
  
  CustomStatusInterface statusDialogListener;
  
  public interface CustomStatusInterface {
    public void onDialogPositiveClick(DialogFragment dialog, String statusOption);
    public void onDialogNegativeClick(DialogFragment dialog);
  }
  
  @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        
        try {
          if(getTargetFragment() == null)
            statusDialogListener = (CustomStatusInterface) activity;
          else
            statusDialogListener = (CustomStatusInterface) getTargetFragment();
        } catch (ClassCastException e) {
            e.getStackTrace();
        }
    }
  
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) {
      AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
      LayoutInflater inflater = getActivity().getLayoutInflater();
      
      AlertDialog alert=builder.create();
      setCancelable(false);
      alert.setCanceledOnTouchOutside(false);
      
      builder.setTitle("Set custom status");
      builder.setView(inflater.inflate(R.layout.dialog_custom_status, null));
      builder.setPositiveButton(R.string.dialogOk, new DialogInterface.OnClickListener() {
           @Override
           public void onClick(DialogInterface dialog, int id) {
             EditText statusText = (EditText) ((AlertDialog) dialog).findViewById(R.id.dialogStatus_customStatusOption);
               statusDialogListener.onDialogPositiveClick(CustomStatus.this, statusText.getText().toString());
           }
       });
      builder.setNegativeButton(R.string.dialogCancel, new DialogInterface.OnClickListener() {
         @Override
           public void onClick(DialogInterface dialog, int id) {
           statusDialogListener.onDialogNegativeClick(CustomStatus.this);
               CustomStatus.this.getDialog().cancel();
           }
       }); 
      return builder.create();
  }

}




Java Source Code List

com.vaquerosisd.adapters.ProjectListViewAdapter.java
com.vaquerosisd.adapters.TaskListViewAdapter.java
com.vaquerosisd.adapters.VideoNoteGridViewAdapter.java
com.vaquerosisd.adapters.VoiceNoteGridViewAdapter.java
com.vaquerosisd.database.DatabaseHelper.java
com.vaquerosisd.database.ProjectOperations.java
com.vaquerosisd.dialog.CustomStatus.java
com.vaquerosisd.dialog.DatePickerFragment.java
com.vaquerosisd.dialog.DeleteDialog.java
com.vaquerosisd.dialog.DeletePhotoDialog.java
com.vaquerosisd.dialog.DeleteTaskDialog.java
com.vaquerosisd.dialog.EditProject.java
com.vaquerosisd.fragments.TaskDescriptionFragment.java
com.vaquerosisd.fragments.VideoNotesFragment.java
com.vaquerosisd.fragments.VoiceNotesFragment.java
com.vaquerosisd.object.JsonWrapper.java
com.vaquerosisd.object.PhotoRef.java
com.vaquerosisd.object.Project.java
com.vaquerosisd.object.Task.java
com.vaquerosisd.object.User.java
com.vaquerosisd.object.WebServiceManager.java
com.vaquerosisd.projectmanager.About.java
com.vaquerosisd.projectmanager.ContentTask.java
com.vaquerosisd.projectmanager.Login.java
com.vaquerosisd.projectmanager.MainActivity.java
com.vaquerosisd.projectmanager.NewAccount.java
com.vaquerosisd.projectmanager.NewProject.java
com.vaquerosisd.projectmanager.NewTask.java
com.vaquerosisd.projectmanager.OnSwipeListener.java
com.vaquerosisd.projectmanager.PhotoManager.java
com.vaquerosisd.projectmanager.ProjectList.java
com.vaquerosisd.projectmanager.TaskList.java
com.vaquerosisd.projectmanager.WebserviceCallback.java
com.vaquerosisd.utils.FileOperations.java
com.vaquerosisd.utils.OnSwipeListener.java
com.vaquerosisd.utils.SpinnerUtil.java
com.vaquerosisd.utils.TabListener.java