本文整理汇总了Java中com.kaichunlin.transition.internal.TransitionController类的典型用法代码示例。如果您正苦于以下问题:Java TransitionController类的具体用法?Java TransitionController怎么用?Java TransitionController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TransitionController类属于com.kaichunlin.transition.internal包,在下文中一共展示了TransitionController类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdateProgress
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
@Override
public final void onUpdateProgress(TransitionController controller, View target, float progress) {
final float start = controller.getStart();
final float end = controller.getEnd();
if (progress < start) {
if (updateOnceOutsideRange && updateMinProgress) {
onUpdateScaledProgress(controller, target, 0);
}
updateMinProgress = false;
return;
}
updateMinProgress = true;
if (progress > end) {
if (updateOnceOutsideRange && updateMaxProgress) {
onUpdateScaledProgress(controller, target, 1);
}
updateMaxProgress = false;
return;
}
updateMaxProgress = true;
onUpdateScaledProgress(controller, target, (progress - start) / (end - start));
}
示例2: updateViewScaled
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
@Override
public void updateViewScaled(TransitionController controller, View target, float scaledProgress) {
//source: http://stackoverflow.com/questions/18216285/android-animate-color-change-from-color-to-color
final float[] from = new float[3],
to = new float[3];
Color.colorToHSV(fromColor, from);
Color.colorToHSV(toColor, to);
final float[] hsv = new float[3];
// Transition along each axis of HSV (hue, saturation, value)
hsv[0] = from[0] + (to[0] - from[0]) * scaledProgress;
hsv[1] = from[1] + (to[1] - from[1]) * scaledProgress;
hsv[2] = from[2] + (to[2] - from[2]) * scaledProgress;
target.setBackgroundColor(Color.HSVToColor(hsv));
}
示例3: updateView
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
@Override
public void updateView(TransitionController controller, View target, float progress) {
float x = 0;
if (progress <= 0) {
x = target.getWidth() * -progress;
if (oldX == x) {
return;
}
oldX = x;
target.setTranslationX(x);
} else {
target.setTranslationX(0);
}
if (TransitionConfig.isDebug()) {
controller.getTransitionStateHolder().append(controller.getId() + "->" + target, this, "CUSTOM updateProgress=" + progress + ": \t[" + controller.getStart() + ".." + controller.getEnd() + "], translationX=" + x);
}
}
示例4: updateView
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
@Override
public final void updateView(TransitionController controller, View target, float progress) {
final float start = controller.getStart();
final float end = controller.getEnd();
if (progress < start) {
if (updateOnceOutsideRange && updateMinProgress) {
updateViewScaled(controller, target, 0);
}
updateMinProgress = false;
return;
}
updateMinProgress = true;
if (progress > end) {
if (updateOnceOutsideRange && updateMaxProgress) {
updateViewScaled(controller, target, 1);
}
updateMaxProgress = false;
return;
}
updateMaxProgress = true;
updateViewScaled(controller, target, (progress - start) / (end - start));
}
示例5: updateViewScaled
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
@Override
protected void updateViewScaled(TransitionController controller, View target, float scaledProgress) {
updateViewWithColor(controller, target, evaluate(scaledProgress, startColor, endColor));
}
示例6: updateViewScaled
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
/**
* @param controller
* @param target
* @param scaledProgress
*/
protected abstract void updateViewScaled(TransitionController controller, View target, float scaledProgress);
示例7: updateViewWithColor
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
/**
* Similar to {@link #updateView(TransitionController, View, float)}, with the addition of the current color.
*
* @param controller
* @param target
* @param color The current color calculated using the starting color, the end color, and the current progress.
*/
protected abstract void updateViewWithColor(TransitionController controller, View target, int color);
示例8: updateView
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
/**
*
* @param controller
* @param target
* @param progress
*/
void updateView(TransitionController controller, View target, float progress);
示例9: onUpdateScaledProgress
import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
protected abstract void onUpdateScaledProgress(TransitionController controller, View target, float modifiedProgress);