Search in sources :

Example 91 with DefaultItemAnimator

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();
    }
}
Also used : WrapContentLinearLayoutManager(com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) WrapContentLinearLayoutManager(com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager) GridItemDividerDecoration(com.looklook.xinghongfei.looklook.view.GridItemDividerDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 92 with DefaultItemAnimator

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);
        }
    });
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) DiscoverScrollView(com.example.jingbin.cloudreader.view.DiscoverScrollView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) RCVListAdapter(com.example.jingbin.cloudreader.view.test.RCVListAdapter) LinearLayout(android.widget.LinearLayout) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 93 with DefaultItemAnimator

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());
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 94 with 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);
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 95 with DefaultItemAnimator

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);
}
Also used : ListViewDecoration(com.yanzhenjie.swiperecyclerview.view.ListViewDecoration) MenuAdapter(com.yanzhenjie.swiperecyclerview.adapter.MenuAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ActionBar(android.support.v7.app.ActionBar) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)103 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)72 RecyclerView (android.support.v7.widget.RecyclerView)63 View (android.view.View)55 TextView (android.widget.TextView)30 ImageView (android.widget.ImageView)25 ArrayList (java.util.ArrayList)16 ClickItemTouchListener (com.sdsmdg.harjot.MusicDNA.clickitemtouchlistener.ClickItemTouchListener)14 GridLayoutManager (android.support.v7.widget.GridLayoutManager)13 Toolbar (android.support.v7.widget.Toolbar)13 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)10 FastAdapter (com.mikepenz.fastadapter.FastAdapter)10 UnifiedTrack (com.sdsmdg.harjot.MusicDNA.models.UnifiedTrack)10 MaterializeBuilder (com.mikepenz.materialize.MaterializeBuilder)9 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)8 LocalTrack (com.sdsmdg.harjot.MusicDNA.models.LocalTrack)8 DividerItemDecoration (de.madcyph3r.example.DividerItemDecoration)8 Button (android.widget.Button)7 Random (java.util.Random)6 Intent (android.content.Intent)5