本文整理汇总了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();
}
});
}
示例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);
}
示例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();
}
});
}
示例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);
}
示例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);
}
});
}
示例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);
}
示例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);
}