package com.sinata.bc_chat.utils;

import android.text.TextUtils;

import com.bc_chat.bc_base.entity.FriendApplyRecordBean;
import com.bc_chat.bc_base.entity.NavEntity;
import com.google.gson.reflect.TypeToken;
import com.zhaohaoting.framework.utils.Preferences;

import java.util.ArrayList;
import java.util.List;

public class NavDataUtil {
    public static List<NavEntity> getNavData() {
        String json = Preferences.getNavJson();
        if (!TextUtils.isEmpty(json)) {
            return GsonUtil.gsonToBean(json, new TypeToken<List<NavEntity>>() {
            }.getType());
        }
        return new ArrayList<>();
    }

    public static boolean isShowTipsMsg(List<FriendApplyRecordBean> dataBean) {
        for (int index = 0; index < dataBean.size(); index++) {
            if (dataBean.get(index).getType() == 2 && dataBean.get(index).getState() == 1) {
                return true;
            }
        }
        return false;
    }
}
