// Path: app/src/main/java/org/theotech/ceaselessandroid/realm/pojo/PersonPOJO.java
// public class PersonPOJO implements Serializable {
//     private String id;
//     private String name;
//     private String source;
//     private List<NotePOJO> notes;
//     private Date lastPrayed;
//     private boolean favorite;
//     private boolean ignored;
//     private boolean prayed;
// 
//     public PersonPOJO(String id, String name, String source, List<NotePOJO> notes, Date lastPrayed, boolean favorite, boolean ignored, boolean prayed) {
//         this.id = id;
//         this.name = name;
//         this.source = source;
//         this.notes = notes;
//         this.lastPrayed = lastPrayed;
//         this.favorite = favorite;
//         this.ignored = ignored;
//         this.prayed = prayed;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getSource() {
//         return source;
//     }
// 
//     public void setSource(String source) {
//         this.source = source;
//     }
// 
//     public List<NotePOJO> getNotes() {
//         return notes;
//     }
// 
//     public void setNotes(List<NotePOJO> notes) {
//         this.notes = notes;
//     }
// 
//     public Date getLastPrayed() {
//         return lastPrayed;
//     }
// 
//     public void setLastPrayed(Date lastPrayed) {
//         this.lastPrayed = lastPrayed;
//     }
// 
//     public boolean isFavorite() {
//         return favorite;
//     }
// 
//     public void setFavorite(boolean favorite) {
//         this.favorite = favorite;
//     }
// 
//     public boolean isIgnored() {
//         return ignored;
//     }
// 
//     public void setIgnored(boolean ignored) {
//         this.ignored = ignored;
//     }
// 
//     public boolean isPrayed() {
//         return prayed;
//     }
// 
//     public void setPrayed(boolean prayed) {
//         this.prayed = prayed;
//     }
// 
//     @Override
//     public String toString() {
//         return name;
//     }
// }
// 
// Path: app/src/main/java/org/theotech/ceaselessandroid/util/Constants.java
// public class Constants {
//     public static final int NUM_AUXILIARY_CARDS = 2;
//     public static final int SCHEMA_VERSION = 0;
//     public static final String REALM_FILE_NAME = "org.theotech.ceaselessandroid";
// 
//     public static final String HOME_SECTION_NUMBER_BUNDLE_ARG = "homeSectionNumber";
//     public static final String USE_CACHE_BUNDLE_ARG = "useCache";
//     public static final String PERSON_ID_BUNDLE_ARG = "personId";
//     public static final String NOTE_ID_BUNDLE_ARG = "noteId";
//     public static final String NEXT_BACKGROUND_IMAGE = "nextBackgroundImage";
//     public static final String CURRENT_BACKGROUND_IMAGE = "currentBackgroundImage";
//     public static final String PRESELECTED_PERSON_NAME = "preselectedPersonName";
//     public static final String PRESELECTED_PERSON_ID = "preselectedPersonId";
// 
//     public static final String SHOW_PERSON_INTENT = "org.theotech.ceaselessandroid.SHOW_PERSON";
//     public static final String SHOW_NOTE_INTENT = "org.theotech.ceaselessandroid.SHOW_NOTE";
//     public static final String DEFAULT_PREFERENCES_FILE = "org.theotech.ceaselessandroid_preferences";
// 
//     public static final String NUMBER_OF_PEOPLE_TO_PRAY_FOR = "numberOfPeopleToPrayForDaily";
// 
//     public static final String DEMO_NAME_BUNDLE_ARG = "demoName";
//     public static final String DEMO_TOOLTIP_BUNDLE_ARG = "demoShowToolTip";
// 
//     public static final String DEFAULT_CEASELESS_CHANNEL_ID = "ceaselessPrayerReminders";
// }


import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tokenautocomplete.TokenCompleteTextView;
import org.theotech.ceaselessandroid.R;
import org.theotech.ceaselessandroid.realm.pojo.PersonPOJO;
import org.theotech.ceaselessandroid.util.Constants;
package org.theotech.ceaselessandroid.view;




/**
 * Created by uberx on 10/16/15.
 */
public class PersonsCompletionView extends TokenCompleteTextView<PersonPOJO> {

    public PersonsCompletionView(Context context, AttributeSet attrs) {
        super(context, attrs);
        setTokenClickStyle(TokenClickStyle.SelectDeselect);
    }

