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


Java Animation.setInterpolator方法代码示例

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


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

示例1: hidePlusBar

import android.view.animation.Animation; //导入方法依赖的package包/类
protected void hidePlusBar() {
	mLayoutFullScreenMask.setEnabled(false);
	mLayoutMessagePlusBar.setEnabled(false);
	mLayoutMessagePlusPicture.setEnabled(false);
	mLayoutMessagePlusCamera.setEnabled(false);
	mLayoutMessagePlusLocation.setEnabled(false);
	mLayoutMessagePlusGift.setEnabled(false);
	mLayoutFullScreenMask.setVisibility(View.GONE);
	Animation animation = AnimationUtils.loadAnimation(
			BaseMessageActivity.this, R.anim.controller_exit);
	animation.setInterpolator(AnimationUtils.loadInterpolator(
			BaseMessageActivity.this,
			android.R.anim.anticipate_interpolator));
	mLayoutMessagePlusBar.setAnimation(animation);
	mLayoutMessagePlusBar.setVisibility(View.GONE);
}
 
开发者ID:qizhenghao,项目名称:HiBangClient,代码行数:17,代码来源:BaseMessageActivity.java

示例2: createAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * Create an animation object to be used to animate the view, based on the animation config
 * supplied at initialization time and the new view position and size.
 *
 * @param view the view to create the animation for
 * @param x the new X position for the view
 * @param y the new Y position for the view
 * @param width the new width value for the view
 * @param height the new height value for the view
 */
 public final @Nullable Animation createAnimation(
     View view,
     int x,
     int y,
     int width,
     int height) {
  if (!isValid()) {
    return null;
  }
  Animation animation = createAnimationImpl(view, x, y, width, height);
  if (animation != null) {
    int slowdownFactor = SLOWDOWN_ANIMATION_MODE ? 10 : 1;
    animation.setDuration(mDurationMs * slowdownFactor);
    animation.setStartOffset(mDelayMs * slowdownFactor);
    animation.setInterpolator(mInterpolator);
  }
  return animation;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:29,代码来源:AbstractLayoutAnimation.java

示例3: createShrinkAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
		long startOffset, long duration, Interpolator interpolator) {
	AnimationSet animationSet = new AnimationSet(false);
	animationSet.setFillAfter(true);

	final long preDuration = duration / 2;
	Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
			Animation.RELATIVE_TO_SELF, 0.5f);
	rotateAnimation.setStartOffset(startOffset);
	rotateAnimation.setDuration(preDuration);
	rotateAnimation.setInterpolator(new LinearInterpolator());
	rotateAnimation.setFillAfter(true);

	animationSet.addAnimation(rotateAnimation);

	Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
	translateAnimation.setStartOffset(startOffset + preDuration);
	translateAnimation.setDuration(duration - preDuration);
	translateAnimation.setInterpolator(interpolator);
	translateAnimation.setFillAfter(true);

	animationSet.addAnimation(translateAnimation);

	return animationSet;
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:26,代码来源:RayLayout.java

示例4: a

import android.view.animation.Animation; //导入方法依赖的package包/类
private View a(Context context) {
    View linearLayout = new LinearLayout(context);
    LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, a(context, (float) IntFloatWheelView.DEFAULT_VALUE));
    layoutParams.gravity = 17;
    linearLayout.setOrientation(0);
    linearLayout.setLayoutParams(layoutParams);
    Drawable gradientDrawable = new GradientDrawable();
    gradientDrawable.setColor(-450944201);
    gradientDrawable.setCornerRadius((float) a(context, 5.0f));
    linearLayout.setBackgroundDrawable(gradientDrawable);
    View imageView = new ImageView(context);
    layoutParams = new LinearLayout.LayoutParams(a(context, 20.0f), a(context, 20.0f));
    layoutParams.gravity = 16;
    layoutParams.setMargins(a(this.a.f, 17.0f), a(this.a.f, 10.0f), a(this.a.f, 8.0f), a(this.a.f, 10.0f));
    imageView.setLayoutParams(layoutParams);
    imageView.setScaleType(ScaleType.FIT_CENTER);
    imageView.setImageDrawable(a(context, a.d));
    Animation rotateAnimation = new RotateAnimation(0.0f, 359.0f, 1, 0.5f, 1, 0.5f);
    rotateAnimation.setRepeatCount(-1);
    rotateAnimation.setDuration(900);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    imageView.startAnimation(rotateAnimation);
    View textView = new TextView(context);
    textView.setText(TextUtils.isEmpty(this.a.g) ? a.a : this.a.g);
    textView.setTextSize(16.0f);
    textView.setTextColor(-1);
    layoutParams = new LinearLayout.LayoutParams(-2, -2);
    layoutParams.gravity = 16;
    layoutParams.setMargins(0, 0, a(context, 17.0f), 0);
    textView.setLayoutParams(layoutParams);
    linearLayout.addView(imageView);
    linearLayout.addView(textView);
    return linearLayout;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:35,代码来源:a.java

