package com.jachdev.consumerprotection.ui.dashboard;

import android.content.Context;

import com.jachdev.commonlibs.base.BaseFragment;
import com.jachdev.consumerprotection.R;

import butterknife.OnClick;

public class DashboardFragment extends BaseFragment {

    private DashboardViewModel dashboardViewModel;
    private FragmentEventListener listener;

    @Override
    protected int layoutRes() {
        return R.layout.fragment_dashboard;
    }

    @Override
    public void onAttach(Context context) {
        listener = (FragmentEventListener) context;
        super.onAttach(context);
    }

    @OnClick(R.id.btn_image_rec)
    public void onImageRecognitionClick(){
        if(listener != null)
            listener.onImageRecognitionClick();
    }

    @OnClick(R.id.btn_calorie_count)
    public void onCalorieCounterClick(){
        if(listener != null)
            listener.onCalorieCounterClick();
    }

    @OnClick(R.id.btn_meal_plan)
    public void onMealPlanClick(){
        if(listener != null)
            listener.onMealPlanClick();
    }

    @OnClick(R.id.btnNearestStocks)
    public void onNearestStocksClick(){
        if(listener != null)
            listener.onNearestStocksClick();
    }

    @OnClick(R.id.btnNearestShops)
    public void onNearestShopsClick(){
        if(listener != null)
            listener.onNearestShopsClick();
    }

    @OnClick(R.id.btnImport)
    public void onImportClick(){
        if(listener != null)
            listener.onImportClick();
    }

    @OnClick(R.id.btnPrice)
    public void onPriceClick(){
        if(listener != null)
            listener.onPriceClick();
    }

    @OnClick(R.id.btnSale)
    public void onSaleClick(){
        if(listener != null)
            listener.onSaleClick();
    }

    @OnClick(R.id.btnComplaints)
    public void onComplaintsClick(){
        if(listener != null)
            listener.onComplaintsClick();
    }

    @OnClick(R.id.btnContactUS)
    public void onContactUsClick(){
        if(listener != null)
            listener.onContactUsClick();
    }

    public interface FragmentEventListener{
        void onImageRecognitionClick();
        void onCalorieCounterClick();
        void onMealPlanClick();
        void onNearestStocksClick();
        void onNearestShopsClick();
        void onImportClick();
        void onPriceClick();
        void onComplaintsClick();
        void onContactUsClick();
        void onSaleClick();
    }
}