    @Override
    protected View getViewForObject(final PersonPOJO personPOJO) {
        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        LinearLayout view = (LinearLayout) inflater.inflate(R.layout.person_token, (ViewGroup) PersonsCompletionView.this.getParent(), false);
        TextView personTag = (TextView) view.findViewById(R.id.person_tag);
        personTag.setText(personPOJO.getName());
        personTag.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putString(Constants.PERSON_ID_BUNDLE_ARG, personPOJO.getId());
                Intent intent = new Intent(Constants.SHOW_PERSON_INTENT);
                intent.putExtras(bundle);
// Path: app/src/main/java/org/theotech/ceaselessandroid/realm/pojo/PersonPOJO.java
// public class PersonPOJO implements Serializable {
//     private String id;
//     private String name;
//     private String source;
//     private List<NotePOJO> notes;
//     private Date lastPrayed;
//     private boolean favorite;
//     private boolean ignored;
//     private boolean prayed;
// 
//     public PersonPOJO(String id, String name, String source, List<NotePOJO> notes, Date lastPrayed, boolean favorite, boolean ignored, boolean prayed) {
//         this.id = id;
//         this.name = name;
//         this.source = source;
//         this.notes = notes;
//         this.lastPrayed = lastPrayed;
//         this.favorite = favorite;
//         this.ignored = ignored;
//         this.prayed = prayed;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getSource() {
//         return source;
//     }
// 
//     public void setSource(String source) {
//         this.source = source;
//     }
// 
//     public List<NotePOJO> getNotes() {
//         return notes;
//     }
// 
//     public void setNotes(List<NotePOJO> notes) {
//         this.notes = notes;
//     }
// 
//     public Date getLastPrayed() {
//         return lastPrayed;
//     }
// 
//     public void setLastPrayed(Date lastPrayed) {
//         this.lastPrayed = lastPrayed;
//     }
// 
//     public boolean isFavorite() {
//         return favorite;
//     }
// 
//     public void setFavorite(boolean favorite) {
//         this.favorite = favorite;
//     }
// 
//     public boolean isIgnored() {
//         return ignored;
//     }
// 
//     public void setIgnored(boolean ignored) {
//         this.ignored = ignored;
//     }
// 
//     public boolean isPrayed() {
//         return prayed;
//     }
// 
//     public void setPrayed(boolean prayed) {
//         this.prayed = prayed;
//     }
// 
//     @Override
//     public String toString() {
//         return name;
//     }
// }
// 
// Path: app/src/main/java/org/theotech/ceaselessandroid/util/Constants.java
// public class Constants {
//     public static final int NUM_AUXILIARY_CARDS = 2;
//     public static final int SCHEMA_VERSION = 0;
//     public static final String REALM_FILE_NAME = "org.theotech.ceaselessandroid";
// 
//     public static final String HOME_SECTION_NUMBER_BUNDLE_ARG = "homeSectionNumber";
//     public static final String USE_CACHE_BUNDLE_ARG = "useCache";
//     public static final String PERSON_ID_BUNDLE_ARG = "personId";
//     public static final String NOTE_ID_BUNDLE_ARG = "noteId";
//     public static final String NEXT_BACKGROUND_IMAGE = "nextBackgroundImage";
//     public static final String CURRENT_BACKGROUND_IMAGE = "currentBackgroundImage";
//     public static final String PRESELECTED_PERSON_NAME = "preselectedPersonName";
//     public static final String PRESELECTED_PERSON_ID = "preselectedPersonId";
// 
//     public static final String SHOW_PERSON_INTENT = "org.theotech.ceaselessandroid.SHOW_PERSON";
//     public static final String SHOW_NOTE_INTENT = "org.theotech.ceaselessandroid.SHOW_NOTE";
//     public static final String DEFAULT_PREFERENCES_FILE = "org.theotech.ceaselessandroid_preferences";
// 
//     public static final String NUMBER_OF_PEOPLE_TO_PRAY_FOR = "numberOfPeopleToPrayForDaily";
// 
//     public static final String DEMO_NAME_BUNDLE_ARG = "demoName";
//     public static final String DEMO_TOOLTIP_BUNDLE_ARG = "demoShowToolTip";
// 
//     public static final String DEFAULT_CEASELESS_CHANNEL_ID = "ceaselessPrayerReminders";
// }


// Path: app/src/main/java/org/theotech/ceaselessandroid/view/PersonsCompletionView.java
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tokenautocomplete.TokenCompleteTextView;
import org.theotech.ceaselessandroid.R;
import org.theotech.ceaselessandroid.realm.pojo.PersonPOJO;
import org.theotech.ceaselessandroid.util.Constants;

package org.theotech.ceaselessandroid.view;




/**
 * Created by uberx on 10/16/15.
 */
public class PersonsCompletionView extends TokenCompleteTextView<PersonPOJO> {

    public PersonsCompletionView(Context context, AttributeSet attrs) {
        super(context, attrs);
        setTokenClickStyle(TokenClickStyle.SelectDeselect);
    }

    @Override
    protected View getViewForObject(final PersonPOJO personPOJO) {
        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        LinearLayout view = (LinearLayout) inflater.inflate(R.layout.person_token, (ViewGroup) PersonsCompletionView.this.getParent(), false);
        TextView personTag = (TextView) view.findViewById(R.id.person_tag);
        personTag.setText(personPOJO.getName());
        personTag.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putString(Constants.PERSON_ID_BUNDLE_ARG, personPOJO.getId());
                Intent intent = new Intent(Constants.SHOW_PERSON_INTENT);
                intent.putExtras(bundle);
                getContext().startActivity(intent);