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


Java TransitionController类代码示例

本文整理汇总了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));
}
 
开发者ID:5GSD,项目名称:AIMSICDL,代码行数:23,代码来源:ScaledTransitionHandler.java

示例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));
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:17,代码来源:ViewTransitionBuilder.java

示例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);
    }
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:18,代码来源:OnPageChangeListenerAdapter.java

示例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));
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:23,代码来源:ScaledTransformer.java

示例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));
}
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:5,代码来源:ColorTransformer.java

示例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);
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:7,代码来源:ScaledTransformer.java

示例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);
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:9,代码来源:ColorTransformer.java

示例8: updateView

import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
/**
 *
 * @param controller
 * @param target
 * @param progress
 */
void updateView(TransitionController controller, View target, float progress);
 
开发者ID:kaichunlin,项目名称:android-transition,代码行数:8,代码来源:ViewTransformer.java

示例9: onUpdateScaledProgress

import com.kaichunlin.transition.internal.TransitionController; //导入依赖的package包/类
protected abstract void onUpdateScaledProgress(TransitionController controller, View target, float modifiedProgress); 
开发者ID:5GSD,项目名称:AIMSICDL,代码行数:2,代码来源:ScaledTransitionHandler.java


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