@Override public void onGetOfflineMapState(int type, int state) { switch (type) { case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: { MKOLUpdateElement update = mOffline.getUpdateInfo(state); // display download progress if (update != null) { mStateView.setText(String.format("%s : %d%%", update.cityName, update.ratio)); updateView(); } } break; case MKOfflineMap.TYPE_NEW_OFFLINE: // Prompt offline map update is available Log.d("Baidu offline map", String.format("add offlinemap num:%d", state)); break; case MKOfflineMap.TYPE_VER_UPDATE: // Not used yet break; default: break; } }
@Override public void onGetOfflineMapState(int type, int state) { switch (type) { case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: { MKOLUpdateElement update = mOffline.getUpdateInfo(state); // 处理下载进度更新提示 if (update != null) { stateView.setText(String.format("%s : %d%%", update.cityName, update.ratio)); updateView(); progressBar.setProgress(update.ratio); } } break; } }
@Override public void onGetOfflineMapState(int type, int state) { // TODO Auto-generated method stub switch (type) { case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: { MKOLUpdateElement update = mOffline.getUpdateInfo(state); // 处理下载进度更新提示 if (update != null) { mRatioTextView.setText(String.format("%d%%", update.ratio)); if(update.ratio==100){ mImageButtonDownLoad.setVisibility(View.GONE); mRatioTextView.setVisibility(View.GONE); } updateView(); } } } }
public static void initialize() { mListener = new MKOfflineMapListener() { @Override public void onGetOfflineMapState(int i, int j) { EventBus.notify(EventTypes.OFFLINE_MAP_UPDATE); } }; mMKOfflineMap = new MKOfflineMap(); mMKOfflineMap.init(mListener); mImportedMapCount = mMKOfflineMap.importOfflineData(); mDownloadingCityIDs = new ArrayList<Integer>(); }
@Override public void onBindDialogView(View view){ // Initialize Baidu Map library com.baidu.mapapi.SDKInitializer.initialize(this.getContext().getApplicationContext()); mBindDialogView = view; mOffline = new MKOfflineMap(); mOffline.init(this); initView(view); super.onBindDialogView(view); }
@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_offline_map); // 初始化离线地图管理 mOffline = new MKOfflineMap(); mOffline.init(this); initViews(); viewpager.setCurrentItem(1); }
public OfflineMapManagerAdapter(Context context, MKOfflineMap mOffline, OnOfflineItemStatusChangeListener listener) { super(context); // TODO Auto-generated constructor stub this.context = context; this.mOffline = mOffline; this.listener = listener; }
public OfflineMapAdapter(Context context, MKOfflineMap mOffline, OnOfflineItemStatusChangeListener listener) { super(context); // TODO Auto-generated constructor stub this.context = context; this.mOffline = mOffline; this.listener = listener; }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); this.context = this; SDKInitializer.initialize(getApplicationContext()); setContentView(R.layout.activity_download); mOffline = new MKOfflineMap(); mOffline.init(this); initView(); initAdapter(); province.setAdapter(arrayAdapterProvince); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_offline_map); try { mOffline = new MKOfflineMap(); mOffline.init(this); init(); } catch (Exception e) { e.printStackTrace(); } }
public OfflineExpandableListAdapter(Context context, MKOfflineMap mOffline, OnOfflineItemStatusChangeListener listener){ this.context = context; this.mOffline = mOffline; this.listener = listener; inflater = LayoutInflater.from(context); }