package com.cpm.lorealbaautomation.fragements;

import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

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

import com.cpm.lorealbaautomation.R;
import com.cpm.lorealbaautomation.adapter.MyPager;


import me.relex.circleindicator.CircleIndicator;

/**
 * A fragment representing a list of Items.
 * <p/>
 * interface.
 */
public class OffersFragment extends Fragment {
    // TODO: Customize parameter argument names
    private static final String ARG_COLUMN_COUNT = "column-count";
    private MyPager myPager;

    /**
     * Mandatory empty constructor for the fragment manager to instantiate the
     * fragment (e.g. upon screen orientation changes).
     */
    public OffersFragment() {
    }

    // TODO: Customize parameter initialization
    @SuppressWarnings("unused")
    public static OffersFragment newInstance(int columnCount) {
        OffersFragment fragment = new OffersFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_COLUMN_COUNT, columnCount);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            // TODO: Customize parameters
            int mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_item_list3, container, false);
        ViewPager viewPager = view.findViewById(R.id.view_pager);
        viewPager.setAdapter(myPager);
        CircleIndicator circleIndicator = view.findViewById(R.id.circle);
        circleIndicator.setViewPager(viewPager);
        // Set the adapter
        return view;
    }

}
