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


Java EdgeEffectCompat.setSize方法代码示例

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


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

示例1: updateGlowSize

import android.support.v4.widget.EdgeEffectCompat; //导入方法依赖的package包/类
private static void updateGlowSize(RecyclerView rv, EdgeEffectCompat glow, int dir) {
    int width = rv.getMeasuredWidth();
    int height = rv.getMeasuredHeight();

    if (getClipToPadding(rv)) {
        width -= rv.getPaddingLeft() + rv.getPaddingRight();
        height -= rv.getPaddingTop() + rv.getPaddingBottom();
    }

    width = Math.max(0, width);
    height = Math.max(0, height);

    if (dir == EDGE_LEFT || dir == EDGE_RIGHT) {
        int t = width;
        width = height;
        height = t;
    }

    glow.setSize(width, height);
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:21,代码来源:BaseEdgeEffectDecorator.java

示例2: drawEdgeEffect

import android.support.v4.widget.EdgeEffectCompat; //导入方法依赖的package包/类
private void drawEdgeEffect(
		Canvas canvas,
		EdgeEffectCompat edgeEffect,
		int degrees) {
	if (canvas == null || edgeEffect == null ||
			edgeEffect.isFinished()) {
		return;
	}

	int restoreCount = canvas.getSaveCount();
	int width = getWidth();
	int height = getHeight() - getPaddingTop() - getPaddingBottom();

	canvas.rotate(degrees);

	if (degrees == 270) {
		canvas.translate(
				(float) -height + getPaddingTop(),
				0);
	} else {
		canvas.translate(
				-getPaddingTop(),
				-width);
	}

	edgeEffect.setSize(height, width);

	if (edgeEffect.draw(canvas)) {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
			postInvalidateOnAnimation();
		} else {
			postInvalidate();
		}
	}

	canvas.restoreToCount(restoreCount);
}
 
开发者ID:markusfisch,项目名称:SwipeImageView,代码行数:38,代码来源:SwipeImageView.java

示例3: updateGlowSize

import android.support.v4.widget.EdgeEffectCompat; //导入方法依赖的package包/类
private static void updateGlowSize(RecyclerView rv, EdgeEffectCompat topGlow) {
    int width = rv.getMeasuredWidth();
    int height = rv.getMeasuredHeight();

    if (getClipToPadding(rv)) {
        width -= rv.getPaddingLeft() - rv.getPaddingRight();
        height -= rv.getPaddingTop() - rv.getPaddingBottom();
    }

    width = Math.max(0, width);
    height = Math.max(0, height);

    topGlow.setSize(width, height);
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:15,代码来源:EdgeEffectDecorator.java


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