use of android.support.v7.widget.DefaultItemAnimator 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);
}
use of android.support.v7.widget.DefaultItemAnimator in project FastDev4Android by jiangqqlmj.
the class RecyclerViewTestActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recyclerview_test_layout);
top_bar_linear_back = (LinearLayout) this.findViewById(R.id.top_bar_linear_back);
btn_add = (Button) this.findViewById(R.id.btn_add);
btn_delete = (Button) this.findViewById(R.id.btn_delete);
top_bar_linear_back.setOnClickListener(new CustomOnClickListener());
btn_add.setOnClickListener(new CustomOnClickListener());
btn_delete.setOnClickListener(new CustomOnClickListener());
top_bar_title = (TextView) this.findViewById(R.id.top_bar_title);
top_bar_title.setText("RecyclerView使用实例");
//开始设置RecyclerView
recyclerView_one = (RecyclerView) this.findViewById(R.id.recyclerView_one);
recyclerView_one.setHasFixedSize(true);
//1.LinearLayoutManager 线性布局类型
mLayoutManager = new LinearLayoutManager(this);
mLayoutManager.setOrientation(OrientationHelper.VERTICAL);
recyclerView_one.setLayoutManager(mLayoutManager);
//2.GridLayoutManager 表格布局类型
// GridLayoutManager girdLayoutManager=new GridLayoutManager(this,4);
// recyclerView_one.setLayoutManager(girdLayoutManager);
//3.采用StaggeredGridLayoutManager 流式布局类型
// StaggeredGridLayoutManager staggeredGridLayoutManager=new StaggeredGridLayoutManager(2,OrientationHelper.VERTICAL);
// recyclerView_one.setLayoutManager(staggeredGridLayoutManager);
//添加默认的动画效果
recyclerView_one.setItemAnimator(new DefaultItemAnimator());
//添加分隔线
recyclerView_one.addItemDecoration(new AdvanceDecoration(this, OrientationHelper.VERTICAL));
mAdapter = new TestRecyclerAdapter(this, new TestRecyclerAdapter.OnRecyclerItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Toast.makeText(RecyclerViewTestActivity.this, "点击了第" + position + "项", Toast.LENGTH_SHORT).show();
}
});
recyclerView_one.setAdapter(mAdapter);
}
use of android.support.v7.widget.DefaultItemAnimator in project FastDev4Android by jiangqqlmj.
the class RecyclerGalleryActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recycler_gallery_layout);
top_bar_linear_back = (LinearLayout) this.findViewById(R.id.top_bar_linear_back);
btn_add = (Button) this.findViewById(R.id.btn_add);
btn_delete = (Button) this.findViewById(R.id.btn_delete);
top_bar_linear_back.setOnClickListener(new CustomOnClickListener());
btn_add.setOnClickListener(new CustomOnClickListener());
btn_delete.setOnClickListener(new CustomOnClickListener());
top_bar_title = (TextView) this.findViewById(R.id.top_bar_title);
top_bar_title.setText("RecyclerView打造Gallery效果");
//初始化RecyclerView控件
gallery_recycler = (RecyclerView) this.findViewById(R.id.gallery_recycler);
//固定高度
gallery_recycler.setHasFixedSize(true);
//创建布局管理器
LinearLayoutManager linearLayoutManager = new CustomLinearLayoutManager(this);
//设置横向
linearLayoutManager.setOrientation(OrientationHelper.HORIZONTAL);
//设置布局管理器
gallery_recycler.setLayoutManager(linearLayoutManager);
//设置分割线
gallery_recycler.addItemDecoration(new TestDecoration(this));
//设置动画
gallery_recycler.setItemAnimator(new DefaultItemAnimator());
//创建适配器
adapter = new GalleryRecyclerAdapter(this);
//绑定适配器
gallery_recycler.setAdapter(adapter);
adapter.setOnRecyclerViewItemClickListener(new GalleryRecyclerAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Toast.makeText(RecyclerGalleryActivity.this, "您点击的Item的索引为:" + position, Toast.LENGTH_SHORT).show();
}
});
}
use of android.support.v7.widget.DefaultItemAnimator 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));
}
use of android.support.v7.widget.DefaultItemAnimator 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));
}
Aggregations