示例5: snapBack

import android.view.animation.Animation; //导入方法依赖的package包/类
private void snapBack() {
    if (mMainWindows.getLayoutParams() instanceof RelativeLayout.LayoutParams) {
        final RelativeLayout.LayoutParams marginLayoutParams = (RelativeLayout.LayoutParams) mMainWindows.getLayoutParams();

        final int startValueX = marginLayoutParams.leftMargin;
        final int startValueY = marginLayoutParams.topMargin;
        final int endValueX = 0;
        final int endValueY = 0;

        mMainWindows.clearAnimation();

        Animation animation = new Animation() {
            @Override
            protected void applyTransformation(float interpolatedTime, Transformation t) {
                int leftMarginInterpolatedValue = (int) (startValueX + (endValueX - startValueX) * interpolatedTime);
                marginLayoutParams.leftMargin = leftMarginInterpolatedValue;

                int topMarginInterpolatedValue = (int) (startValueY + (endValueY - startValueY) * interpolatedTime);
                marginLayoutParams.topMargin = topMarginInterpolatedValue;

                mMainWindows.requestLayout();
            }
        };
        animation.setDuration(400);
        animation.setInterpolator(new DecelerateInterpolator());
        mMainWindows.startAnimation(animation);
    }
}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:29,代码来源:MediaLockscreenActivity.java

示例6: inFromRightAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private Animation inFromRightAnimation() {

        Animation inFromRight = new TranslateAnimation(
                Animation.RELATIVE_TO_PARENT, +1.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f);
        inFromRight.setDuration(600);
        inFromRight.setInterpolator(new AccelerateInterpolator());
        return inFromRight;
    }
 
开发者ID:sarveshchavan7,项目名称:Trivia-Knowledge,代码行数:12,代码来源:about.java

示例7: showAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
public Animation showAnimation() {
    Animation animation = new AlphaAnimation(0.0f,1.0f);
    animation.setDuration(200);
    animation.setInterpolator(new DecelerateInterpolator());
    return animation;
}
 
开发者ID:fingdo,项目名称:stateLayout,代码行数:8,代码来源:FadeViewAnimProvider.java

