package org.deke.risk.riskahead.fragment;


import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import org.deke.risk.riskahead.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class ReportWF_Finish_Fragment extends Fragment {

    private View viewFragment;
    private SendReportListener mCallback;
    private Button btnSendReport;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        viewFragment = inflater.inflate(R.layout.fragment_reportwf_finish, container, false);

        btnSendReport = (Button) viewFragment.findViewById(R.id.btn_reportwf_finish_send);
        btnSendReport.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mCallback.sendReport();
            }
        });

        return viewFragment;
    }

    public interface SendReportListener {
        void sendReport();
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);

        try {
            mCallback = (SendReportListener) context;
        } catch (ClassCastException e) {
            throw new ClassCastException(context.toString()
                    + " must implement SendReportListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
    }


}
