Java Code Examples for com.baidu.mapapi.map.offline.MKOfflineMap#TYPE_NEW_OFFLINE

The following examples show how to use com.baidu.mapapi.map.offline.MKOfflineMap#TYPE_NEW_OFFLINE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OfflineMapFragment.java    From BmapLite with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onGetOfflineMapState(int type, int state) {
    switch (type) {
        case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: {
            MKOLUpdateElement update = mOffline.getUpdateInfo(state);
            // 处理下载进度更新提示
            if (update != null) {
                LogUtils.debug(String.format("%s : %d%%", update.cityName, update.ratio));
            }
        }
        break;
        case MKOfflineMap.TYPE_NEW_OFFLINE:
            // 有新离线地图安装
            LogUtils.debug(String.format("add offlinemap num:%d", state));
            break;
        case MKOfflineMap.TYPE_VER_UPDATE:
            // 版本更新提示
            // MKOLUpdateElement e = mOffline.getUpdateInfo(state);
            break;
        default:
            break;
    }
}
 
Example 2
Source File: OfflineMapFragment.java    From BmapLite with Apache License 2.0 6 votes vote down vote up
@Override
public void onGetOfflineMapState(int type, int state) {
    switch (type) {
        case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: {
            MKOLUpdateElement update = mOffline.getUpdateInfo(state);
            // 处理下载进度更新提示
            if (update != null) {
                LogUtils.debug(String.format("%s : %d%%", update.cityName, update.ratio));
            }
        }
        break;
        case MKOfflineMap.TYPE_NEW_OFFLINE:
            // 有新离线地图安装
            LogUtils.debug(String.format("add offlinemap num:%d", state));
            break;
        case MKOfflineMap.TYPE_VER_UPDATE:
            // 版本更新提示
            // MKOLUpdateElement e = mOffline.getUpdateInfo(state);
            break;
        default:
            break;
    }
}
 
Example 3
Source File: BaiduDownloadMapFragment.java    From BmapLite with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onGetOfflineMapState(int type, int state) {
    switch (type) {
        case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: {
            MKOLUpdateElement update = mOffline.getUpdateInfo(state);
            // 处理下载进度更新提示
            if (update != null) {
                LogUtils.debug(String.format("%s : %d%%", update.cityName, update.ratio));
            }
        }
        break;
        case MKOfflineMap.TYPE_NEW_OFFLINE:
            // 有新离线地图安装
            LogUtils.debug(String.format("add offlinemap num:%d", state));
            break;
        case MKOfflineMap.TYPE_VER_UPDATE:
            // 版本更新
            final MKOLUpdateElement e = mOffline.getUpdateInfo(state);

            showAlertDialog("提示", e.cityName + "有新版本了,是否更新?", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    mOffline.update(e.cityID);
                }
            }, null);

            break;
        default:
            break;
    }
}
 
Example 4
Source File: BaiduDownloadMapFragment.java    From BmapLite with Apache License 2.0 5 votes vote down vote up
@Override
public void onGetOfflineMapState(int type, int state) {
    switch (type) {
        case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: {
            MKOLUpdateElement update = mOffline.getUpdateInfo(state);
            // 处理下载进度更新提示
            if (update != null) {
                LogUtils.debug(String.format("%s : %d%%", update.cityName, update.ratio));
            }
        }
        break;
        case MKOfflineMap.TYPE_NEW_OFFLINE:
            // 有新离线地图安装
            LogUtils.debug(String.format("add offlinemap num:%d", state));
            break;
        case MKOfflineMap.TYPE_VER_UPDATE:
            // 版本更新
            final MKOLUpdateElement e = mOffline.getUpdateInfo(state);

            showAlertDialog("提示", e.cityName + "有新版本了,是否更新?", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    mOffline.update(e.cityID);
                }
            }, null);

            break;
        default:
            break;
    }
}