// Path: mvp/app/src/main/java/com/tinmegali/tutsmvp_sample/main/activity/view/recycler/NotesViewHolder.java
// public class NotesViewHolder extends RecyclerView.ViewHolder {
// 
//     public RelativeLayout container;
//     public TextView text, date;
//     public ImageButton btnDelete;
// 
//     public NotesViewHolder(View itemView) {
//         super(itemView);
// 
//         setupViews(itemView);
//     }
// 
//     private void setupViews(View view) {
//         container = (RelativeLayout) view.findViewById(R.id.holder_container);
//         text = (TextView) view.findViewById(R.id.note_text);
//         date = (TextView) view.findViewById(R.id.note_date);
//         btnDelete = (ImageButton) view.findViewById(R.id.btn_delete);
//     }
// 
// 
// }
// 
// Path: mvp/app/src/main/java/com/tinmegali/tutsmvp_sample/models/Note.java
// public class Note {
// 
//     private int id = -1;
//     private String mText;
//     private String mDate;
// 
//     public Note() {
//     }
// 
//     public Note(int id, String mText, String mDate) {
//         this.id = id;
//         this.mText = mText;
//         this.mDate = mDate;
//     }
// 
//     public Note(String mText, String mDate) {
//         this.mText = mText;
//         this.mDate = mDate;
//     }
// 
//     public ContentValues getValues(){
//         ContentValues cv = new ContentValues();
//         if ( id!=-1) cv.put(DBSchema.TB_NOTES.ID, id);
//         cv.put(DBSchema.TB_NOTES.NOTE, mText);
//         cv.put(DBSchema.TB_NOTES.DATE, mDate);
//         return cv;
//     }
// 
//     public void setId(int id) {
//         this.id = id;
//     }
// 
//     public void setDate(String mDate) {
//         this.mDate = mDate;
//     }
// 
//     public void setText(String mText) {
//         this.mText = mText;
//     }
// 
//     public int getId() {
//         return id;
//     }
// 
//     public String getDate() {
//         return mDate;
//     }
// 
//     public String getText() {
//         return mText;
//     }
// }


import android.content.Context;
import android.support.v7.app.AlertDialog;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.Toast;
import com.tinmegali.tutsmvp_sample.main.activity.view.recycler.NotesViewHolder;
import com.tinmegali.tutsmvp_sample.models.Note;
import java.util.ArrayList;
package com.tinmegali.tutsmvp_sample.main.activity;




/**
 * Holder interface that contains all interfaces
 * responsible to maintain communication between
 * Model View Presenter layers.
 * Each layer implements its respective interface:
 *      View implements RequiredViewOps
 *      Presenter implements ProvidedPresenterOps, RequiredPresenterOps
 *      Model implements ProvidedModelOps
 *
 * ---------------------------------------------------
 * Created by Tin Megali on 18/03/16.
 * Project: tuts+mvp_sample
 * ---------------------------------------------------
 * <a href="http://www.tinmegali.com">tinmegali.com</a>
 * <a href="http://www.github.com/tinmegali>github</a>
 * ---------------------------------------------------
 */
public interface MVP_Main {
    /**
     * Required View methods available to Presenter.
     * A passive layer, responsible to show data
     * and receive user interactions
     *      Presenter to View
     */
    interface RequiredViewOps {
        Context getAppContext();
        Context getActivityContext();
        void showToast(Toast toast);
        void showProgress();
        void hideProgress();
        void showAlert(AlertDialog dialog);
        void notifyItemRemoved(int position);
        void notifyDataSetChanged();
        void notifyItemInserted(int layoutPosition);
        void notifyItemRangeChanged(int positionStart, int itemCount);
        void clearEditText();
    }

