當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。