當前位置: 首頁>>代碼示例>>Java>>正文


Java View.getLayerType方法代碼示例

本文整理匯總了Java中android.view.View.getLayerType方法的典型用法代碼示例。如果您正苦於以下問題:Java View.getLayerType方法的具體用法?Java View.getLayerType怎麽用?Java View.getLayerType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.View的用法示例。


在下文中一共展示了View.getLayerType方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: disableHardwareLayers

import android.view.View; //導入方法依賴的package包/類
private void disableHardwareLayers() {
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) return;
    for (int i = 0; i < mViewPageable.getChildCount(); i++) {
        final View child = mViewPageable.getChildAt(i);
        if (child.getLayerType() != View.LAYER_TYPE_NONE)
            child.setLayerType(View.LAYER_TYPE_NONE, null);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:InfiniteCycleManager.java

示例2: manageLayer

import android.view.View; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void manageLayer(View v, boolean enableHardware) {
	if (!API_11) return;
	int layerType = enableHardware ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE;
	if (layerType != v.getLayerType())
		v.setLayerType(layerType, null);
}
 
開發者ID:SimonCherryGZ,項目名稱:JewelryUI,代碼行數:8,代碼來源:JazzyViewPager.java

示例3: disableHardwareLayer

import android.view.View; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void disableHardwareLayer() {
	if (!API_11) return;
	View v;
	for (int i = 0; i < getChildCount(); i++) {
		v = getChildAt(i);
		if (v.getLayerType() != View.LAYER_TYPE_NONE)
			v.setLayerType(View.LAYER_TYPE_NONE, null);
	}
}
 
開發者ID:SimonCherryGZ,項目名稱:JewelryUI,代碼行數:11,代碼來源:JazzyViewPager.java

示例4: manageLayer

import android.view.View; //導入方法依賴的package包/類
@TargetApi(11)
private void manageLayer(View v, boolean enableHardware) {
    if (API_11) {
        int layerType = enableHardware ? 2 : 0;
        if (layerType != v.getLayerType()) {
            v.setLayerType(layerType, null);
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:10,代碼來源:JazzyViewPager.java

示例5: disableHardwareLayer

import android.view.View; //導入方法依賴的package包/類
@TargetApi(11)
private void disableHardwareLayer() {
    if (API_11) {
        for (int i = 0; i < getChildCount(); i++) {
            View v = getChildAt(i);
            if (v.getLayerType() != 0) {
                v.setLayerType(0, null);
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:12,代碼來源:JazzyViewPager.java

示例6: createCircularReveal

import android.view.View; //導入方法依賴的package包/類
public static Animator createCircularReveal(View revealView, int centerX, int centerY,
                                            float startRadius, float endRadius, int layerType) {
    Animator animator = CircularRevealAnimator.ofRevealCircle(revealView, centerX, centerY,
            startRadius, endRadius);
    if (layerType != revealView.getLayerType()) {
        animator.addListener(new CircularRevealAnimator.ChangeViewLayerTypeListener(revealView, layerType));
    }
    return animator;
}
 
開發者ID:yangwencan2002,項目名稱:CircularRevealCompat,代碼行數:10,代碼來源:ViewAnimationCompatUtils.java

示例7: enableHardwareLayer

import android.view.View; //導入方法依賴的package包/類
private void enableHardwareLayer(final View v) {
    final int layerType = Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT ?
            View.LAYER_TYPE_NONE : View.LAYER_TYPE_HARDWARE;
    if (v.getLayerType() != layerType) v.setLayerType(layerType, null);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:InfiniteCycleManager.java

示例8: getLayerType

import android.view.View; //導入方法依賴的package包/類
public static int getLayerType(View view) {
    return view.getLayerType();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:4,代碼來源:ViewCompatHC.java

示例9: draw

import android.view.View; //導入方法依賴的package包/類
public static void draw(Canvas canvas, View view, Config config) {
    Check.ifNull(canvas);
    Check.ifNull(view);
    Check.ifNull(config);

    View parent = (View) view.getParent();
    if (parent.getLayerType() != View.LAYER_TYPE_SOFTWARE) {
        parent.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        return;
    }

    int count = canvas.save();
    int viewHeight = view.getHeight();
    int viewWidth = view.getWidth();
    float padding = config.radius * RATIO;
    int xOffset = config.xOffset;
    int yOffset = config.yOffset;

    initPath(viewWidth, viewHeight, config);

    try {
        /*
            clipPath時部分4.0 手機會拋出如下異常, 比如
            OPPO X907 cpu高通驍龍Snapdragon MSM8260 內存1GB 係統版本4.0.3 分辨率800x480
            FATAL EXCEPTION:main
            java.lang.UnsupportedOperationException
            at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:429)
        */
        canvas.clipPath(sPath, Region.Op.REPLACE);
    } catch (Exception e) {
        Log.e("shadow", "不支持clipPath");
        e.printStackTrace();
        canvas.restoreToCount(count);
        config.recycle();
        return;

    }

    sRectF.left = xOffset - padding;
    sRectF.top = yOffset - padding;
    sRectF.right = viewWidth + xOffset + padding;
    sRectF.bottom = viewHeight + yOffset + padding;

    canvas.clipRect(sRectF, Region.Op.REVERSE_DIFFERENCE);

    canvas.translate(xOffset, yOffset);

    sPaint.setColor(config.color);
    sPaint.setMaskFilter(new BlurMaskFilter(config.radius, BlurMaskFilter.Blur.NORMAL));

    canvas.drawPath(sPath, sPaint);

    canvas.restoreToCount(count);
    config.recycle();
}
 
開發者ID:android-notes,項目名稱:shadow,代碼行數:56,代碼來源:ShadowHelper.java

示例10: ChangeViewLayerTypeListener

import android.view.View; //導入方法依賴的package包/類
ChangeViewLayerTypeListener(View clipView, int layerType) {
    this.clipView = clipView;
    this.newLayerType = layerType;
    this.originalLayerType = clipView.getLayerType();
}
 
開發者ID:yangwencan2002,項目名稱:CircularRevealCompat,代碼行數:6,代碼來源:CircularRevealAnimator.java


注:本文中的android.view.View.getLayerType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。