package com.fun.funnyprank.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.fun.funnyprank.FunnyPrankSkin;
import com.fun.funnyprank.adapter.ThumAdapter;
import com.fun.funnyprank.databinding.FragmentMainBinding;
import com.fun.funnyprank.tools.SpaceItem;

public class MainFragment extends Fragment {

    FragmentMainBinding bind;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        bind = FragmentMainBinding.inflate(inflater, container, false);
        SpaceItem spaceItem = new SpaceItem(12, 20, 12);
        bind.marinRv.setAdapter(new ThumAdapter(requireActivity(), FunnyPrankSkin.getMyDataArrayList()));
        bind.marinRv.setLayoutManager(new GridLayoutManager(requireContext(),2));
        bind.marinRv.addItemDecoration(spaceItem);
        return bind.getRoot();
    }

}