package com.light.prank.sound.app.allui.main;

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

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

import com.light.prank.sound.app.utils.App;
import com.light.prank.sound.app.utils.MyItemSpace;
import com.light.prank.sound.app.dataListener.SoundsWrapper;
import com.light.prank.sound.app.dataListener.PrankBean;
import com.prank.tool.sounds.app.databinding.FragmentMainBinding;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;


public class FragmentMain extends Fragment {


    private FragmentMainBinding binding;

    private List<PrankBean> list;


    public FragmentMain() {
    }

    @SuppressWarnings("unused")
    public static FragmentMain newInstance() {
        FragmentMain fragment = new FragmentMain();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        binding = FragmentMainBinding.inflate(inflater);

        MyItemSpace itemHelper = new MyItemSpace(7, 7, 7);
        binding.recyclerView.addItemDecoration(itemHelper);
        binding.recyclerView.setLayoutManager(new GridLayoutManager(requireContext(), 2));
        Collections.shuffle(App.bean);
        binding.recyclerView.setAdapter(new AdapterMain(requireContext(), App.bean ));



        return binding.getRoot();
    }





}