当前位置: 首页>>代码示例>>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;未经允许,请勿转载。