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


Java ObjectAnimator.setTarget方法代码示例

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


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

示例1: createBaseWobble

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private ObjectAnimator createBaseWobble(final View v) {

    if (!isPreLollipop())
        v.setLayerType(LAYER_TYPE_SOFTWARE, null);

    ObjectAnimator animator = new ObjectAnimator();
    animator.setDuration(180);
    animator.setRepeatMode(ValueAnimator.REVERSE);
    animator.setRepeatCount(ValueAnimator.INFINITE);
    animator.setPropertyName("rotation");
    animator.setTarget(v);
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            v.setLayerType(LAYER_TYPE_NONE, null);
        }
    });
    return animator;
}
 
开发者ID:jpaijh,项目名称:TYT,代码行数:21,代码来源:DynamicGridView.java

示例2: build

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * build a copy of given animator
 *
 * @return
 */
public Animator build() {
    //这种方式clone出来的animator不能重复播放
    /*final ObjectAnimator result = getAnimator().clone();//克隆一份
    setupListeners(result);
    result.setupStartValues();
    return result;*/

    final ObjectAnimator self = this.getAnimator();
    final ObjectAnimator anim = new ObjectAnimator();
    anim.setTarget(self.getTarget());
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        anim.setAutoCancel(true);
    }
    if (self.getValues() != null) {
        anim.setValues(self.getValues());
    }
    anim.setInterpolator(self.getInterpolator());
    anim.setDuration(self.getDuration());
    anim.setStartDelay(self.getStartDelay());
    anim.setRepeatCount(self.getRepeatCount());
    anim.setRepeatMode(self.getRepeatMode());
    setupListeners(anim);
    return anim;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:30,代码来源:UDAnimator.java

示例3: with

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * 设置target
 *
 * @param udView
 * @return
 */
public UDAnimator with(UDView udView) {
    final ObjectAnimator animator = getAnimator();
    if (animator != null && udView != null && udView.getView() != null) {
        mTarget = udView;
        animator.setTarget(udView.getView());
    }
    return this;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:15,代码来源:UDAnimator.java

示例4: loadObjectAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private ObjectAnimator loadObjectAnimator(final int resId, final Object target) {
    if (resId == 0) {
        // TODO: Stop returning null.
        return null;
    }
    final ObjectAnimator animator = (ObjectAnimator)AnimatorInflater.loadAnimator(
            getContext(), resId);
    if (animator != null) {
        animator.setTarget(target);
    }
    return animator;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:13,代码来源:MainKeyboardView.java

示例5: initAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void initAnimator() {
    mPressAnimator = ObjectAnimator.ofFloat(this, DEGREE, 0, -45);
    mPressAnimator.setDuration(1000);

    mUpAnimator = new AnimatorSet();
    mDegreeAnimator = new ObjectAnimator();
    mDegreeAnimator.setTarget(this);
    mDegreeAnimator.setProperty(DEGREE);
    mBallAnimator = new ObjectAnimator();
    mBallAnimator.setTarget(this);
    mBallAnimator.setProperty(BALLLOCATION);
    mUpAnimator.playTogether(mDegreeAnimator, mBallAnimator);
}
 
开发者ID:shellljx,项目名称:FuckingVolumeSlider,代码行数:14,代码来源:VolumeSliderView.java

示例6: ProgressBarView

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public ProgressBarView(ContainerType containerType, ViewGroup container,
        XSharedPreferences prefs, ProgressBarController ctrl) {
    super(container.getContext());

    mContainerType = containerType;
    mCtrl = ctrl;

    mAnimated = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_ANIMATED, true);
    mCentered = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_CENTERED, false);
    mHeightPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
            prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_THICKNESS, 1),
            getResources().getDisplayMetrics());
    mEdgeMarginPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
            prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_MARGIN, 0),
            getResources().getDisplayMetrics());

    setScaleX(0f);
    setBackgroundColor(Color.WHITE);
    setVisibility(View.GONE);
    container.addView(this);

    mAnimator = new ObjectAnimator();
    mAnimator.setTarget(this);
    mAnimator.setInterpolator(new DecelerateInterpolator());
    mAnimator.setDuration(ANIM_DURATION);
    mAnimator.setRepeatCount(0);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:28,代码来源:ProgressBarView.java


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