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


Java Interpolator.getInterpolation方法代码示例

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


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

示例1: zoom

import android.view.animation.Interpolator; //导入方法依赖的package包/类
public CanvasTransformer zoom(final int openedX, final int closedX,
                              final int openedY, final int closedY,
                              final int px, final int py, final Interpolator interp)
{
    initTransformer();
    mTrans = new CanvasTransformer()
    {
        public void transformCanvas(Canvas canvas, float percentOpen)
        {
            mTrans.transformCanvas(canvas, percentOpen);
            float f = interp.getInterpolation(percentOpen);
            canvas.scale((openedX - closedX) * f + closedX,
                    (openedY - closedY) * f + closedY, px, py);
        }
    };
    return mTrans;
}
 
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:18,代码来源:CanvasTransformerBuilder.java

示例2: rotate

import android.view.animation.Interpolator; //导入方法依赖的package包/类
public CanvasTransformer rotate(final int openedDeg, final int closedDeg,
                                final int px, final int py, final Interpolator interp)
{
    initTransformer();
    mTrans = new CanvasTransformer()
    {
        public void transformCanvas(Canvas canvas, float percentOpen)
        {
            mTrans.transformCanvas(canvas, percentOpen);
            float f = interp.getInterpolation(percentOpen);
            canvas.rotate((openedDeg - closedDeg) * f + closedDeg,
                    px, py);
        }
    };
    return mTrans;
}
 
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:17,代码来源:CanvasTransformerBuilder.java

示例3: translate

import android.view.animation.Interpolator; //导入方法依赖的package包/类
public CanvasTransformer translate(final int openedX, final int closedX,
                                   final int openedY, final int closedY, final Interpolator interp)
{
    initTransformer();
    mTrans = new CanvasTransformer()
    {
        public void transformCanvas(Canvas canvas, float percentOpen)
        {
            mTrans.transformCanvas(canvas, percentOpen);
            float f = interp.getInterpolation(percentOpen);
            canvas.translate((openedX - closedX) * f + closedX,
                    (openedY - closedY) * f + closedY);
        }
    };
    return mTrans;
}
 
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:17,代码来源:CanvasTransformerBuilder.java

示例4: lerp

import android.view.animation.Interpolator; //导入方法依赖的package包/类
private static float lerp(float startValue, float endValue, float fraction,
                          Interpolator interpolator) {
    if (interpolator != null) {
        fraction = interpolator.getInterpolation(fraction);
    }
    return startValue + Math.round(fraction * (endValue - startValue));
}
 
开发者ID:coopese,项目名称:qmui,代码行数:8,代码来源:QMUICollapsingTextHelper.java

示例5: getInterpolation

import android.view.animation.Interpolator; //导入方法依赖的package包/类
private float getInterpolation(Interpolator interpolator, float start, float end, float fraction) {
    if (start == end || fraction == 1) {
        return end;
    } else {
        return start + (end - start) * interpolator.getInterpolation(fraction);
    }
}
 
开发者ID:xyzxqs,项目名称:XphotoView,代码行数:8,代码来源:ImageMatrixAnimator.java

示例6: computeStartOffset

import android.view.animation.Interpolator; //导入方法依赖的package包/类
/**
 * 计算动画开始时的偏移量
 */
