Search in sources :

Example 6 with FavortItem

use of com.yiw.circledemo.bean.FavortItem in project CircleDemo by Naoki2015.

the class MainActivity method update2DeleteFavort.

@Override
public void update2DeleteFavort(int circlePosition, String favortId) {
    CircleItem item = (CircleItem) circleAdapter.getDatas().get(circlePosition);
    List<FavortItem> items = item.getFavorters();
    for (int i = 0; i < items.size(); i++) {
        if (favortId.equals(items.get(i).getId())) {
            items.remove(i);
            circleAdapter.notifyDataSetChanged();
            //circleAdapter.notifyItemChanged(circlePosition+1);
            return;
        }
    }
}
Also used : CircleItem(com.yiw.circledemo.bean.CircleItem) FavortItem(com.yiw.circledemo.bean.FavortItem) SuppressLint(android.annotation.SuppressLint)

Aggregations

FavortItem (com.yiw.circledemo.bean.FavortItem)6 CircleItem (com.yiw.circledemo.bean.CircleItem)2 ArrayList (java.util.ArrayList)2 SuppressLint (android.annotation.SuppressLint)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SpannableStringBuilder (android.text.SpannableStringBuilder)1 View (android.view.View)1 ImagePagerActivity (com.yiw.circledemo.activity.ImagePagerActivity)1 CircleViewHolder (com.yiw.circledemo.adapter.viewholder.CircleViewHolder)1 ImageViewHolder (com.yiw.circledemo.adapter.viewholder.ImageViewHolder)1 URLViewHolder (com.yiw.circledemo.adapter.viewholder.URLViewHolder)1 VideoViewHolder (com.yiw.circledemo.adapter.viewholder.VideoViewHolder)1 CommentConfig (com.yiw.circledemo.bean.CommentConfig)1 CommentItem (com.yiw.circledemo.bean.CommentItem)1 PhotoInfo (com.yiw.circledemo.bean.PhotoInfo)1 CircleMovementMethod (com.yiw.circledemo.spannable.CircleMovementMethod)1 GlideCircleTransform (com.yiw.circledemo.utils.GlideCircleTransform)1 CircleVideoView (com.yiw.circledemo.widgets.CircleVideoView)1 CommentListView (com.yiw.circledemo.widgets.CommentListView)1 ExpandTextView (com.yiw.circledemo.widgets.ExpandTextView)1