Search in sources :

Example 31 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class GiphyFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle bundle) {
    super.onActivityCreated(bundle);
    this.giphyAdapter = new GiphyAdapter(getActivity(), new LinkedList<GiphyImage>());
    this.giphyAdapter.setListener(this);
    this.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    this.recyclerView.setItemAnimator(new DefaultItemAnimator());
    this.recyclerView.setAdapter(giphyAdapter);
    this.recyclerView.addOnScrollListener(new GiphyScrollListener());
    getLoaderManager().initLoader(0, null, this);
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) LinkedList(java.util.LinkedList) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 32 with LinearLayoutManager

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

the class DisableExampleActivity 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);
    mRecyclerView.setLoadingMoreEnabled(false);
    mRecyclerView.setPullRefreshEnabled(false);
    listData = new ArrayList<String>();
    for (int i = 0; i < 15; i++) {
        listData.add("item" + i);
    }
    mAdapter = new MyAdapter(listData);
    mRecyclerView.setAdapter(mAdapter);
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Toolbar(android.support.v7.widget.Toolbar)

Example 33 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager 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 34 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager 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 35 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Android-ObservableScrollView by ksoichiro.

the class RecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recyclerview);
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scrollable);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    UiTestUtils.setDummyData(this, recyclerView);
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1979 RecyclerView (android.support.v7.widget.RecyclerView)1087 View (android.view.View)824 TextView (android.widget.TextView)353 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)234 ArrayList (java.util.ArrayList)204 ImageView (android.widget.ImageView)186 Intent (android.content.Intent)150 Toolbar (android.support.v7.widget.Toolbar)134 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)131 BindView (butterknife.BindView)126 GridLayoutManager (android.support.v7.widget.GridLayoutManager)125 Bundle (android.os.Bundle)109 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)107 Nullable (android.support.annotation.Nullable)98 ViewGroup (android.view.ViewGroup)82 Context (android.content.Context)81 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)81 AdapterView (android.widget.AdapterView)70 List (java.util.List)69