Search in sources :

Example 11 with RecyclerView

use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.

the class RecyclerViewActivity method getRecyclerView.

public RecyclerView getRecyclerView() {
    if (rv == null) {
        rv = new RecyclerView(this);
        rv.setHasFixedSize(true);
        setContentView(rv);
    }
    return (rv);
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView)

Example 12 with RecyclerView

use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.

the class RecyclerViewActivity method getRecyclerView.

public RecyclerView getRecyclerView() {
    if (rv == null) {
        rv = new RecyclerView(this);
        rv.setHasFixedSize(true);
        setContentView(rv);
    }
    return (rv);
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView)

Example 13 with RecyclerView

use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.

the class RecyclerViewActivity method getRecyclerView.

public RecyclerView getRecyclerView() {
    if (rv == null) {
        rv = new RecyclerView(this);
        rv.setHasFixedSize(true);
        setContentView(rv);
    }
    return (rv);
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView)

Example 14 with RecyclerView

use of android.support.v7.widget.RecyclerView in project UltimateAndroid by cymcsg.

the class SnackbarRecyclerViewSampleActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.snack_bar_activity_recyclerview_sample);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mRecyclerView = (RecyclerView) findViewById(android.R.id.list);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    List<String> data = new ArrayList<String>();
    for (int i = 0; i < 25; i++) {
        data.add(String.format("Item %d", (i + 1)));
    }
    SimpleDataAdapter adapter = new SimpleDataAdapter(android.R.layout.simple_list_item_1, data, this);
    mRecyclerView.setAdapter(adapter);
}
Also used : ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 15 with RecyclerView

use of android.support.v7.widget.RecyclerView in project GeekNews by codeestX.

the class WechatMainFragment method initEventAndData.

@Override
protected void initEventAndData() {
    mList = new ArrayList<>();
    mAdapter = new WechatAdapter(mContext, mList);
    rvWechatList.setLayoutManager(new LinearLayoutManager(mContext));
    rvWechatList.setAdapter(mAdapter);
    rvWechatList.addOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            int lastVisibleItem = ((LinearLayoutManager) rvWechatList.getLayoutManager()).findLastVisibleItemPosition();
            int totalItemCount = rvWechatList.getLayoutManager().getItemCount();
            if (lastVisibleItem >= totalItemCount - 2 && dy > 0) {
                //还剩2个Item时加载更多
                if (!isLoadingMore) {
                    isLoadingMore = true;
                    mPresenter.getMoreWechatData();
                }
            }
        }
    });
    swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {

        @Override
        public void onRefresh() {
            mPresenter.getWechatData();
        }
    });
    ivProgress.start();
    mPresenter.getWechatData();
}
Also used : WechatAdapter(com.codeest.geeknews.ui.wechat.adapter.WechatAdapter) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)893 View (android.view.View)605 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)509 TextView (android.widget.TextView)191 GridLayoutManager (android.support.v7.widget.GridLayoutManager)130 ImageView (android.widget.ImageView)118 ArrayList (java.util.ArrayList)89 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)73 ViewGroup (android.view.ViewGroup)60 Toolbar (android.support.v7.widget.Toolbar)56 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)53 Intent (android.content.Intent)49 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)46 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)42 Context (android.content.Context)41 Bundle (android.os.Bundle)40 Nullable (android.support.annotation.Nullable)40 Handler (android.os.Handler)37 Rect (android.graphics.Rect)36 Paint (android.graphics.Paint)33