当前位置: 首页>>代码示例>>Java>>正文


Java ZoomButtonsController.setOnZoomListener方法代码示例

本文整理汇总了Java中android.widget.ZoomButtonsController.setOnZoomListener方法的典型用法代码示例。如果您正苦于以下问题:Java ZoomButtonsController.setOnZoomListener方法的具体用法?Java ZoomButtonsController.setOnZoomListener怎么用?Java ZoomButtonsController.setOnZoomListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ZoomButtonsController的用法示例。


在下文中一共展示了ZoomButtonsController.setOnZoomListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupZoomButtonController

import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
private void setupZoomButtonController(final View ownerView) {
    mZoomButtonsController = new ZoomButtonsController(ownerView);
    mZoomButtonsController.setAutoDismissed(false);
    mZoomButtonsController.setZoomSpeed(100);
    mZoomButtonsController.setOnZoomListener(
            new ZoomButtonsController.OnZoomListener() {
        public void onVisibilityChanged(boolean visible) {
            if (visible) {
                updateZoomButtonsEnabled();
            }
        }

        public void onZoom(boolean zoomIn) {
            if (zoomIn) {
                mImageView.zoomIn();
            } else {
                mImageView.zoomOut();
            }
            mZoomButtonsController.setVisible(true);
            updateZoomButtonsEnabled();
        }
    });
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:24,代码来源:ViewImage.java

示例2: init

import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
/**
 * Initializes the view
 *
 * @param context
 *            {@link Context}
 */
private void init(Context context) {
    setFocusable(true);
    scroller = new Scroller(context);
    gestureDetector = new GestureDetector(context, this);
    scaleGestureDetector = new ScaleGestureDetector(context, this);

    zoomController = new ZoomButtonsController(this);
    zoomController.setOnZoomListener(this);

    matrix = new Matrix();
    destination = new float[2];

    // setVerticalScrollBarEnabled(true);
    // setHorizontalScrollBarEnabled(true);

}
 
开发者ID:MaKeAppDev,项目名称:Redpin,代码行数:23,代码来源:ZoomAndScrollImageView.java

示例3: setupZoomButtonController

import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
private void setupZoomButtonController(final View ownerView) {
	mZoomButtonsController = new ZoomButtonsController(ownerView);
	mZoomButtonsController.setAutoDismissed(false);
	mZoomButtonsController.setZoomSpeed(100);
	mZoomButtonsController
			.setOnZoomListener(new ZoomButtonsController.OnZoomListener() {
				public void onVisibilityChanged(boolean visible) {
					if (visible) {
						updateZoomButtonsEnabled();
					}
				}

				public void onZoom(boolean zoomIn) {
					if (zoomIn) {
						mImageView.zoomIn();
					} else {
						mImageView.zoomOut();
					}
					mZoomButtonsController.setVisible(true);
					updateZoomButtonsEnabled();
				}
			});
}
 
开发者ID:ikantech,项目名称:yiim_v2,代码行数:24,代码来源:ViewImageDialog.java

示例4: init

import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
/**
 * Initializes the view
 * 
 * @param context
 *            {@link Context}
 */
private void init(Context context) {
	setFocusable(true);
	scroller = new Scroller(context);
	gestureDetector = new GestureDetector(context, this);
	scaleGestureDetector = new ScaleGestureDetector(context, this);

	zoomController = new ZoomButtonsController(this);
	zoomController.setOnZoomListener(this);

	matrix = new Matrix();
	destination = new float[2];

	// setVerticalScrollBarEnabled(true);
	// setHorizontalScrollBarEnabled(true);

}
 
开发者ID:BenjaminMesre,项目名称:UPMCarte,代码行数:23,代码来源:ZoomAndScrollImageView.java

示例5: inti

import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
private void inti() {
    textView = (TextView) findViewById(R.id.textview);
    scrollView = (ScrollView) findViewById(R.id.scroll_view);

    zoomButtonsController = new ZoomButtonsController(scrollView);
    textView.setOnTouchListener(zoomButtonsController);
    //        zoomButtonsController.setAutoDismissed(false);
    zoomButtonsController.setZoomInEnabled(true);
    zoomButtonsController.setZoomOutEnabled(true);
    zoomButtonsController.setFocusable(true);
    zoomTextSize = textView.getTextSize();
    zoomButtonsController.setOnZoomListener(new ZoomButtonsController.OnZoomListener() {
        @Override
        public void onVisibilityChanged(boolean visible) {
        }

        @Override
        public void onZoom(boolean zoomIn) {
            if (zoomIn) {
                zoomTextSize = zoomTextSize + 1.0f;
            } else {
                zoomTextSize = zoomTextSize - 1.0f;
            }
            textView.setTextSize(zoomTextSize);
        }
    });
}
 
开发者ID:zhengxiaopeng,项目名称:Rocko-Android-Demos,代码行数:28,代码来源:ZoomButtonsActivity.java

示例6: MapScrollView

import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
/**
 * @param context
 * @param attrs
 */
public MapScrollView(Context context, AttributeSet attrs) {
	super(context, attrs);
	mScroller = new Scroller(context);
	mGestureDetector = new GestureDetector(this);
	mScale = 1;
	mZoomButtonsController = new ZoomButtonsController(this);
	mZoomButtonsController.setAutoDismissed(true);
	mZoomButtonsController.setOnZoomListener(this);
	mZoomButtonsController.setZoomSpeed(25);
	mZoomButtonsController.setZoomInEnabled(mScale < MAX_ZOOM);
	mZoomButtonsController.setZoomOutEnabled(mScale > MIN_ZOOM);
	makeZoomLabel(context, mZoomButtonsController);
	
	mZoomFormat = NumberFormat.getPercentInstance();
	mZoomLabel.setText("Zoom: " + mZoomFormat.format(mScale));
	
	setVerticalScrollBarEnabled(true);
	setHorizontalScrollBarEnabled(true);
	TypedArray a = context.obtainStyledAttributes(R.styleable.Scroll);
	initializeScrollbars(a);
	a.recycle();
	mMatrix = new Matrix();
	mDst = new float[2];
	mZoomAnimation = new ZoomAnimation();
	mPaths = new Path[2];
	mPathPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
	mPathPaint.setStyle(Style.STROKE);
       mPathPaint.setStrokeCap(Cap.SQUARE);
       
    
}
 
开发者ID:CRS4-IOT,项目名称:indoorlib,代码行数:36,代码来源:MapScrollView.java

示例7: createZoomControls

import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
public void createZoomControls() {
	ZoomButtonsController zoomButtonsController = new ZoomButtonsController(
			imageView);
	zoomButtonsController.setVisible(true);
	zoomButtonsController.setAutoDismissed(false);
	zoomButtonsController.setOnZoomListener(new OnZoomListener() {

		public void onZoom(boolean zoomIn) {
			matrix = imageView.getImageMatrix();
			if (zoomIn) {
				matrix.postScale(1.05f, 1.05f, 0.5f * size, 0.5f * size);
				imageView.setImageMatrix(matrix);
			} else {
				matrix.postScale(0.95f, 0.95f, 0.5f * size, 0.5f * size);
				imageView.setImageMatrix(matrix);
			}
			imageView.invalidate();
		}

		public void onVisibilityChanged(boolean visible) {
		}
	});
	RelativeLayout.LayoutParams zoomLayoutParams = new RelativeLayout.LayoutParams(
			LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	zoomLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
	zoomLayoutParams.addRule(RelativeLayout.BELOW, R.id.imageViewCrop);
	viewManager.addView(zoomButtonsController.getContainer(),
			zoomLayoutParams);
}
 
开发者ID:dzwillpower,项目名称:pickncrop,代码行数:30,代码来源:MainActivity.java


注:本文中的android.widget.ZoomButtonsController.setOnZoomListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。