本文整理汇总了Java中android.widget.ZoomButtonsController.setZoomInEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ZoomButtonsController.setZoomInEnabled方法的具体用法?Java ZoomButtonsController.setZoomInEnabled怎么用?Java ZoomButtonsController.setZoomInEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ZoomButtonsController
的用法示例。
在下文中一共展示了ZoomButtonsController.setZoomInEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateZoomControls
import android.widget.ZoomButtonsController; //导入方法依赖的package包/类
@Override
public void updateZoomControls() {
ZoomButtonsController zoomController = getZoomController();
if (zoomController == null) {
return;
}
boolean canZoomIn = mAwContents.canZoomIn();
boolean canZoomOut = mAwContents.canZoomOut();
if (!canZoomIn && !canZoomOut) {
// Hide the zoom in and out buttons if the page cannot zoom
zoomController.getZoomControls().setVisibility(View.GONE);
} else {
// Set each one individually, as a page may be able to zoom in or out
zoomController.setZoomInEnabled(canZoomIn);
zoomController.setZoomOutEnabled(canZoomOut);
}
}
示例2: 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);
}
});
}
示例3: 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);
}