    /**
     * Operations offered to View to communicate with Presenter.
     * Process user interaction, sends data requests to Model, etc.
     *      View to Presenter
     */
    interface ProvidedPresenterOps {
        void onDestroy(boolean isChangingConfiguration);
        void setView(RequiredViewOps view);
// Path: mvp/app/src/main/java/com/tinmegali/tutsmvp_sample/main/activity/view/recycler/NotesViewHolder.java
// public class NotesViewHolder extends RecyclerView.ViewHolder {
// 
//     public RelativeLayout container;
//     public TextView text, date;
//     public ImageButton btnDelete;
// 
//     public NotesViewHolder(View itemView) {
//         super(itemView);
// 
//         setupViews(itemView);
//     }
// 
//     private void setupViews(View view) {
//         container = (RelativeLayout) view.findViewById(R.id.holder_container);
//         text = (TextView) view.findViewById(R.id.note_text);
//         date = (TextView) view.findViewById(R.id.note_date);
//         btnDelete = (ImageButton) view.findViewById(R.id.btn_delete);
//     }
// 
// 
// }
// 
// Path: mvp/app/src/main/java/com/tinmegali/tutsmvp_sample/models/Note.java
// public class Note {
// 
//     private int id = -1;
//     private String mText;
//     private String mDate;
// 
//     public Note() {
//     }
// 
//     public Note(int id, String mText, String mDate) {
//         this.id = id;
//         this.mText = mText;
//         this.mDate = mDate;
//     }
// 
//     public Note(String mText, String mDate) {
//         this.mText = mText;
//         this.mDate = mDate;
//     }
// 
//     public ContentValues getValues(){
//         ContentValues cv = new ContentValues();
//         if ( id!=-1) cv.put(DBSchema.TB_NOTES.ID, id);
//         cv.put(DBSchema.TB_NOTES.NOTE, mText);
//         cv.put(DBSchema.TB_NOTES.DATE, mDate);
//         return cv;
//     }
// 
//     public void setId(int id) {
//         this.id = id;
//     }
// 
//     public void setDate(String mDate) {
//         this.mDate = mDate;
//     }
// 
//     public void setText(String mText) {
//         this.mText = mText;
//     }
// 
//     public int getId() {
//         return id;
//     }
// 
//     public String getDate() {
//         return mDate;
//     }
// 
//     public String getText() {
//         return mText;
//     }
// }


// Path: mvp/app/src/main/java/com/tinmegali/tutsmvp_sample/main/activity/MVP_Main.java
import android.content.Context;
import android.support.v7.app.AlertDialog;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.Toast;
import com.tinmegali.tutsmvp_sample.main.activity.view.recycler.NotesViewHolder;
import com.tinmegali.tutsmvp_sample.models.Note;
import java.util.ArrayList;

package com.tinmegali.tutsmvp_sample.main.activity;




/**
 * Holder interface that contains all interfaces
 * responsible to maintain communication between
 * Model View Presenter layers.
 * Each layer implements its respective interface:
 *      View implements RequiredViewOps
 *      Presenter implements ProvidedPresenterOps, RequiredPresenterOps
 *      Model implements ProvidedModelOps
 *
 * ---------------------------------------------------
 * Created by Tin Megali on 18/03/16.
 * Project: tuts+mvp_sample
 * ---------------------------------------------------
 * <a href="http://www.tinmegali.com">tinmegali.com</a>
 * <a href="http://www.github.com/tinmegali>github</a>
 * ---------------------------------------------------
 */
public interface MVP_Main {
    /**
     * Required View methods available to Presenter.
     * A passive layer, responsible to show data
     * and receive user interactions
     *      Presenter to View
     */
    interface RequiredViewOps {
        Context getAppContext();
        Context getActivityContext();
        void showToast(Toast toast);
        void showProgress();
        void hideProgress();
        void showAlert(AlertDialog dialog);
        void notifyItemRemoved(int position);
        void notifyDataSetChanged();
        void notifyItemInserted(int layoutPosition);
        void notifyItemRangeChanged(int positionStart, int itemCount);
        void clearEditText();
    }

    /**
     * Operations offered to View to communicate with Presenter.
     * Process user interaction, sends data requests to Model, etc.
     *      View to Presenter
     */
    interface ProvidedPresenterOps {
        void onDestroy(boolean isChangingConfiguration);
        void setView(RequiredViewOps view);
        NotesViewHolder createViewHolder(ViewGroup parent, int viewType);