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


Java ZoomButtonsController.setZoomOutEnabled方法代码示例

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


在下文中一共展示了ZoomButtonsController.setZoomOutEnabled方法的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);
    }
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:18,代码来源:AwZoomControls.java

示例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);
        }
    });
}
 
开发者ID:zhengxiaopeng,项目名称:Rocko-Android-Demos,代码行数:28,代码来源:ZoomButtonsActivity.java

示例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);
       
    
}
 
开发者ID:CRS4-IOT,项目名称:indoorlib,代码行数:36,代码来源:MapScrollView.java


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