當前位置: 首頁>>代碼示例>>Java>>正文


Java OfflineMapStatus.WAITING屬性代碼示例

本文整理匯總了Java中com.amap.api.maps.offlinemap.OfflineMapStatus.WAITING屬性的典型用法代碼示例。如果您正苦於以下問題:Java OfflineMapStatus.WAITING屬性的具體用法?Java OfflineMapStatus.WAITING怎麽用?Java OfflineMapStatus.WAITING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.amap.api.maps.offlinemap.OfflineMapStatus的用法示例。


在下文中一共展示了OfflineMapStatus.WAITING屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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();
}
 
開發者ID:Tsroad,項目名稱:Road,代碼行數:29,代碼來源:OfflineMapActivity.java

示例2: 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();
}
 
開發者ID:jp1017,項目名稱:TheSceneryAlong,代碼行數:30,代碼來源:OfflineMapActivity.java

示例3: 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);
	}
	
}
 
開發者ID:jp1017,項目名稱:TheSceneryAlong,代碼行數:40,代碼來源:OfflineMapActivity.java

示例4: 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;

    }
}
 
開發者ID:Alex-ZHOU,項目名稱:VMAndroid,代碼行數:42,代碼來源:OfflineChild.java

示例5: 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());

        }

    }
 
開發者ID:Alex-ZHOU,項目名稱:VMAndroid,代碼行數:77,代碼來源:OfflineChild.java

示例6: 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);
    }
 
開發者ID:Alex-ZHOU,項目名稱:VMAndroid,代碼行數:49,代碼來源:OfflineMapPresenter.java


注:本文中的com.amap.api.maps.offlinemap.OfflineMapStatus.WAITING屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。