package com.utopiaindustries.qualitychecker.ui.fragments;

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

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;

import com.utopiaindustries.qualitychecker.R;

public class ForthStepFragment extends Fragment implements View.OnClickListener {


    private NavController navController;
    private Button leftFab,rightFab;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_forth_step , container, false );
        leftFab = view.findViewById( R.id.button_left_frag_4 );
        rightFab = view.findViewById( R.id.button_right_frag_4 );

        // set on click listener
        leftFab.setOnClickListener( this );
        rightFab.setOnClickListener( this );
        return view;
    }

    @Override
    public void onClick(View v) {
        navController = Navigation.findNavController( requireView() );
        if( v.getId() == R.id.button_left_frag_4 ){
            navController.navigate( R.id.action_forthStepFragment_to_thirdStepFragment );
        }
    }
}
