Search in sources :

Example 1 with WrapContentLinearLayoutManager

use of com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager in project LookLook by xinghongfei.

the class MeiziFragment method initialView.

private void initialView() {
    meiziAdapter = new MeiziAdapter(getContext());
    linearLayoutManager = new WrapContentLinearLayoutManager(getContext());
    intialListener();
    mRecycleMeizi.setLayoutManager(linearLayoutManager);
    mRecycleMeizi.setAdapter(meiziAdapter);
    mRecycleMeizi.addOnScrollListener(loadmoreListener);
    new Once(getContext()).show("tip_guide_6", new Once.OnceCallback() {

        @Override
        public void onOnce() {
            Snackbar.make(mRecycleMeizi, getString(R.string.meizitips), Snackbar.LENGTH_INDEFINITE).setAction(R.string.meiziaction, new View.OnClickListener() {

                @Override
                public void onClick(View view) {
                }
            }).show();
        }
    });
    mRecycleMeizi.setItemAnimator(new DefaultItemAnimator());
    loadDate();
}
Also used : Once(com.looklook.xinghongfei.looklook.util.Once) WrapContentLinearLayoutManager(com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager) MeiziAdapter(com.looklook.xinghongfei.looklook.adapter.MeiziAdapter) BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 2 with WrapContentLinearLayoutManager

use of com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager in project LookLook by xinghongfei.

the class TopNewsFragment method initialView.

private void initialView() {
    initialListener();
    mLinearLayoutManager = new WrapContentLinearLayoutManager(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(mTopNewsAdapter);
    recycle.addOnScrollListener(loadingMoreListener);
    if (connected) {
        loadDate();
    }
}
Also used : WrapContentLinearLayoutManager(com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager) GridItemDividerDecoration(com.looklook.xinghongfei.looklook.view.GridItemDividerDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 3 with WrapContentLinearLayoutManager

use of com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager 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)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)3 WrapContentLinearLayoutManager (com.looklook.xinghongfei.looklook.widget.WrapContentLinearLayoutManager)3 GridItemDividerDecoration (com.looklook.xinghongfei.looklook.view.GridItemDividerDecoration)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 BindView (butterknife.BindView)1 MeiziAdapter (com.looklook.xinghongfei.looklook.adapter.MeiziAdapter)1 Once (com.looklook.xinghongfei.looklook.util.Once)1