package kr.co.hanwha.hifive.util;

import android.app.Activity;
import android.content.Context;
import android.support.annotation.NonNull;
import android.text.TextUtils;

import kr.co.hanwha.hifive.data.model.AlarmData;
import kr.co.hanwha.hifive.data.model.NotificationData;
import kr.co.hanwha.hifive.data.source.AlarmDataRepository;

/**
 * Created by sanghoonkwon on 2018. 1. 22..
 */

public class HFNotiUtil {
    public static String KEY_NOTI_INFO_ID = "noti_info_id";
    public static String KEY_TITLE = "title";
    public static String KEY_MESSAGE = "message";
    public static String KEY_TYPE = "type";
    public static String KEY_VALUE1 = "value1";
    public static String KEY_VALUE2 = "value2";

    public static void pendingNotification(@NonNull Context context, NotificationData data) {
        if (data != null) {
            /*
            GWInfoUtil.clearNotificationData(context);

            int type = 0;
            try {
                if (TextUtils.isEmpty(data.getType()) == false)
                    type = Integer.parseInt(data.getType());
            } catch (Exception e) {
                e.printStackTrace();
            }

            if (LandingType.TASK_DETAIL.getCode() == type) {
                int taskId = 0;
                int projectId = 0;
                try {
                    if (TextUtils.isEmpty(data.getValue1()) == false)
                        taskId = Integer.parseInt(data.getValue1());
                    if (TextUtils.isEmpty(data.getValue2()) == false)
                        projectId = Integer.parseInt(data.getValue2());
                } catch (Exception e) {
                    e.printStackTrace();
                }

                GWActivityUtil.startTaskDetailActivity((Activity) context, taskId, projectId);
            }

            int noti_info_id = 0;
            try {
                if (TextUtils.isEmpty(data.getNoti_info_id()) == false)
                    noti_info_id = Integer.parseInt(data.getNoti_info_id());
            } catch (Exception e) {
                e.printStackTrace();
            }
            AlarmDataRepository.getInstance().requestNotificationOpen(context, noti_info_id, null);
            */
        }
    }

    public static void pendingNotification(@NonNull Context context, AlarmData data) {
        /*
        if (data != null) {
            int type = data.getContext_id();
            if (LandingType.TASK_DETAIL.getCode() == type) {
                int taskId = data.getTask_id();
                int projectId = data.getProject_id();
                GWActivityUtil.startTaskDetailActivity((Activity) context, taskId, projectId);
            }
        }
        */
    }
}
