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


Java OfflineMapStatus類代碼示例

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


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

示例1: onLongClick

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
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;
    }
 
開發者ID:Alex-ZHOU,項目名稱:VMAndroid,代碼行數:17,代碼來源:OfflineChild.java

示例2: onClick

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
@Override
public void onClick(View v) {

	int status = city.getState();
	if (status == OfflineMapStatus.PAUSE
			|| status == OfflineMapStatus.STOP
			|| status == OfflineMapStatus.ERROR) {
		//開始下載
		startDownload();
		
	}else if (status == OfflineMapStatus.LOADING) {
		if(city.getCity().equals(curDowningCity)){
			//是當前正在下載的城市,暫停
			mMapManager.pause();
			statusChanged(OfflineMapStatus.PAUSE, city.getcompleteCode(), city.getCity());
			
		}else{
			//不是當前正在下載的城市,開始下載
			startDownload();
		}
	}
	
}
 
開發者ID:jp1017,項目名稱:TheSceneryAlong,代碼行數:24,代碼來源:OfflineMapActivity.java

示例3: getChildView

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
/**
 * 對一級標簽下的二級標簽進行設置
 */
@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;
}
 
開發者ID:Tsroad,項目名稱:Road,代碼行數:33,代碼來源:OfflineMapActivity.java

示例4: onDownload

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
/**
 * 離線地圖下載回調方法
 */
@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,代碼行數:30,代碼來源:OfflineMapActivity.java

示例5: onDownload

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
@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,代碼行數:31,代碼來源:OfflineMapActivity.java

示例6: refresh

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
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,代碼行數:41,代碼來源:OfflineMapActivity.java

示例7: handleMessage

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
@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,代碼行數:43,代碼來源:OfflineChild.java

示例8: onClick

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
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,代碼行數:78,代碼來源:OfflineChild.java

示例9: onDownload

import com.amap.api.maps.offlinemap.OfflineMapStatus; //導入依賴的package包/類
@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,代碼行數:50,代碼來源:OfflineMapPresenter.java


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