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


Java TransitionValues类代码示例

本文整理汇总了Java中android.transition.TransitionValues的典型用法代码示例。如果您正苦于以下问题:Java TransitionValues类的具体用法?Java TransitionValues怎么用?Java TransitionValues使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createAnimator

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
    if (startValues == null || endValues == null) {
        return null;
    }

    Float startSize = (Float) startValues.values.get(PROPNAME_TEXT_SIZE);
    Float endSize = (Float) endValues.values.get(PROPNAME_TEXT_SIZE);
    if (startSize == null || endSize == null || startSize.floatValue() == endSize.floatValue()) {
        return null;
    }

    TextView view = (TextView) endValues.view;
    view.setTextSize(TypedValue.COMPLEX_UNIT_PX, startSize);
    return ObjectAnimator.ofFloat(view, TEXT_SIZE_PROPERTY, startSize, endSize);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:TextSizeTransition.java

示例2: captureStartValues

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public void captureStartValues(TransitionValues transitionValues) {
    final View view = transitionValues.view;
    if (view.getWidth() <= 0 || view.getHeight() <= 0) {
        return;
    }
    captureValues(transitionValues);
    Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(),
            Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(bitmap);
    view.draw(canvas);
    transitionValues.values.put(PROPERTY_IMAGE, bitmap);
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:14,代码来源:PlayTransition.java

示例3: createAnimator

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator createAnimator(ViewGroup sceneRoot,
                               TransitionValues startValues,
                               TransitionValues endValues) {
    if (animatable == null || endValues == null
            || !(endValues.view instanceof ImageView)) return null;

    ImageView iv = (ImageView) endValues.view;
    iv.setImageDrawable((Drawable) animatable);

    // need to return a non-null Animator even though we just want to listen for the start
    ValueAnimator transition = ValueAnimator.ofInt(0, 1);
    transition.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationStart(Animator animation) {
            animatable.start();
        }
    });
    return transition;
}
 
开发者ID:zxj1999,项目名称:PokeMusic,代码行数:21,代码来源:StartAnimatable.java

示例4: onAppear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, View view,
                         TransitionValues startValues,
                         TransitionValues endValues) {
    view.setPivotX(view.getWidth());
    view.setPivotY(view.getHeight()/2);
    return ObjectAnimator.ofFloat(view,View.SCALE_X,0,1).setDuration(400);
}
 
开发者ID:vpaliyX,项目名称:Melophile,代码行数:9,代码来源:BackgroundScale.java

示例5: captureEndValues

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public void captureEndValues(TransitionValues transitionValues) {
    super.captureEndValues(transitionValues);
    final View view = transitionValues.view;
    if (view.getWidth() <= 0 || view.getHeight() <= 0) {
        return;
    }
    transitionValues.values.put(PROPERTY_COLOR, endColor);//ContextCompat.getColor(view.getContext(), R.color.dialog_background_color)
    transitionValues.values.put(PROPERTY_CORNER_RADIUS, endCornerRadius);
}
 
开发者ID:li-yu,项目名称:Huahui-Android,代码行数:11,代码来源:MorphTransition.java

示例6: captureEndValues

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public void captureEndValues(TransitionValues transitionValues) {
    super.captureEndValues(transitionValues);
    Photo photo = Mysplash.getInstance().getPhoto();
    if (photo != null) {
        int screenWidth = context.getResources().getDisplayMetrics().widthPixels;
        int[] sizes = FreedomImageView.getMeasureSize(
                context, screenWidth, photo.width, photo.height, true);
        Rect bounds = (Rect) transitionValues.values.get(PROPNAME_BOUNDS);
        bounds.left = 0;
        bounds.top = 0;
        bounds.right = sizes[0];
        bounds.bottom = sizes[1];
        transitionValues.values.put(PROPNAME_BOUNDS, bounds);
    }
}
 
开发者ID:WangDaYeeeeee,项目名称:Mysplash,代码行数:17,代码来源:CoverTransition.java

示例7: onAppear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, View view,
                         TransitionValues startValues, TransitionValues endValues) {

    view.setRotationY(-90);
    Animator rotateY = ObjectAnimator.ofFloat(view, "rotationY", 0);
    rotateY.setDuration(1000);
    rotateY.setStartDelay(500);
    CardFlipRotationListener listener = new CardFlipRotationListener(view);
    rotateY.addListener(listener);
    addListener(listener);
    rotateY.addPauseListener(listener);
    // set Interpolator later

    return rotateY;
}
 
开发者ID:suzp1984,项目名称:AndroidFlipCardTransition,代码行数:17,代码来源:CardFlipTransition.java

