Android ZoomControls - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ZoomControls class.

This code example shows how to use the following methods:setVisibility, setOnZoomInClickListener, setOnZoomOutClickListener, setZoomSpeed
				return super.onSingleTapConfirmed(e);
			} 
		}); 
		gestureDetector.setIsLongpressEnabled(false);
 
		zoomControls = new ZoomControls(context);
		addView(zoomControls);
		zoomControls.setVisibility(View.GONE);
		zoomControls.setZoomSpeed(75);
		zoomControls.setOnZoomInClickListener(new OnClickListener()
		{ 
			public void onClick(View v)
			{ 
				handleScaleUp(); 
			} 
		}); 
		zoomControls.setOnZoomOutClickListener(new OnClickListener()
		{ 
			public void onClick(View v)
			{ 

9
CodeRank
This code example shows how to use the following methods:setVisibility, setOnZoomInClickListener, setOnZoomOutClickListener
	private final Handler zoomControlsHideHandler;
	private byte zoomLevelMax;
	private byte zoomLevelMin;
 
	MapZoomControls(Context context, final MapView mapView) {
		this.zoomControls = new ZoomControls(context);
		this.showMapZoomControls = true;
		this.zoomLevelMax = DEFAULT_ZOOM_LEVEL_MAX;
		this.zoomLevelMin = DEFAULT_ZOOM_LEVEL_MIN;
		this.zoomControls.setVisibility(View.GONE);
		this.zoomControlsGravity = DEFAULT_ZOOM_CONTROLS_GRAVITY;
 
		this.zoomControls.setOnZoomInClickListener(new ZoomInClickListener(mapView));
		this.zoomControls.setOnZoomOutClickListener(new ZoomOutClickListener(mapView));
		this.zoomControlsHideHandler = new ZoomControlsHideHandler(this.zoomControls);
 
		int wrapContent = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
		LayoutParams layoutParams = new LayoutParams(wrapContent, wrapContent);
		mapView.addView(this.zoomControls, layoutParams);
	} 

6
CodeRank
This code example shows how to use the following methods:setVisibility, setOnZoomInClickListener, setOnZoomOutClickListener
	private final Handler zoomControlsHideHandler;
	private byte zoomLevelMax;
	private byte zoomLevelMin;
 
	MapZoomControls(Context context, final MapView mapView) {
		this.zoomControls = new ZoomControls(context);
		this.showMapZoomControls = true;
		this.zoomLevelMax = DEFAULT_ZOOM_LEVEL_MAX;
		this.zoomLevelMin = DEFAULT_ZOOM_LEVEL_MIN;
		this.zoomControls.setVisibility(View.GONE);
		this.zoomControlsGravity = DEFAULT_ZOOM_CONTROLS_GRAVITY;
 
		MapViewPosition mapViewPosition = mapView.getMapViewPosition();
		this.zoomControls.setOnZoomInClickListener(new ZoomInClickListener(mapViewPosition));
		this.zoomControls.setOnZoomOutClickListener(new ZoomOutClickListener(mapViewPosition));
		this.zoomControlsHideHandler = new ZoomControlsHideHandler(this.zoomControls);
 
		int wrapContent = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
		LayoutParams layoutParams = new LayoutParams(wrapContent, wrapContent);
		mapView.addView(this.zoomControls, layoutParams);

6
CodeRank
This code example shows how to use the following methods:setVisibility, setOnZoomInClickListener, setOnZoomOutClickListener
5
CodeRank
This code example shows how to use the following methods:setIsZoomInEnabled, setIsZoomOutEnabled, setOnZoomInClickListener, setOnZoomOutClickListener
5
CodeRank
This code example shows how to use the following methods:setPadding, setGravity
        LayoutParams params = zoombuttonsCtrl.getContainer().getLayoutParams();
        params.height = LayoutParams.FILL_PARENT;
        zoombuttonsCtrl.setAutoDismissed(false);
        ZoomControls zoomCtrl = (ZoomControls)zoombuttonsCtrl.getZoomControls();
        zoomCtrl.getLayoutParams().width = LayoutParams.FILL_PARENT;;
        zoomCtrl.setGravity(Gravity.RIGHT);
        zoomCtrl.setPadding(0, 65, 0, 0);
         
        // 地図表示 
        mapView.setSatellite(true);
 
        // デフォルトの表示位置、ズームサイズ 
    	mapCtrl = mapView.getController();
        mapCtrl.setCenter(GEO_YOKOHAMA);
        mapCtrl.setZoom(ZOOM_NORMAL);
   } 
 
    /** 
     * 指定された場所を真ん中とする 
     */ 
5
CodeRank
This code example shows how to use the following methods:hide
			this.zoomControls = zoomControls;
		} 
 
		@Override 
		public void handleMessage(Message message) {
			this.zoomControls.hide();
		} 
	} 
 
	private static class ZoomInClickListener implements View.OnClickListener {
		private final MapView mapView;
 
		ZoomInClickListener(MapView mapView) {
			this.mapView = mapView;
		} 
 
		@Override 
		public void onClick(View view) {
			this.mapView.zoom((byte) 1, 1);
		} 
3
CodeRank
This code example shows how to use the following methods:hide
			mZoomControls = zoomControls;
		} 
 
		@Override 
		public void handleMessage(Message message) {
			mZoomControls.hide();
		} 
	} 
 
	private static class ZoomInClickListener implements View.OnClickListener {
		private final MapZoomControls mMapZoomControls;
 
		ZoomInClickListener(MapZoomControls mapZoomControls) {
			mMapZoomControls = mapZoomControls;
		} 
 
		@Override 
		public void onClick(View view) {
			// if (MapView.testRegionZoom) 
			// mMapView.mRegionLookup.updateRegion(1, null); 
4
CodeRank
This code example shows how to use the following methods:setOnZoomOutClickListener
	/** 
	 *  
	 * @param onClickListener 
	 */ 
	public void setOnZoomOutClickListener(OnClickListener onClickListener) {
		zoomControls.setOnZoomOutClickListener(onClickListener);
	} 
 
} 
4
CodeRank

Related Android ZoomControls Questions & Answers: