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


Java ZoomButtonsController类代码示例

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


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

示例1: initWebView

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled"})
public static void initWebView(WebView webView) {
    WebSettings settings = webView.getSettings();
    settings.setDefaultFontSize(14);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(false);
    settings.setBuiltInZoomControls(false);
    int sysVersion = Build.VERSION.SDK_INT;
    if (sysVersion >= 11) {
        settings.setDisplayZoomControls(false);
    } else {
        ZoomButtonsController zbc = new ZoomButtonsController(webView);
        zbc.getZoomControls().setVisibility(View.GONE);
    }
    //webView.setWebViewClient(UiUtil.getWebViewClient());
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:17,代码来源:UIHelper.java

示例2: initWebView

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@SuppressLint({"SetJavaScriptEnabled"})
public static void initWebView(WebView webView) {
    WebSettings settings = webView.getSettings();
    settings.setDefaultFontSize(15);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(true);
    settings.setBuiltInZoomControls(true);

    int sysVersion = Build.VERSION.SDK_INT;
    if (sysVersion >= 19) {
        webView.getSettings().setLoadsImagesAutomatically(true);
    } else {
        webView.getSettings().setLoadsImagesAutomatically(false);
    }

    settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
    if (sysVersion >= 11) {
        settings.setDisplayZoomControls(false);
    } else {
        ZoomButtonsController zbc = new ZoomButtonsController(webView);
        zbc.getZoomControls().setVisibility(View.GONE);
    }
    addWebImageShow(webView.getContext(), webView);
}
 
开发者ID:kymjs,项目名称:CoreModule,代码行数:25,代码来源:BrowserFragment.java

示例3: initWebView

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@SuppressLint({"SetJavaScriptEnabled", "JavascriptInterface"})
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected void initWebView(WebView webView) {
    WebSettings settings = webView.getSettings();
    settings.setDefaultFontSize(15);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(true);
    settings.setBuiltInZoomControls(true);

    int sysVersion = Build.VERSION.SDK_INT;
    if (sysVersion >= 11) {
        settings.setDisplayZoomControls(false);
    } else {
        ZoomButtonsController zbc = new ZoomButtonsController(webView);
        zbc.getZoomControls().setVisibility(View.GONE);
    }

}
 
开发者ID:wlemuel,项目名称:Cotable,代码行数:19,代码来源:BaseDetailFragment.java

示例4: 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

示例5: initWebView

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@SuppressLint({ "JavascriptInterface", "SetJavaScriptEnabled" })
public static void initWebView(WebView webView) {
    WebSettings settings = webView.getSettings();
    settings.setDefaultFontSize(15);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(true);
    settings.setBuiltInZoomControls(true);
    int sysVersion = Build.VERSION.SDK_INT;
    if (sysVersion >= 11) {
        settings.setDisplayZoomControls(false);
    } else {
        ZoomButtonsController zbc = new ZoomButtonsController(webView);
        zbc.getZoomControls().setVisibility(View.GONE);
    }
    webView.setWebViewClient(UIHelper.getWebViewClient());
}
 
开发者ID:KJFrame,项目名称:KJBlog,代码行数:17,代码来源:UIHelper.java

示例6: 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

示例7: initWebView

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@SuppressLint("SetJavaScriptEnabled")
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void initWebView(WebView webView) {
	WebSettings settings = webView.getSettings();
	settings.setDefaultFontSize(20);
	settings.setJavaScriptEnabled(true);
	settings.setSupportZoom(true);
	settings.setBuiltInZoomControls(true);
	int sysVersion = Build.VERSION.SDK_INT;
	if (sysVersion >= 11) {
		settings.setDisplayZoomControls(false);
	} else {
		ZoomButtonsController zbc = new ZoomButtonsController(webView);
		zbc.getZoomControls().setVisibility(View.GONE);
	}
	UIHelper.addWebImageShow(getActivity(), webView);
}
 
开发者ID:blueelwang,项目名称:oschina-app,代码行数:18,代码来源:TweetDetailFragment.java

示例8: initWebView

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@SuppressLint({"SetJavaScriptEnabled", "JavascriptInterface"})
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected void initWebView(WebView webView) {
    WebSettings settings = webView.getSettings();
    settings.setDefaultFontSize(15);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(true);
    settings.setBuiltInZoomControls(true);
    int sysVersion = Build.VERSION.SDK_INT;
    if (sysVersion >= 11) {
        settings.setDisplayZoomControls(false);
    } else {
        ZoomButtonsController zbc = new ZoomButtonsController(webView);
        zbc.getZoomControls().setVisibility(View.GONE);
    }
    UIHelper.addWebImageShow(getActivity(), webView);
}
 
开发者ID:blueelwang,项目名称:oschina-app,代码行数:18,代码来源:BaseDetailFragment.java

示例9: 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

示例10: onTouchEvent

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event) {
  if (m_RocrailService.Prefs.Zoom && levelView.zoomButtonsController == null) {
    levelView.zoomButtonsController = new ZoomButtonsController(getWindow().getDecorView());
    levelView.zoomButtonsController.setOnZoomListener(this);
    levelView.zoomButtonsController.setZoomInEnabled(m_RocrailService.Prefs.Size < 64 );
    levelView.zoomButtonsController.setZoomOutEnabled(m_RocrailService.Prefs.Size > 8 );
  }
  switch (event.getAction()) {
  case MotionEvent.ACTION_UP:
    System.out.println("uptime="+SystemClock.uptimeMillis()+" downtime="+event.getDownTime());
    if (m_RocrailService.Prefs.Zoom && (SystemClock.uptimeMillis() - event.getDownTime()) > 1000 && levelView.zoomButtonsController != null) {
      levelView.zoomButtonsController.setVisible(true);
      levelView.zoomButtonsController.setFocusable(true);
      levelView.zoomButtonsController.getZoomControls().setFocusable(true);
      levelView.zoomButtonsController.getZoomControls().setFocusableInTouchMode(true);
      levelView.zoomButtonsController.getZoomControls().requestFocus();
      return true;
    }
  }
  return levelView.onTouchEvent(event);
}
 