示例8: onAppear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues,
        TransitionValues endValues) {
    if (endValues == null) {
        return null;
    }
    int[] position = (int[]) endValues.values.get(PROPNAME_SCREEN_POSITION);
    int left = position[0];
    float endX = view.getTranslationX();
    float startX = mSlideCalculator.getGoneX(sceneRoot, view, position, mDistance);
    final Animator slideAnimator = TranslationAnimationCreator.createAnimation(view, endValues,
            left, startX, endX, APPEAR_INTERPOLATOR, this);
    if (slideAnimator == null) {
        return null;
    }
    mFade.setInterpolator(APPEAR_INTERPOLATOR);
    final AnimatorSet set = new AnimatorSet();
    set.play(slideAnimator).with(mFade.onAppear(sceneRoot, view, startValues, endValues));
    Long delay = (Long ) endValues.values.get(PROPNAME_DELAY);
    if (delay != null) {
        set.setStartDelay(delay);
    }
    return set;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:25,代码来源:FadeAndShortSlide.java

示例9: onDisappear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onDisappear(ViewGroup sceneRoot, final View view, TransitionValues startValues,
                            TransitionValues endValues) {
    if (!(view instanceof ImageView)) {
        return null;
    }

    final ImageView iv = (ImageView) view;
    final Drawable drawable = iv.getDrawable();

    if (drawable == null) {
        return null;
    }

    final ValueAnimator anim = ValueAnimator.ofInt(255, 0);
    anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            final int alpha = (int) valueAnimator.getAnimatedValue();
            drawable.setAlpha(alpha);
        }
    });
    return anim;
}
 
开发者ID:yanzm,项目名称:FabTransformingSample,代码行数:25,代码来源:ImageFade.java

示例10: createAnimator

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
    public Animator createAnimator(final ViewGroup sceneRoot,
                                   TransitionValues startValues,
                                   final TransitionValues endValues) {

        Animator changeBounds = super.createAnimator(sceneRoot, startValues, endValues);
        if (startValues == null || endValues == null || changeBounds == null)
            return null;

//        if (endValues.view instanceof ViewGroup) {
//            ViewGroup vg = (ViewGroup) endValues.view;
//            float offset = vg.getHeight() / 3;
//            for (int i = 0; i < vg.getChildCount(); i++) {
//                View v = vg.getChildAt(i);
//                v.setTranslationY(offset);
//                v.setAlpha(0f);
//                v.animate()
//                        .alpha(1f)
//                        .translationY(0f)
//                        .setDuration(150)
//                        .setStartDelay(150)
//                        .setInterpolator(AnimationUtils.loadInterpolator(vg.getContext(),
//                                android.R.interpolator.fast_out_slow_in));
//                offset *= 1.8f;
//            }
//        }

        changeBounds.setDuration(500);
        changeBounds.setInterpolator(AnimationUtils.loadInterpolator(sceneRoot.getContext(),
                android.R.interpolator.fast_out_slow_in));
        return changeBounds;
    }
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:33,代码来源:CustomChangeBounds.java

示例11: createAnimator

import android.transition.TransitionValues; //导入依赖的package包/类
@Override public Animator createAnimator(final ViewGroup sceneRoot, TransitionValues startValues,
    TransitionValues endValues) {

  senderNameView.setVisibility(View.INVISIBLE);
  senderMailView.setVisibility(View.INVISIBLE);
  separatorLine.setVisibility(View.INVISIBLE);
  return super.createAnimator(sceneRoot, startValues, endValues);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ExplodeFadeExitTransition.java

示例12: onAppear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, final View view, TransitionValues startValues,
                         TransitionValues endValues) {

    Animator reveal = ViewAnimationUtils.createCircularReveal(view, 140, 200,
        0, 1000);
    return new NoPauseAnimator(reveal);

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:RevealVisibilityTransition.java

示例13: onDisappear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues,
                            TransitionValues endValues) {

    Animator reveal = ViewAnimationUtils.createCircularReveal(view, 140, 200,
       1000, 0);
    return new NoPauseAnimator(reveal);

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:RevealVisibilityTransition.java

示例14: onAppear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) {
    Animator animator = ViewAnimationUtils.createCircularReveal(view, mEpicenter.x, mEpicenter.y,
            mSmallRadius, mBigRadius);
    animator.setDuration(mDuration);
    return new PauseableAnimator(animator);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RevealTransition.java

示例15: onDisappear

import android.transition.TransitionValues; //导入依赖的package包/类
@Override
public Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) {
    Animator animator = ViewAnimationUtils.createCircularReveal(view, mEpicenter.x, mEpicenter.y,
            mBigRadius, mSmallRadius);
    animator.setDuration(mDuration);
    return new PauseableAnimator(animator);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RevealTransition.java


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