package com.navinfo.outdoor.api;

import android.widget.TextView;

import com.navinfo.outdoor.R;
import com.navinfo.outdoor.bean.JobSearchBean;
import com.navinfo.outdoor.util.SdkFolderCreate;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.tencent.map.geolocation.TencentLocation;
import com.tencent.tencentmap.mapsdk.maps.MapView;
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;

import java.io.File;

/**
 * 常量
 */
public class Constant {
    /**
     * 当前网络不可用
     */
    public static final CharSequence NETWORK_UNAVAILABLE = "当前网络不可用，请检查网络设置";

    /**
     * 位置权限
     */
    public static final String SET_LOCATION_PERMISSION = "请在“设置”中给予“TengXunMap”位置权限,否则当前功能将不可使用";
    public static final String SET_LOCATION = "请在“设置”中给予权限否则当前功能将不可使用";


    public static final String GET_ERR_MESSAGE1 = "设备缺少使用腾讯定位服务需要的基本条件";
    public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
    public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";

    public static String BASE_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
    // 保存图片的目录
    public static String PICTURE_FOLDER;

    public static String VIDEOS_;
    public static String POI_DAO;
    public static String SHARED_PREFERENCES = "navInfo";
    public static String DATA_FILE = "dataFile";
    //下载文件
    public static final String NAVINFO_APk = BASE_FOLDER + "/apk/";

    public static void initRootFolder(String userId) {
        BASE_FOLDER += "/" + userId;
        PICTURE_FOLDER = BASE_FOLDER + "/picture";
        POI_DAO = BASE_FOLDER + "/BaseDao/";
        VIDEOS_ = BASE_FOLDER + "/videos";

        // 初始化应用目录
        File baseFolder = new File(BASE_FOLDER); // 数据库文件夹路径
        if (!baseFolder.exists()) {
            SdkFolderCreate.mkdirs(baseFolder.getAbsolutePath());
        }

        File picFolder = new File(PICTURE_FOLDER); // 视频照片文件夹路径
        if (!picFolder.exists()) {
            SdkFolderCreate.mkdirs(picFolder.getAbsolutePath());
        }
    }

    // 申请权限的RequestCode
    public static final int PERMISSION_REQUEST_CODE = 0x100;

    public static final int ROAD_PICTURE = 101;
    //筛选
    public static final int FILTER_CODE = 0x200;


    /**
     * 存储用户信息
     * access_token 后续需求需要用到的key 过期时间8小时
     * refresh_token 刷新token用 过期时间1个月
     * userId 用户id
     * username 用户编号
     */
    public static String ACCESS_TOKEN = null;
    public static String REFRESH_TOKEN = null;
    public static String USERID = null;

    public static String USER_NAME = null;//登录账号/修改账号/注册
    public static String PASS_WORD = null;//登录密码/修改密码/注册密码
    public static String AUDITMSG = null;//身份证审核信息
    public static int AUDITSTATUS = -1;//身份证审核状态 //0：不通過，1：通過，-1：待审核
    public static String ID_NUM = null;//身份证号
    public static String NAME = null;//身份证姓名
    public static String ID_NUMBER = null;//银行卡号
    public static String BANKACCOUNT = null;//银行卡编码
    public static int SEX = -1;//性别
    public static String QQ = null;
    public static String WECHAT = null;
    public static String MOBILE = null;//手机号


    //message word  值
    public static final int TREASURE_FRAGMENT = 100;//抽屉界面的展示和隐藏
    public static final int TREASURE_WORD = 39;//poi 对地图页面marker 的一个展示  编辑
    public static final int TREASURE_CHECKED_WORD = 40;//poi 对地图页面marker 的一个展示 确定
    public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数
    public static final int POI_WORD = 2;//地图页面marker 的经纬都回传
    public static final int FILTER_LIST_ITEM = 5;//点击筛选的item
    public static final int GATHER_GET = 6;//点击开始采集
    public static final int TREASURE_GATHER_GET_WORD = 7;//领取采集页面其他marker 的回传
    public static final int MAIN_BUTTON_VISIABLE = 8; // 控制主界面各个按钮显隐状态的what值
    public static final int UN_POLY_GEN_TASK = 9; // 面妆任务的立即采集
    public static final int POI_DRAWER = 10; //设置每个页面显示屏幕的位置
    public static final int GATHER_GET_RETURN = 11;//参加领取的返回
    public static final int MAIN_CHARGING_STATION = 13;//充电站的Fragment 对地图页面marker 的一个展示 编辑
    public static final int MAIN_CHARGING_CHECKED_STATION = 43;//充电站的Fragment 对地图页面marker 的一个展示 确定
    public static final int CHARGING_STATION_WORD = 15;//地图页面marker 的经纬都回传
    public static final int CHARGING_STATION = 16;//跳转到充电桩
    public static final int CHARGING_STATION_ITEM = 17;//适配器的item跳转到充电桩
    public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传
    public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站
    public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示 编辑
    public static final int MAIN_CHECKED_OTHER = 24;//其他的Fragment 对地图页面marker 的一个展示 确定
    public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传
    public static final int FILTER_DATA_CLEAR = 27;//清空筛选界面的数据
    public static final int JOB_SEARCH_WORD = 28;//任务搜索的网络数据
    public static final int JOB_SEARCH_POI_WORD = 29;//任务搜索的本地数据
    public static final int GATHER_GET_MAP = 30;//地图点击marker  后弹窗点击开始采集
    public static final int HOME_MINE = 32;//点击我的实时监听刷新
    public static final int PILE_MARKER_SHOW = 33;//刷新充电桩的显示
    public static final int JOB_WORD_MONITOR = 34;//寻宝界面和删选的刷新
    public static final int EVENT_WHAT_LOCATION_CHANGE = 35; // 定位位置更新的Event的What值
    //    public static final int CHARGING_PILE_BODY = 36;//充电装的body
//    public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片
    public static final int Filter_WhAT_RECYCLER = 39;//刪選適配器的刷新
    public static final int EVENT_WHAT_CURRENT_MARKER = 41; // 显示当前正在编辑的POI类型数据的Event的What值
    //CompleteTask
    public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集
    public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面

    public static final int EVENT_WORK_HOME = 45; //切换到寻宝
    public static final int PICTURE_VIDEO_WORD = 48; //视频页面崩溃后发给poi录像和道路

    public static final int REGISTER_WORD = 46; //注册的返回

    public static int NUMBER = 200; //任务个数
    public static int LIMIT_TTPE = -1; //权限类型，普通任务-0，专属任务-1
    public static int TASK_TYPE = -1; // 任务类型
    public static int TASK_STASTUS = -1; // 任务状态
    public static String CODE = ""; //区号
    /**
     * 用户当前位置
     */
    public static TencentLocation currentLocation;
    public static LatLng markerLatlng;
    //marker 图标

//    public static final BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg);
//    public static BitmapDescriptor ROAD_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
//    public static BitmapDescriptor STATION_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
//    public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);


    public static JobSearchBean jobSearchBean;//数据
    public static MapView treasureMap;

    public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
    public static final String INTENT_VIDEO_ORATATION = "INTENT_VIDEO_ORATATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意

    public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置

    public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重

    public static TencentMap.OnMarkerClickListener markerClickListener=null;


    //--/
}