示例8: createHintSwitchAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation createHintSwitchAnimation(final boolean expanded) {
    Animation animation = new RotateAnimation(expanded ? 45 : 0, expanded ? 0 : 45, Animation.RELATIVE_TO_SELF,
            0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setStartOffset(0);
    animation.setDuration(100);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setFillAfter(true);

    return animation;
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:11,代码来源:ArcMenu.java

示例9: setupAnimations

import android.view.animation.Animation; //导入方法依赖的package包/类
private void setupAnimations() {
    mAnimation = new Animation() {
        @Override
        public void applyTransformation(float interpolatedTime, Transformation t) {
            setRotate(interpolatedTime);
        }
    };
    mAnimation.setRepeatCount(Animation.INFINITE);
    mAnimation.setRepeatMode(Animation.RESTART);
    mAnimation.setInterpolator(LINEAR_INTERPOLATOR);
    mAnimation.setDuration(ANIMATION_DURATION);
}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:13,代码来源:RentalsSunDrawable.java

示例10: fadeIn

import android.view.animation.Animation; //导入方法依赖的package包/类
static void fadeIn(View view, int duration) {
    Animation anim = new AlphaAnimation(0.0f, 1.0f);
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.setDuration(duration);

    view.setAnimation(anim);
    view.setVisibility(View.VISIBLE);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:9,代码来源:SearchAnimator.java

示例11: animateToTab

import android.view.animation.Animation; //导入方法依赖的package包/类
private void animateToTab(int newPosition) {
clearAnimation();

if (newPosition == Tab.INVALID_POSITION) {
  return;
}

if (getWindowToken() == null || !ViewCompat.isLaidOut(this)) {
  // If we don't have a window token, or we haven't been laid out yet just draw the new
  // position now
  setScrollPosition(newPosition, 0f);
  return;
}

final int startScrollX = getScrollX();
final int targetScrollX = calculateScrollXForTab(newPosition, 0);
final int duration = ANIMATION_DURATION;

if (startScrollX != targetScrollX) {
  final Animation animation = new Animation() {
	@Override
	protected void applyTransformation(float interpolatedTime, Transformation t) {
	  final float value = lerp(startScrollX, targetScrollX, interpolatedTime);
	  scrollTo((int) value, 0);
	}
  };
  animation.setInterpolator(INTERPOLATOR);
  animation.setDuration(duration);
  startAnimation(animation);
}

// Now animate the indicator
mTabStrip.animateIndicatorToPosition(newPosition, duration);
 }
 
开发者ID:TIIEHenry,项目名称:TIIEHenry-Android-SDK,代码行数:35,代码来源:TabLayout.java

示例12: showActionBar

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * Display the ActionBar using an animation if we are in full-screen
 * mode. This method also re-parents the ActionBar if its parent is
 * incorrect so that the animation can happen correctly.
 */
@Override
public void showActionBar() {
    if (mFullScreen) {
        Log.d(TAG, "showActionBar");
        if (mToolbarLayout == null)
            return;

        int height = mToolbarLayout.getHeight();
        if (height == 0) {
            mToolbarLayout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
            height = mToolbarLayout.getMeasuredHeight();
        }

        final int totalHeight = height;
        if (mToolbarLayout.getTranslationY() < -(height - 0.01f)) {
            Animation show = new Animation() {
                @Override
                protected void applyTransformation(float interpolatedTime, Transformation t) {
                    float trans = interpolatedTime * totalHeight;
                    mToolbarLayout.setTranslationY(trans - totalHeight);
                    setWebViewTranslation(trans);
                }
            };
            show.setDuration(250);
            show.setInterpolator(new BezierDecelerateInterpolator());
            mBrowserFrame.startAnimation(show);
        }
    }
}
 
开发者ID:XndroidDev,项目名称:Xndroid,代码行数:35,代码来源:BrowserActivity.java

示例13: startRotation

import android.view.animation.Animation; //导入方法依赖的package包/类
public static Animation startRotation(Context mContext, View view) {
    Animation circle_anim=null;
    if (circle_anim == null) {
        circle_anim = AnimationUtils.loadAnimation(mContext, R.anim.anim_round_rotate);
    }
    LinearInterpolator interpolator = new LinearInterpolator();
    circle_anim.setInterpolator(interpolator);
    if (circle_anim != null) {
        view.startAnimation(circle_anim);

    }
    return circle_anim;
}
 
开发者ID:scanflijinhuan,项目名称:MyFriendsComment,代码行数:14,代码来源:AnimTools.java

示例14: shakeAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
/**
 * 晃动动画
 * @param counts 0.5秒钟晃动多少下
 * @return
 */
private Animation shakeAnimation(int counts){
    Animation translateAnimation = new TranslateAnimation(0, 10, 0, 0);
    translateAnimation.setInterpolator(new CycleInterpolator(counts));
    translateAnimation.setDuration(500);
    return translateAnimation;
}
 
开发者ID:AndroidWJC,项目名称:UnversityFinance,代码行数:12,代码来源:ClearEditText.java

示例15: getAlphaAnimation

import android.view.animation.Animation; //导入方法依赖的package包/类
private static Animation getAlphaAnimation(float from, float to, int duration) {
  final Animation anim = new AlphaAnimation(from, to);
  anim.setInterpolator(new FastOutSlowInInterpolator());
  anim.setDuration(duration);
  return anim;
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:7,代码来源:ViewUtil.java


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