package com.kaixed.kchat.view.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.kaixed.kchat.databinding.FunctionGridItemBinding;

import java.util.List;

/**
 * @Author: kaixed
 * @Date: 2024/8/16 20:53
 * @Description: TODO
 */
public class FunctionPanelAdapter extends BaseAdapter {

    private List<String> strings;
    private final Context context;

    public FunctionPanelAdapter(List<String> strings, Context context) {
        this.strings = strings;
        this.context = context;
    }

    @Override
    public int getCount() {
        return strings == null ? 0 : strings.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        FunctionGridItemBinding binding;
        if (convertView == null) {
            binding = FunctionGridItemBinding.inflate(LayoutInflater.from(context), parent, false);
            convertView = binding.getRoot();
            convertView.setTag(binding);
        } else {
            binding = (FunctionGridItemBinding) convertView.getTag();
        }


        return convertView;
    }

}
