Search in sources :

Example 6 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project remusic by aa112901.

the class RadioDetailActivity method setList.

private void setList() {
    recyclerView = (ObservableRecyclerView) findViewById(R.id.recyclerview);
    recyclerView.setScrollViewCallbacks(RadioDetailActivity.this);
    recyclerView.setLayoutManager(new LinearLayoutManager(RadioDetailActivity.this));
    recyclerView.setHasFixedSize(false);
    mAdapter = new PlaylistDetailAdapter(RadioDetailActivity.this, adapterList);
    recyclerView.setAdapter(mAdapter);
    recyclerView.addItemDecoration(new DividerItemDecoration(RadioDetailActivity.this, DividerItemDecoration.VERTICAL_LIST));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration)

Example 7 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project remusic by aa112901.

the class SearchMusicFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.recylerview, container, false);
    if (getArguments() != null) {
        songInfos = getArguments().getParcelableArrayList("searchMusic");
    }
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView.setLayoutManager(layoutManager);
    mAdapter = new MusicAdapter(songInfos);
    recyclerView.setAdapter(mAdapter);
    recyclerView.setHasFixedSize(true);
    recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST));
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) Nullable(android.support.annotation.Nullable)

Example 8 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.

the class OkHttpActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recycler);
    initToolBar(toolbar, true, "OkGo功能介绍");
    initData();
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(new MainAdapter(this));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.lzy.demo.base.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 9 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.

the class RxActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recycler);
    initToolBar(toolbar, true, "OkRx使用示例");
    initData();
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(new RxActivity.MainAdapter(this));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.lzy.demo.base.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 10 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project XRecyclerView by jianghejie.

the class ItemDecorationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recyclerview);
    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mRecyclerView = (XRecyclerView) this.findViewById(R.id.recyclerview);
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    mRecyclerView.setLayoutManager(layoutManager);
    Drawable dividerDrawable = ContextCompat.getDrawable(this, R.drawable.divider_sample);
    mRecyclerView.addItemDecoration(mRecyclerView.new DividerItemDecoration(dividerDrawable));
    mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
    mRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
    mRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey);
    View header = LayoutInflater.from(this).inflate(R.layout.recyclerview_header, (ViewGroup) findViewById(android.R.id.content), false);
    mRecyclerView.addHeaderView(header);
    mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {

        @Override
        public void onRefresh() {
            refreshTime++;
            times = 0;
            new Handler().postDelayed(new Runnable() {

                public void run() {
                    listData.clear();
                    for (int i = 0; i < 15; i++) {
                        listData.add("item" + i + "after " + refreshTime + " times of refresh");
                    }
                    mAdapter.notifyDataSetChanged();
                    mRecyclerView.refreshComplete();
                }
            }, //refresh data here
            1000);
        }

        @Override
        public void onLoadMore() {
            if (times < 2) {
                new Handler().postDelayed(new Runnable() {

                    public void run() {
                        for (int i = 0; i < 15; i++) {
                            listData.add("item" + (1 + listData.size()));
                        }
                        mRecyclerView.loadMoreComplete();
                        mAdapter.notifyDataSetChanged();
                    }
                }, 1000);
            } else {
                new Handler().postDelayed(new Runnable() {

                    public void run() {
                        for (int i = 0; i < 9; i++) {
                            listData.add("item" + (1 + listData.size()));
                        }
                        mRecyclerView.setNoMore(true);
                        mAdapter.notifyDataSetChanged();
                    }
                }, 1000);
            }
            times++;
        }
    });
    listData = new ArrayList<String>();
    for (int i = 0; i < 15; i++) {
        listData.add("item" + i);
    }
    mAdapter = new MyAdapter(listData);
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.refresh();
}
Also used : Drawable(android.graphics.drawable.Drawable) Handler(android.os.Handler) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.jcodecraeer.xrecyclerview.XRecyclerView.DividerItemDecoration) XRecyclerView(com.jcodecraeer.xrecyclerview.XRecyclerView) View(android.view.View) XRecyclerView(com.jcodecraeer.xrecyclerview.XRecyclerView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)66 RecyclerView (android.support.v7.widget.RecyclerView)37 View (android.view.View)30 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)19 TextView (android.widget.TextView)18 ImageView (android.widget.ImageView)13 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)10 DividerItemDecoration (com.wm.remusic.widget.DividerItemDecoration)9 Drawable (android.graphics.drawable.Drawable)8 DividerItemDecoration (de.madcyph3r.example.DividerItemDecoration)8 DividerItemDecoration (io.hefuyi.listener.widget.DividerItemDecoration)7 Context (android.content.Context)5 Nullable (android.support.annotation.Nullable)5 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)5 Toolbar (android.support.v7.widget.Toolbar)4 DividerItemDecoration (com.lzy.demo.base.DividerItemDecoration)4 DividerItemDecoration (org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration)4 TargetApi (android.annotation.TargetApi)3 Intent (android.content.Intent)3 ActionBar (android.support.v7.app.ActionBar)3