use of android.support.v7.widget.DefaultItemAnimator in project LookLook by xinghongfei.
the class ZhihuFragment method initialView.
private void initialView() {
initialListener();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mLinearLayoutManager = new WrapContentLinearLayoutManager(getContext());
} else {
mLinearLayoutManager = new LinearLayoutManager(getContext());
}
recycle.setLayoutManager(mLinearLayoutManager);
recycle.setHasFixedSize(true);
recycle.addItemDecoration(new GridItemDividerDecoration(getContext(), R.dimen.divider_height, R.color.divider));
// TODO: 16/8/13 add animation
recycle.setItemAnimator(new DefaultItemAnimator());
recycle.setAdapter(zhihuAdapter);
recycle.addOnScrollListener(loadingMoreListener);
// recycle.addOnScrollListener(tooldimissListener);
if (connected) {
loadDate();
}
}
use of android.support.v7.widget.DefaultItemAnimator in project CloudReader by youlookwhat.
the class SlideScrollViewActivity method initRecyclerView.
private void initRecyclerView() {
rcvGoodsList.setVisibility(View.VISIBLE);
final RCVListAdapter adapter = new RCVListAdapter(this);
View header = new View(this);
header.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
header.getLayoutParams().height = getResources().getDimensionPixelOffset(R.dimen.new_home_header_size) - getStatusBarHeight(this);
adapter.setHeader(header);
rcvGoodsList.setLayoutManager(new LinearLayoutManager(this));
rcvGoodsList.setItemAnimator(new DefaultItemAnimator());
rcvGoodsList.setAdapter(adapter);
adapter.setDataSource(Arrays.asList("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""));
adapter.notifyDataSetChanged();
rcvGoodsList.setOnScrollListener(new RecyclerView.OnScrollListener() {
public int scrolledY = 0;
@Override
public void onScrolled(RecyclerView recyclerView, final int dx, final int dy) {
super.onScrolled(recyclerView, dx, dy);
scrolledY += dy;
scrollChangeHeader(scrolledY);
}
});
}
use of android.support.v7.widget.DefaultItemAnimator in project CloudReader by youlookwhat.
the class EverydayFragment method initRecyclerView.
private void initRecyclerView() {
bindingView.xrvEveryday.setPullRefreshEnabled(false);
bindingView.xrvEveryday.setLoadingMoreEnabled(false);
if (mHeaderView == null) {
mHeaderView = mHeaderBinding.getRoot();
bindingView.xrvEveryday.addHeaderView(mHeaderView);
}
if (mFooterView == null) {
mFooterBinding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.footer_item_everyday, null, false);
mFooterView = mFooterBinding.getRoot();
bindingView.xrvEveryday.addFootView(mFooterView, true);
bindingView.xrvEveryday.noMoreLoading();
}
bindingView.xrvEveryday.setLayoutManager(new LinearLayoutManager(getContext()));
// 需加,不然滑动不流畅
bindingView.xrvEveryday.setNestedScrollingEnabled(false);
bindingView.xrvEveryday.setHasFixedSize(false);
bindingView.xrvEveryday.setItemAnimator(new DefaultItemAnimator());
}
use of android.support.v7.widget.DefaultItemAnimator in project PhotoNoter by yydcdut.
the class MediaPhotoFragment method initUI.
@Override
public void initUI(View view) {
ButterKnife.bind(this, view);
mGalleryActivity = (GalleryActivity) getActivity();
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
mRecyclerView.setLayoutManager(gridLayoutManager);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mMediaPhotoPresenter.attachView(this);
}
use of android.support.v7.widget.DefaultItemAnimator in project SwipeRecyclerView by yanzhenjie.
the class RefreshLoadMoreActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_refresh_load_more);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setDisplayHomeAsUpEnabled(true);
mContext = this;
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
mSwipeRefreshLayout.setOnRefreshListener(mOnRefreshListener);
mDataList = new ArrayList<>();
for (int i = 0; i < size; i++) {
mDataList.add("我是第" + i + "个。");
}
mSwipeMenuRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.recycler_view);
// 布局管理器。
mSwipeMenuRecyclerView.setLayoutManager(new LinearLayoutManager(this));
// 如果Item够简单,高度是确定的,打开FixSize将提高性能。
mSwipeMenuRecyclerView.setHasFixedSize(true);
// 设置Item默认动画,加也行,不加也行。
mSwipeMenuRecyclerView.setItemAnimator(new DefaultItemAnimator());
// 添加分割线。
mSwipeMenuRecyclerView.addItemDecoration(new ListViewDecoration());
// 添加滚动监听。
mSwipeMenuRecyclerView.addOnScrollListener(mOnScrollListener);
// 为SwipeRecyclerView的Item创建菜单就两句话,不错就是这么简单:
// 设置菜单创建器。
mSwipeMenuRecyclerView.setSwipeMenuCreator(swipeMenuCreator);
// 设置菜单Item点击监听。
mSwipeMenuRecyclerView.setSwipeMenuItemClickListener(menuItemClickListener);
mMenuAdapter = new MenuAdapter(mDataList);
mMenuAdapter.setOnItemClickListener(onItemClickListener);
mSwipeMenuRecyclerView.setAdapter(mMenuAdapter);
}
Aggregations