package com.cygnusa.hyperm.adapter;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.cygnusa.hyperm.R;

public class MyCertificationListAdapter extends RecyclerView.Adapter<MyCertificationListAdapter.ViewHolder> {
    Context context;

    public MyCertificationListAdapter(Activity blogActivity) {
        context = blogActivity;
    }


    @NonNull
    @Override
    public MyCertificationListAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.certification_list_adapter, parent, false);
        return new MyCertificationListAdapter.ViewHolder(v);
    }

    @Override
    public void onBindViewHolder(@NonNull MyCertificationListAdapter.ViewHolder holder, int position) {
        if (position == 0) {
            holder.txtTitle.setText("Online Safety");
        } else if (position == 1) {
            holder.txtTitle.setText("Child Protection Policies");
        } else if (position == 2) {
            holder.txtTitle.setText("Anti-Harrassment");
        } else if (position == 3) {
            holder.txtTitle.setText("Emotional Intelligence");
        } else if (position == 4) {
            holder.txtTitle.setText("Avoiding & Facing Bullying");
        }
    }

    @Override
    public int getItemCount() {
        return 5;
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        View view;
        TextView txtTitle;

        public ViewHolder(@NonNull View itemView) {
            super(itemView);

            view = itemView;
            txtTitle = itemView.findViewById(R.id.txtTitle);
        }
    }
}
