Search in sources :

Example 1 with ContactSuggestionView

use of com.alexstyl.specialdates.addevent.ui.ContactSuggestionView in project Memento-Calendar by alexstyl.

the class ContactDetailsAdapter method onCreateViewHolder.

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    if (viewType == TYPE_CONTACT_SUGGESTION) {
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        View view = layoutInflater.inflate(R.layout.row_add_event_contact_suggestion, parent, false);
        ContactSuggestionView suggestionView = Views.findById(view, R.id.add_event_contact_autocomplete);
        return new ContactSuggestionViewHolder(suggestionView);
    } else if (viewType == TYPE_EVENT) {
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        View view = layoutInflater.inflate(R.layout.row_add_event_contact_event, parent, false);
        ImageView icon = Views.findById(view, R.id.add_event_event_icon);
        TextView datePicker = Views.findById(view, R.id.add_event_date_picker);
        ImageButton clear = Views.findById(view, R.id.add_event_remove_event);
        return new ContactEventViewHolder(view, icon, datePicker, clear);
    } else {
        throw new IllegalStateException("Received viewType " + viewType);
    }
}
Also used : ImageButton(android.widget.ImageButton) ContactSuggestionView(com.alexstyl.specialdates.addevent.ui.ContactSuggestionView) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) ContactSuggestionView(com.alexstyl.specialdates.addevent.ui.ContactSuggestionView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 2 with ContactSuggestionView

use of com.alexstyl.specialdates.addevent.ui.ContactSuggestionView in project Memento-Calendar by alexstyl.

the class ContactEventsAdapter method onCreateViewHolder.

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    if (viewType == TYPE_CONTACT_SUGGESTION) {
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        View view = layoutInflater.inflate(R.layout.row_add_event_contact_suggestion, parent, false);
        ContactSuggestionView suggestionView = Views.findById(view, R.id.add_event_contact_autocomplete);
        return new ContactSuggestionViewHolder(suggestionView);
    } else if (viewType == TYPE_EVENT) {
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        View view = layoutInflater.inflate(R.layout.row_add_event_contact_event, parent, false);
        ImageView icon = Views.findById(view, R.id.add_event_event_icon);
        TextView datePicker = Views.findById(view, R.id.add_event_date_picker);
        ImageButton clear = Views.findById(view, R.id.add_event_remove_event);
        return new ContactEventViewHolder(view, icon, datePicker, clear);
    } else {
        throw new IllegalStateException("Received viewType " + viewType);
    }
}
Also used : ImageButton(android.widget.ImageButton) ContactSuggestionView(com.alexstyl.specialdates.addevent.ui.ContactSuggestionView) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) ContactSuggestionView(com.alexstyl.specialdates.addevent.ui.ContactSuggestionView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)2 LayoutInflater (android.view.LayoutInflater)2 View (android.view.View)2 ImageButton (android.widget.ImageButton)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 ContactSuggestionView (com.alexstyl.specialdates.addevent.ui.ContactSuggestionView)2