//package com.example.HomeContent;
//
//import android.content.Context;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.FrameLayout;
//import android.widget.ImageButton;
//import android.widget.ImageView;
//import android.widget.TextSwitcher;
//
//import androidx.annotation.NonNull;
//import androidx.recyclerview.widget.RecyclerView;
//
//import com.example.PersonalCenter.FeedAdapter;
//import com.example.cmknowledgegraph.R;
//
//public class HomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
//    private Context context;
//    private int itemsCount = 0;
//
//    public HomeAdapter(Context context){this.context = context;}
//
//
//    @NonNull
//    @Override
//    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
//        final View view = LayoutInflater.from(context).inflate(R.layout.item_feed, parent, false);
//
//        return new HomeAdapter.CellFeedViewHolder(view);
//    }
//
//    @Override
//    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
//        final FeedAdapter.CellFeedViewHolder holder = (FeedAdapter.CellFeedViewHolder) viewHolder;
//        bindDefaultFeedItem(position, holder);
//    }
//    private void bindDefaultFeedItem(int position, FeedAdapter.CellFeedViewHolder holder) {
//        if (position % 2 == 0) {
//            holder.ivFeedCenter.setImageResource(R.drawable.img_feed_center_1);
//            holder.ivFeedBottom.setImageResource(R.drawable.img_feed_bottom_1);
//        } else {
//            holder.ivFeedCenter.setImageResource(R.drawable.img_feed_center_2);
//            holder.ivFeedBottom.setImageResource(R.drawable.img_feed_bottom_2);
//        }
//
//        holder.btnComments.setTag(position);
//        holder.btnMore.setTag(position);
//        holder.ivFeedCenter.setTag(holder);
//        holder.btnLike.setTag(holder);
//
//    }
//    public void updateItems() {
//        itemsCount = 10;
//        notifyDataSetChanged();
//    }
//    @Override
//    public int getItemCount() {
//        return itemsCount;
//    }
//
//    @Override
//    public int getItemViewType(int position) {
//        return 1;
//    }
////    在这里构建一个cell的内容
//    private static class CellFeedViewHolder extends RecyclerView.ViewHolder {
//        ImageView ivFeedCenter;
//        ImageView ivFeedBottom;
//        ImageButton btnComments;
//        ImageButton btnLike;
//        ImageButton btnMore;
//        TextSwitcher tsLikesCounter;
//        ImageView ivUserProfile;
//        FrameLayout vImageRoot;
//
//        CellFeedViewHolder(View view) {
//            super(view);
//
//            ivFeedCenter = (ImageView) view.findViewById(R.id.ivFeedCenter);
//            ivFeedBottom = (ImageView) view.findViewById(R.id.ivFeedBottom);
//            btnComments = (ImageButton) view.findViewById(R.id.btnComments);
//            btnLike = (ImageButton) view.findViewById(R.id.btnLike);
//            btnMore = (ImageButton) view.findViewById(R.id.btnMore);
//            tsLikesCounter = (TextSwitcher) view.findViewById(R.id.tsLikesCounter);
//            ivUserProfile = (ImageView) view.findViewById(R.id.ivUserProfile);
//            vImageRoot = (FrameLayout) view.findViewById(R.id.vImageRoot);
//        }
//    }
//}
