Search in sources :

Example 1 with DivItemDecoration

use of com.litingzhe.justandroid.ui.listandGridView.wechatCircle.widgets.DivItemDecoration in project JustAndroid by chinaltz.

the class WeChatCircleActivity method initView.

private void initView() {
    initUploadDialog();
    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    layoutManager = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.addItemDecoration(new DivItemDecoration(2, true));
    recyclerView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (edittextbody.getVisibility() == View.VISIBLE) {
                return true;
            }
            return false;
        }
    });
    recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
        }

        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            super.onScrollStateChanged(recyclerView, newState);
            if (newState == RecyclerView.SCROLL_STATE_IDLE) {
                Glide.with(mContext).resumeRequests();
            } else {
                Glide.with(mContext).pauseRequests();
            }
        }
    });
    circleAdapter = new CircleAdapter(this);
    recyclerView.setAdapter(circleAdapter);
    edittextbody = (LinearLayout) findViewById(R.id.editTextBodyLl);
    editText = (EditText) findViewById(R.id.circleEt);
    sendIv = (ImageView) findViewById(R.id.sendIv);
    sendIv.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
        }
    });
    setViewTreeObserver();
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DivItemDecoration(com.litingzhe.justandroid.ui.listandGridView.wechatCircle.widgets.DivItemDecoration) CommentListView(com.litingzhe.justandroid.ui.listandGridView.wechatCircle.widgets.CommentListView) ImageView(android.widget.ImageView) BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) MotionEvent(android.view.MotionEvent) CircleAdapter(com.litingzhe.justandroid.ui.listandGridView.adapter.CircleAdapter)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 CircleAdapter (com.litingzhe.justandroid.ui.listandGridView.adapter.CircleAdapter)1 CommentListView (com.litingzhe.justandroid.ui.listandGridView.wechatCircle.widgets.CommentListView)1 DivItemDecoration (com.litingzhe.justandroid.ui.listandGridView.wechatCircle.widgets.DivItemDecoration)1