private static long computeStartOffset(final int childCount,
                                       final boolean expanded, final int index, final float delayPercent,
                                       final long duration, Interpolator interpolator) {
    final float delay = delayPercent * duration;
    final long viewDelay = (long) (getTransformedIndex(expanded,
            childCount, index) * delay);
    final float totalDelay = delay * childCount;

    float normalizedDelay = viewDelay / totalDelay;
    normalizedDelay = interpolator.getInterpolation(normalizedDelay);

    return (long) (normalizedDelay * totalDelay);
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:17,代码来源:ArcLayout.java

示例7: zoom

import android.view.animation.Interpolator; //导入方法依赖的package包/类
public CanvasTransformer zoom(final int openedX, final int closedX, 
		final int openedY, final int closedY,
		final int px, final int py, final Interpolator interp) {
	initTransformer();
	mTrans = new CanvasTransformer() {
		public void transformCanvas(Canvas canvas, float percentOpen) {
			mTrans.transformCanvas(canvas, percentOpen);
			float f = interp.getInterpolation(percentOpen);
			canvas.scale((openedX - closedX) * f + closedX,
					(openedY - closedY) * f + closedY, px, py);
		}			
	};
	return mTrans;
}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:15,代码来源:CanvasTransformerBuilder.java

示例8: rotate

import android.view.animation.Interpolator; //导入方法依赖的package包/类
public CanvasTransformer rotate(final int openedDeg, final int closedDeg, 
		final int px, final int py, final Interpolator interp) {
	initTransformer();
	mTrans = new CanvasTransformer() {
		public void transformCanvas(Canvas canvas, float percentOpen) {
			mTrans.transformCanvas(canvas, percentOpen);
			float f = interp.getInterpolation(percentOpen);
			canvas.rotate((openedDeg - closedDeg) * f + closedDeg, 
					px, py);
		}			
	};
	return mTrans;
}
 
开发者ID:ChenTianSaber,项目名称:DailyZhiHu,代码行数:14,代码来源:CanvasTransformerBuilder.java

示例9: translate

import android.view.animation.Interpolator; //导入方法依赖的package包/类
public CanvasTransformer translate(final int openedX, final int closedX, 
		final int openedY, final int closedY, final Interpolator interp) {
	initTransformer();
	mTrans = new CanvasTransformer() {
		public void transformCanvas(Canvas canvas, float percentOpen) {
			mTrans.transformCanvas(canvas, percentOpen);
			float f = interp.getInterpolation(percentOpen);
			canvas.translate((openedX - closedX) * f + closedX,
					(openedY - closedY) * f + closedY);
		}			
	};
	return mTrans;
}
 
开发者ID:QuixomTech,项目名称:WeatherStream,代码行数:14,代码来源:CanvasTransformerBuilder.java

示例10: lerp

import android.view.animation.Interpolator; //导入方法依赖的package包/类
private static float lerp(float startValue, float endValue, float fraction,
          Interpolator interpolator) {
  if (interpolator != null) {
    fraction = interpolator.getInterpolation(fraction);
  }
  return AnimationUtils.lerp(startValue, endValue, fraction);
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:8,代码来源:CollapsingTextHelper.java

示例11: computeStartOffset

import android.view.animation.Interpolator; //导入方法依赖的package包/类
/**
 * refers to { LayoutAnimationController#getDelayForView(View view)}
 */
private static long computeStartOffset(final int childCount, final boolean expanded, final int index,
        final float delayPercent, final long duration, Interpolator interpolator) {
    final float delay = delayPercent * duration;
    final long viewDelay = (long) (getTransformedIndex(expanded, childCount, index) * delay);
    final float totalDelay = delay * childCount;

    float normalizedDelay = viewDelay / totalDelay;
    normalizedDelay = interpolator.getInterpolation(normalizedDelay);

    return (long) (normalizedDelay * totalDelay);
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:15,代码来源:ArcLayout.java

示例12: computeStartOffset

import android.view.animation.Interpolator; //导入方法依赖的package包/类
/**
 * refers to {@link LayoutAnimationController#getDelayForView(View view)}
 */
private static long computeStartOffset(final int childCount, final boolean expanded, final int index,
		final float delayPercent, final long duration, Interpolator interpolator) {
	final float delay = delayPercent * duration;
	final long viewDelay = (long) (getTransformedIndex(expanded, childCount, index) * delay);
	final float totalDelay = delay * childCount;

	float normalizedDelay = viewDelay / totalDelay;
	normalizedDelay = interpolator.getInterpolation(normalizedDelay);

	return (long) (normalizedDelay * totalDelay);
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:15,代码来源:RayLayout.java

示例13: computeStartOffset

import android.view.animation.Interpolator; //导入方法依赖的package包/类
private static long computeStartOffset(final int childCount, final boolean expanded, final int index,
                                       final float delayPercent, final long duration, Interpolator interpolator) {
    final float delay = delayPercent * duration;
    final long viewDelay = (long) (getTransformedIndex(expanded, childCount, index) * delay);
    final float totalDelay = delay * childCount;

    float normalizedDelay = viewDelay / totalDelay;
    normalizedDelay = interpolator.getInterpolation(normalizedDelay);

    return (long) (normalizedDelay * totalDelay);
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:12,代码来源:RayLayout.java


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