开发者ID:prashant31191,项目名称:andRoc,代码行数:23,代码来源:ActLevel.java

示例11: setDisplayZoomControl

import android.widget.ZoomButtonsController; //导入依赖的package包/类
/**
 * Set option to display zoom control
 * http://stackoverflow.com/a/11901948
 * 
 * @param show
 */
@SuppressLint("NewApi")
public void setDisplayZoomControl(boolean show) {
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
		this.getSettings().setDisplayZoomControls(show);
	} else {
		// get the control
		try {
			Class webview = Class.forName("android.webkit.WebView");
			Method method = webview.getMethod("getZoomButtonsController");
			zoom_controll = (ZoomButtonsController) method.invoke(this, null);
			showZoom = show;
		} catch (Exception e) {
			Log.e(TAG, "Error when getting zoom control", e);
		}
	}
}
 
开发者ID:dotcool,项目名称:coolreader,代码行数:23,代码来源:NonLeakingWebView.java

示例12: initWebView

import android.widget.ZoomButtonsController; //导入依赖的package包/类
@SuppressLint({ "SetJavaScriptEnabled", "JavascriptInterface" })
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected void initWebView(WebView webView) {
	WebSettings settings = webView.getSettings();
	settings.setDefaultFontSize(15);
	settings.setJavaScriptEnabled(true);
	settings.setSupportZoom(true);
	settings.setBuiltInZoomControls(true);
	int sysVersion = Build.VERSION.SDK_INT;
	if (sysVersion >= 11) {
		settings.setDisplayZoomControls(false);
	} else {
		ZoomButtonsController zbc = new ZoomButtonsController(webView);
		zbc.getZoomControls().setVisibility(View.GONE);
	}
	UIHelper.addWebImageShow(getActivity(), webView);
}
 
开发者ID:447491480,项目名称:ima_intellj,代码行数:18,代码来源:BaseDetailFragment.java

示例13: makeZoomLabel

import android.widget.ZoomButtonsController; //导入依赖的package包/类
/**
 * @param context
 * @param zoomController
 */
private void makeZoomLabel(Context context, ZoomButtonsController zoomController) {
	ViewGroup container = zoomController.getContainer();
	View controls = zoomController.getZoomControls();
	LayoutParams p0 = controls.getLayoutParams();
	container.removeView(controls);
	LinearLayout layout = new LinearLayout(context);
	layout.setOrientation(LinearLayout.VERTICAL);
	mZoomLabel = new TextView(context);
	mZoomLabel.setPadding(12, 0, 12, 0);
	mZoomLabel.setTypeface(Typeface.DEFAULT_BOLD);
	mZoomLabel.setTextColor(0xff000000);
	PaintDrawable d = new PaintDrawable(0xeeffffff);
	d.setCornerRadius(6);
	mZoomLabel.setBackgroundDrawable(d);
	mZoomLabel.setTextSize(20);
	mZoomLabel.setGravity(Gravity.CENTER_HORIZONTAL);
	LinearLayout.LayoutParams p1 = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	p1.gravity = Gravity.CENTER_HORIZONTAL;
	layout.addView(mZoomLabel, p1);
	layout.addView(controls);
	container.addView(layout, p0);
}
 
开发者ID:CRS4-IOT,项目名称:indoorlib,代码行数:27,代码来源:MapScrollView.java

示例14: 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

示例15: 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


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