本文整理匯總了Java中com.amap.api.maps.offlinemap.OfflineMapStatus.SUCCESS屬性的典型用法代碼示例。如果您正苦於以下問題:Java OfflineMapStatus.SUCCESS屬性的具體用法?Java OfflineMapStatus.SUCCESS怎麽用?Java OfflineMapStatus.SUCCESS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.amap.api.maps.offlinemap.OfflineMapStatus
的用法示例。
在下文中一共展示了OfflineMapStatus.SUCCESS屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onLongClick
public boolean onLongClick(View arg0) {
// if (mMapCity.getState() == OfflineMapStatus.LOADING) {
// amapManager.restart();
// return false;
// }
Log.d("amap-longclick",
mMapCity.getCity() + " : " + mMapCity.getState());
if (mMapCity.getState() == OfflineMapStatus.SUCCESS) {
showDeleteUpdateDialog(mMapCity.getCity());
} else if (mMapCity.getState() != OfflineMapStatus.CHECKUPDATES) {
showDeleteDialog(mMapCity.getCity());
}
return false;
}
示例2: getChildView
/**
* 對一級標簽下的二級標簽進行設置
*/
@Override
public View getChildView(final int groupPosition,
final int childPosition, boolean isLastChild, View convertView,
ViewGroup parent) {
if (convertView == null) {
convertView = (RelativeLayout) RelativeLayout.inflate(
getBaseContext(), R.layout.offlinemap_child, null);
}
ViewHolder holder = new ViewHolder(convertView);
holder.cityName.setText(cityMap.get(groupPosition)
.get(childPosition).getCity());
holder.citySize.setText((cityMap.get(groupPosition).get(
childPosition).getSize())
/ (1024 * 1024f) + "MB");
if (cityMap.get(groupPosition).get(childPosition).getState() == OfflineMapStatus.SUCCESS) {
holder.cityDown.setText("安裝完成");
} else if (cityMap.get(groupPosition).get(childPosition).getState() == OfflineMapStatus.LOADING) {
if (groupPosition == OfflineMapActivity.this.groupPosition
&& childPosition == OfflineMapActivity.this.childPosition) {
holder.cityDown.setText("正在下載" + completeCode + "%");
}
} else if (cityMap.get(groupPosition).get(childPosition).getState() == OfflineMapStatus.UNZIP) {
holder.cityDown.setText("正在解壓" + completeCode + "%");
} else if (cityMap.get(groupPosition).get(childPosition).getState() == OfflineMapStatus.LOADING) {
holder.cityDown.setText("下載");
}
return convertView;
}
示例3: onDownload
/**
* 離線地圖下載回調方法
*/
@Override
public void onDownload(int status, int completeCode, String downName) {
switch (status) {
case OfflineMapStatus.SUCCESS:
changeOfflineMapTitle(OfflineMapStatus.SUCCESS);
break;
case OfflineMapStatus.LOADING:
OfflineMapActivity.this.completeCode = completeCode;
break;
case OfflineMapStatus.UNZIP:
OfflineMapActivity.this.completeCode = completeCode;
changeOfflineMapTitle(OfflineMapStatus.UNZIP);
break;
case OfflineMapStatus.WAITING:
break;
case OfflineMapStatus.PAUSE:
break;
case OfflineMapStatus.STOP:
break;
case OfflineMapStatus.ERROR:
break;
default:
break;
}
((BaseExpandableListAdapter) adapter).notifyDataSetChanged();
}
示例4: onDownload
@Override
public void onDownload(int status, int progress, String downName) {
statusChanged(status, progress, downName);
switch (status) {
case OfflineMapStatus.SUCCESS:
break;
case OfflineMapStatus.LOADING:
refreshDownList();
break;
case OfflineMapStatus.UNZIP:
break;
case OfflineMapStatus.WAITING:
refreshDownList();
break;
case OfflineMapStatus.PAUSE:
break;
case OfflineMapStatus.STOP:
refreshDownList();
break;
case OfflineMapStatus.ERROR:
refreshDownList();
break;
default:
break;
}
mAllAdapter.notifyDataSetChanged();
mManagerAdapter.notifyDataSetChanged();
}
示例5: refresh
public void refresh(OfflineMapCity city){
this.city = city;
btnDown.setTag(city.getCity());
tvName.setText(city.getCity());
tvSize.setText(StringUtils.getSizeStr(city.getSize()));
int status = city.getState();
if (status == OfflineMapStatus.SUCCESS) {
btnDown.setText("安裝完成");
btnDown.setBackgroundColor(getResources().getColor(R.color.yellow5));
} else if (status == OfflineMapStatus.UNZIP) {
btnDown.setText("正在解壓");
btnDown.setBackgroundResource(R.drawable.btn_red5_blue);
}else if (status == OfflineMapStatus.PAUSE
|| status == OfflineMapStatus.STOP
|| status == OfflineMapStatus.ERROR) {
//開始下載
btnDown.setText("下載");
btnDown.setBackgroundResource(R.drawable.btn_green5_blue);
}else if (status == OfflineMapStatus.LOADING) {
if(city.getCity().equals(curDowningCity)){
//是當前正在下載的城市
btnDown.setText(city.getcompleteCode() + "%");
btnDown.setBackgroundResource(R.drawable.btn_red5_blue);
}else{
//不是當前正在下載的城市
btnDown.setText("下載");
btnDown.setBackgroundResource(R.drawable.btn_green5_blue);
}
}else if (status == OfflineMapStatus.WAITING) {
btnDown.setText("等待下載");
btnDown.setBackgroundResource(R.drawable.btn_red5_blue);
}
}
示例6: handleMessage
@Override
public void handleMessage(Message msg) {
// TODO Auto-generated method stub
super.handleMessage(msg);
int completeCode = (Integer) msg.obj;
switch (msg.what) {
case OfflineMapStatus.LOADING:
displyaLoadingStatus(completeCode);
break;
case OfflineMapStatus.PAUSE:
displayPauseStatus(completeCode);
break;
case OfflineMapStatus.STOP:
break;
case OfflineMapStatus.SUCCESS:
displaySuccessStatus();
break;
case OfflineMapStatus.UNZIP:
displayUnZIPStatus(completeCode);
break;
case OfflineMapStatus.ERROR:
displayExceptionStatus();
break;
case OfflineMapStatus.WAITING:
displayWaitingStatus(completeCode);
break;
case OfflineMapStatus.CHECKUPDATES:
displayDefault();
break;
case OfflineMapStatus.EXCEPTION_AMAP:
case OfflineMapStatus.EXCEPTION_NETWORK_LOADING:
case OfflineMapStatus.EXCEPTION_SDCARD:
displayExceptionStatus();
break;
case OfflineMapStatus.NEW_VERSION:
displayHasNewVersion();
break;
}
}
示例7: onClick
public void onClick(View view) {
// if(mMapCity.getCity() .equals( "北京")) {
// new Thread(new Runnable() {
//
// @Override
// public void run() {
// // TODO Auto-generated method stub
// for(int i =0; i< 100;i++) {
// try {
// amapManager.downloadByCityName("北京");
// TimeUnit.MILLISECONDS.sleep(500);
// amapManager.downloadByCityName("上海");
// TimeUnit.MILLISECONDS.sleep(500);
// } catch (AMapException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
//
// }
// }).start();
// return;
// }
// // 避免頻繁點擊事件,避免不斷從夫開始下載和暫停下載
// mOffLineChildView.setEnabled(false);
// new Handler().postDelayed(new Runnable() {
//
// @Override
// public void run() {
// mOffLineChildView.setEnabled(true);
// }
// },100);// 這個時間段剛剛好
int completeCode = -1, status = -1;
if (mMapCity != null) {
status = mMapCity.getState();
completeCode = mMapCity.getcompleteCode();
switch (status) {
case OfflineMapStatus.UNZIP:
case OfflineMapStatus.SUCCESS:
// 解壓中何在成功啥不幹
break;
case OfflineMapStatus.LOADING:
// case OfflineMapStatus.WAITING:
pauseDownload();
// 在下載中的時候點擊,表示要暫停
displayPauseStatus(completeCode);
break;
case OfflineMapStatus.PAUSE:
case OfflineMapStatus.CHECKUPDATES:
case OfflineMapStatus.ERROR:
case OfflineMapStatus.WAITING:
// case OfflineMapStatus.NEW_VERSION:
default:
if(startDownload())
displayWaitingStatus(completeCode);
else
displayExceptionStatus();
// Toast.makeText(mContext, "SD卡空間不多了", 1000).show();
// 在暫停中點擊,表示要開始下載
// 在默認狀態點擊,表示開始下載
// 在等待中點擊,表示要開始下載
// 要開始下載狀態改為等待中,再回調中會自己修改
break;
}
Log.e("zxy-child", mMapCity.getCity() + " " + mMapCity.getState());
}
}
示例8: onDownload
@Override
public void onDownload(int status, int completeCode, String downName) {
switch (status) {
case OfflineMapStatus.SUCCESS:
// changeOfflineMapTitle(OfflineMapStatus.SUCCESS, downName);
break;
case OfflineMapStatus.LOADING:
Log.d("amap-download", "download: " + completeCode + "%" + ","
+ downName);
// changeOfflineMapTitle(OfflineMapStatus.LOADING, downName);
break;
case OfflineMapStatus.UNZIP:
Log.d("amap-unzip", "unzip: " + completeCode + "%" + "," + downName);
// changeOfflineMapTitle(OfflineMapStatus.UNZIP);
// changeOfflineMapTitle(OfflineMapStatus.UNZIP, downName);
break;
case OfflineMapStatus.WAITING:
Log.d("amap-waiting", "WAITING: " + completeCode + "%" + ","
+ downName);
break;
case OfflineMapStatus.PAUSE:
Log.d("amap-pause", "pause: " + completeCode + "%" + "," + downName);
break;
case OfflineMapStatus.STOP:
break;
case OfflineMapStatus.ERROR:
Log.e("amap-download", "download: " + " ERROR " + downName);
break;
case OfflineMapStatus.EXCEPTION_AMAP:
Log.e("amap-download", "download: " + " EXCEPTION_AMAP " + downName);
break;
case OfflineMapStatus.EXCEPTION_NETWORK_LOADING:
Log.e("amap-download", "download: " + " EXCEPTION_NETWORK_LOADING "
+ downName);
// Toast.makeText(OfflineMapActivity.this, "網絡異常", Toast.LENGTH_SHORT)
// .show();
mOfflineMapManager.pause();
break;
case OfflineMapStatus.EXCEPTION_SDCARD:
Log.e("amap-download", "download: " + " EXCEPTION_SDCARD "
+ downName);
break;
default:
break;
}
// changeOfflineMapTitle(status, downName);
updateList(-1);
}