Search in sources :

Example 91 with LayoutInflater

use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.

the class DraggableWithSectionExampleAdapter method onCreateViewHolder.

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    final View v;
    switch(viewType) {
        case ITEM_VIEW_TYPE_SECTION_HEADER:
            v = inflater.inflate(R.layout.list_section_header, parent, false);
            break;
        case ITEM_VIEW_TYPE_SECTION_ITEM:
            v = inflater.inflate(R.layout.list_item_draggable, parent, false);
            break;
        default:
            throw new IllegalStateException("Unexpected viewType (= " + viewType + ")");
    }
    return new MyViewHolder(v);
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 92 with LayoutInflater

use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.

the class DraggableSwipeableExampleAdapter method onCreateViewHolder.

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    final View v = inflater.inflate((viewType == 0) ? R.layout.list_item_draggable : R.layout.list_item2_draggable, parent, false);
    return new MyViewHolder(v);
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 93 with LayoutInflater

use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.

the class AddRemoveExpandableExampleAdapter method onCreateGroupViewHolder.

@Override
public MyGroupViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    final View v = inflater.inflate(R.layout.list_group_item_with_add_remove_buttons, parent, false);
    return new MyGroupViewHolder(v, mItemOnClickListener);
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 94 with LayoutInflater

use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.

the class ExpandableDraggableWithSectionExampleAdapter method onCreateGroupViewHolder.

@Override
public MyGroupViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    final View v;
    switch(viewType) {
        case GROUP_ITEM_VIEW_TYPE_SECTION_HEADER:
            v = inflater.inflate(R.layout.list_section_header, parent, false);
            break;
        case GROUP_ITEM_VIEW_TYPE_SECTION_ITEM:
            v = inflater.inflate(R.layout.list_group_item_draggable, parent, false);
            break;
        default:
            throw new IllegalStateException("Unexpected viewType (= " + viewType + ")");
    }
    return new MyGroupViewHolder(v);
}
Also used : LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View)

Example 95 with LayoutInflater

use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.

the class SwipeableExampleAdapter method onCreateViewHolder.

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    final View v = inflater.inflate(R.layout.list_item, parent, false);
    return new MyViewHolder(v);
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

LayoutInflater (android.view.LayoutInflater)1292 View (android.view.View)803 TextView (android.widget.TextView)615 ImageView (android.widget.ImageView)259 ViewGroup (android.view.ViewGroup)139 Context (android.content.Context)131 ListView (android.widget.ListView)123 LinearLayout (android.widget.LinearLayout)106 RecyclerView (android.support.v7.widget.RecyclerView)104 AdapterView (android.widget.AdapterView)100 Intent (android.content.Intent)92 AlertDialog (android.app.AlertDialog)88 DialogInterface (android.content.DialogInterface)81 Button (android.widget.Button)57 Bundle (android.os.Bundle)54 FrameLayout (android.widget.FrameLayout)49 TypedArray (android.content.res.TypedArray)43 Activity (android.app.Activity)41 AlertDialog (android.support.v7.app.AlertDialog)41 EditText (android.widget.EditText)41