Search in sources :

Example 71 with LayoutInflater

use of android.view.LayoutInflater in project smooth-app-bar-layout by henrytao-me.

the class SmoothAvatarActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_smooth_avatar);
    ButterKnife.bind(this);
    setSupportActionBar(vToolbar);
    vToolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(new DynamicAdapter<>(Utils.getSampleData())) {

        @Override
        public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return null;
        }

        @Override
        public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
        }
    };
    vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    vRecyclerView.setAdapter(adapter);
}
Also used : HeaderHolder(me.henrytao.recyclerview.holder.HeaderHolder) ViewGroup(android.view.ViewGroup) SimpleRecyclerViewAdapter(me.henrytao.recyclerview.SimpleRecyclerViewAdapter) LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 72 with LayoutInflater

use of android.view.LayoutInflater in project smooth-app-bar-layout by henrytao-me.

the class SmoothPreScrollActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_smooth_scroll_exit_until_collapsed);
    ButterKnife.bind(this);
    setSupportActionBar(vToolbar);
    vToolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    mAdapter = new DynamicAdapter<>(me.henrytao.smoothappbarlayoutdemo.util.Utils.getSampleData());
    RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {

        @Override
        public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return null;
        }

        @Override
        public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
        }
    };
    vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    vRecyclerView.setAdapter(adapter);
    ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {

        @Override
        public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
            return false;
        }

        @Override
        public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
            mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
        }
    });
    itemTouchHelper.attachToRecyclerView(vRecyclerView);
    Utils.intPreScroll(vSmoothAppBarLayout, vRecyclerView, 300);
}
Also used : ViewGroup(android.view.ViewGroup) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) HeaderHolder(me.henrytao.recyclerview.holder.HeaderHolder) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) SimpleRecyclerViewAdapter(me.henrytao.recyclerview.SimpleRecyclerViewAdapter) LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView)

Example 73 with LayoutInflater

use of android.view.LayoutInflater in project smooth-app-bar-layout by henrytao-me.

the class SmoothQuickReturnActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_smooth_quick_return);
    ButterKnife.bind(this);
    setSupportActionBar(vToolbar);
    vToolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    mAdapter = new DynamicAdapter<>(Utils.getSampleData());
    RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {

        @Override
        public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return null;
        }

        @Override
        public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
        }
    };
    vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    vRecyclerView.setAdapter(adapter);
    ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {

        @Override
        public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
            return false;
        }

        @Override
        public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
            mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
        }
    });
    itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
Also used : ViewGroup(android.view.ViewGroup) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) HeaderHolder(me.henrytao.recyclerview.holder.HeaderHolder) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) SimpleRecyclerViewAdapter(me.henrytao.recyclerview.SimpleRecyclerViewAdapter) LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView)

Example 74 with LayoutInflater

use of android.view.LayoutInflater in project smooth-app-bar-layout by henrytao-me.

the class SmoothScrollActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_smooth_scroll);
    ButterKnife.bind(this);
    setSupportActionBar(vToolbar);
    vToolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    mAdapter = new DynamicAdapter<>(Utils.getSampleData());
    RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {

        @Override
        public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return null;
        }

        @Override
        public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
        }
    };
    vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    vRecyclerView.setAdapter(adapter);
    ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {

        @Override
        public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
            return false;
        }

        @Override
        public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
            mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
        }
    });
    itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
Also used : ViewGroup(android.view.ViewGroup) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) HeaderHolder(me.henrytao.recyclerview.holder.HeaderHolder) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) SimpleRecyclerViewAdapter(me.henrytao.recyclerview.SimpleRecyclerViewAdapter) LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView)

Example 75 with LayoutInflater

use of android.view.LayoutInflater in project smooth-app-bar-layout by henrytao-me.

the class SmoothScrollExitUntilCollapsedActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_smooth_scroll_exit_until_collapsed);
    ButterKnife.bind(this);
    setSupportActionBar(vToolbar);
    vToolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    mAdapter = new DynamicAdapter<>(Utils.getSampleData());
    RecyclerView.Adapter adapter = new SimpleRecyclerViewAdapter(mAdapter) {

        @Override
        public RecyclerView.ViewHolder onCreateFooterViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return null;
        }

        @Override
        public RecyclerView.ViewHolder onCreateHeaderViewHolder(LayoutInflater layoutInflater, ViewGroup viewGroup) {
            return new HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);
        }
    };
    vRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    vRecyclerView.setAdapter(adapter);
    ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {

        @Override
        public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
            return false;
        }

        @Override
        public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
            mAdapter.remove((int) viewHolder.itemView.getTag(R.id.tag_position));
        }
    });
    itemTouchHelper.attachToRecyclerView(vRecyclerView);
}
Also used : ViewGroup(android.view.ViewGroup) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) HeaderHolder(me.henrytao.recyclerview.holder.HeaderHolder) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) SimpleRecyclerViewAdapter(me.henrytao.recyclerview.SimpleRecyclerViewAdapter) LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView)

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