java类android.animation.AnimatorSet的实例源码

DrawerLayoutContainer.java 文件源码 项目:airgram 阅读 51 收藏 0 点赞 0 评论 0
public void openDrawer(boolean fast) {
    if (!allowOpenDrawer) {
        return;
    }
    if (AndroidUtilities.isTablet() && parentActionBarLayout != null && parentActionBarLayout.parentActivity != null) {
        AndroidUtilities.hideKeyboard(parentActionBarLayout.parentActivity.getCurrentFocus());
    }
    cancelCurrentAnimation();
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(ObjectAnimator.ofFloat(this, "drawerPosition", drawerLayout.getMeasuredWidth()));
    animatorSet.setInterpolator(new DecelerateInterpolator());
    if (fast) {
        animatorSet.setDuration(Math.max((int) (200.0f / drawerLayout.getMeasuredWidth() * (drawerLayout.getMeasuredWidth() - drawerPosition)), 50));
    } else {
        animatorSet.setDuration(300);
    }
    animatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animator) {
            onDrawerAnimationEnd(true);
        }
    });
    animatorSet.start();
    currentAnimation = animatorSet;
}
CircularAnimatedDrawable.java 文件源码 项目:RoundButton 阅读 26 收藏 0 点赞 0 评论 0
/**
 * @param view        View to be animated
 * @param borderWidth The width of the spinning bar
 * @param arcColor    The color of the spinning bar
 */
public CircularAnimatedDrawable(View view, float borderWidth, int arcColor, @DrawableRes int innerResource, @ColorInt int innerResourceColorFilter) {
    mAnimatedView = view;
    mBorderWidth = borderWidth;

    if (innerResource != 0) {
        setInnerResource(innerResource);
        setInnerResourceColorFilter(innerResourceColorFilter);
    }

    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeWidth(borderWidth);
    mPaint.setColor(arcColor);

    setupAnimations();

    shouldDraw = true;

    mAnimatorSet = new AnimatorSet();
}
MainActivity.java 文件源码 项目:GitHub 阅读 24 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    user = (ClearEditText) findViewById(R.id.user);
    user.addTextChangedListener(userTextWatcher);
    user.setOnFocusChangeListener(this);

    pass = (ClearEditText) findViewById(R.id.pass);
    pass.setOnFocusChangeListener(this);
    pass.addTextChangedListener(passTextWatcher);

    login = (Button) findViewById(R.id.login);
    login.setOnClickListener(this);
    register = (Button) findViewById(R.id.register);
    register.setOnClickListener(this);
    forget = (TextView) findViewById(R.id.forget);

    ObjectAnimator animator = ObjectAnimator.ofFloat(forget, "rotation", 0, 360f);
    ObjectAnimator animator1 = ObjectAnimator.ofFloat(forget, "alpha", 1f, 0f, 1f);
    AnimatorSet set = new AnimatorSet();
    set.play(animator).with(animator1);
    set.setDuration(5000);
    set.start();
}
QsbBlockerView.java 文件源码 项目:FlickLauncher 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void prepareStateChange(State toState, AnimatorSet targetAnim) {
    int finalAlpha = getAlphaForState(toState);
    if (targetAnim == null) {
        mBgPaint.setAlpha(finalAlpha);
        invalidate();
    } else {
        ObjectAnimator anim = ObjectAnimator.ofArgb(mBgPaint, "alpha", finalAlpha);
        anim.addUpdateListener(new AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                invalidate();
            }
        });
        targetAnim.play(anim);
    }
}
KeyPreviewDrawParams.java 文件源码 项目:simple-keyboard 阅读 26 收藏 0 点赞 0 评论 0
public Animator createDismissAnimator(final View target) {
    if (mHasCustomAnimationParams) {
        final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(
                target, View.SCALE_X, mDismissEndXScale);
        final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(
                target, View.SCALE_Y, mDismissEndYScale);
        final AnimatorSet dismissAnimator = new AnimatorSet();
        dismissAnimator.play(scaleXAnimator).with(scaleYAnimator);
        final int dismissDuration = Math.min(mDismissDuration, mLingerTimeout);
        dismissAnimator.setDuration(dismissDuration);
        dismissAnimator.setInterpolator(ACCELERATE_INTERPOLATOR);
        return dismissAnimator;
    }
    final Animator animator = AnimatorInflater.loadAnimator(
            target.getContext(), mDismissAnimatorResId);
    animator.setTarget(target);
    animator.setInterpolator(ACCELERATE_INTERPOLATOR);
    return animator;
}
SlideInUpAnimatorDecoration.java 文件源码 项目:LuaViewPlayground 阅读 35 收藏 0 点赞 0 评论 0
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getHeight() - target.getTop();
    animatorSet.playTogether(
            ObjectAnimator.ofFloat(target, "alpha", 0, 1),
            ObjectAnimator.ofFloat(target, "translationY", distance, 0)
    );
}
ChatActivityEnterView.java 文件源码 项目:PlusGram 阅读 35 收藏 0 点赞 0 评论 0
private void hideRecordedAudioPanel() {
    audioToSendPath = null;
    audioToSend = null;
    audioToSendMessageObject = null;
    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.playTogether(
            ObjectAnimator.ofFloat(recordedAudioPanel, "alpha", 0.0f)
    );
    AnimatorSet.setDuration(200);
    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animation) {
            recordedAudioPanel.setVisibility(GONE);

        }
    });
    AnimatorSet.start();
}
WorkspaceStateTransitionAnimation.java 文件源码 项目:SimpleUILauncher 阅读 27 收藏 0 点赞 0 评论 0
public AnimatorSet getAnimationToState(Workspace.State fromState, Workspace.State toState,
        boolean animated, HashMap<View, Integer> layerViews) {
    AccessibilityManager am = (AccessibilityManager)
            mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE);
    final boolean accessibilityEnabled = am.isEnabled();
    TransitionStates states = new TransitionStates(fromState, toState);
    int workspaceDuration = getAnimationDuration(states);
    animateWorkspace(states, animated, workspaceDuration, layerViews,
            accessibilityEnabled);
    animateBackgroundGradient(states, animated, BACKGROUND_FADE_OUT_DURATION);
    return mStateAnimator;
}
AnimationUtils.java 文件源码 项目:Wings2K16 阅读 26 收藏 0 点赞 0 评论 0
public static void animateSunblind(RecyclerView.ViewHolder holder, boolean goesDown) {
    int holderHeight = holder.itemView.getHeight();
    holder.itemView.setPivotY(goesDown == true ? 0 : holderHeight);
    holder.itemView.setPivotX(holder.itemView.getHeight());
    AnimatorSet animatorSet = new AnimatorSet();
    ObjectAnimator animatorTranslateY = ObjectAnimator.ofFloat(holder.itemView, "translationY", goesDown == true ? 300 : -300, 0);
    ObjectAnimator animatorRotation = ObjectAnimator.ofFloat(holder.itemView, "rotationX", goesDown == true ? -90f : 90, 0f);
    ObjectAnimator animatorScaleX = ObjectAnimator.ofFloat(holder.itemView, "scaleX", 0.5f, 1f);
    animatorSet.playTogether(animatorTranslateY, animatorRotation, animatorScaleX);
    animatorSet.setInterpolator(new DecelerateInterpolator(1.1f));
    animatorSet.setDuration(1000);
    animatorSet.start();
}
MorphDialogToFab.java 文件源码 项目:Huahui-Android 阅读 63 收藏 0 点赞 0 评论 0
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public Animator createAnimator(final ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
    Animator changeBounds = super.createAnimator(sceneRoot, startValues, endValues);
    if (startValues == null || endValues == null || changeBounds == null) {
        return null;
    }

    Integer startColor = (Integer) startValues.values.get(PROPERTY_COLOR);
    Integer startCornerRadius = (Integer) startValues.values.get(PROPERTY_CORNER_RADIUS);
    Integer endColor = (Integer) endValues.values.get(PROPERTY_COLOR);
    Integer endCornerRadius = (Integer) endValues.values.get(PROPERTY_CORNER_RADIUS);

    if (startColor == null || startCornerRadius == null || endColor == null || endCornerRadius == null) {
        return null;
    }

    MorphDrawable background = new MorphDrawable(startColor, startCornerRadius);
    endValues.view.setBackground(background);

    Animator color = ObjectAnimator.ofArgb(background, background.COLOR, endColor);
    Animator corners = ObjectAnimator.ofFloat(background, background.CORNER_RADIUS, endCornerRadius);

    // hide child views (offset down & fade out)
    if (endValues.view instanceof ViewGroup) {
        ViewGroup vg = (ViewGroup) endValues.view;
        for (int i = 0; i < vg.getChildCount(); i++) {
            View v = vg.getChildAt(i);
            v.animate().alpha(0f).translationY(v.getHeight() / 3).setStartDelay(0L).setDuration(50L)
                    .setInterpolator(AnimationUtils.loadInterpolator(vg.getContext(), android.R.interpolator.fast_out_linear_in))
                    .start();
        }
    }

    AnimatorSet transition = new AnimatorSet();
    transition.playTogether(changeBounds, corners, color);
    transition.setInterpolator(AnimationUtils.loadInterpolator(sceneRoot.getContext(), android.R.interpolator.fast_out_slow_in));
    transition.setDuration(300);
    return transition;
}
SunsetFragment.java 文件源码 项目:AndroidProgramming3e 阅读 36 收藏 0 点赞 0 评论 0
private void startAnimation() {
    float sunYStart = mSunView.getTop();
    float sunYEnd = mSkyView.getHeight();

    ObjectAnimator heightAnimator = ObjectAnimator
            .ofFloat(mSunView, "y", sunYStart, sunYEnd)
            .setDuration(3000);
    heightAnimator.setInterpolator(new AccelerateInterpolator());

    ObjectAnimator sunsetSkyAnimator = ObjectAnimator
            .ofInt(mSkyView, "backgroundColor", mBlueSkyColor, mSunsetSkyColor)
            .setDuration(3000);
    sunsetSkyAnimator.setEvaluator(new ArgbEvaluator());

    ObjectAnimator nightSkyAnimator = ObjectAnimator
            .ofInt(mSkyView, "backgroundColor", mSunsetSkyColor, mNightSkyColor)
            .setDuration(1500);
    nightSkyAnimator.setEvaluator(new ArgbEvaluator());

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet
            .play(heightAnimator)
            .with(sunsetSkyAnimator)
            .before(nightSkyAnimator);
    animatorSet.start();
}
ShortcutsItemView.java 文件源码 项目:LaunchEnr 阅读 29 收藏 0 点赞 0 评论 0
@Override
public Animator createOpenAnimation(boolean isContainerAboveIcon, boolean pivotLeft) {
    AnimatorSet openAnimation = LauncherAnimUtils.createAnimatorSet();
    openAnimation.play(super.createOpenAnimation(isContainerAboveIcon, pivotLeft));
    for (int i = 0; i < mShortcutsLayout.getChildCount(); i++) {
        if (!(mShortcutsLayout.getChildAt(i) instanceof DeepShortcutView)) {
            continue;
        }
        DeepShortcutView shortcutView = ((DeepShortcutView) mShortcutsLayout.getChildAt(i));
        View deepShortcutIcon = shortcutView.getIconView();
        deepShortcutIcon.setScaleX(0);
        deepShortcutIcon.setScaleY(0);
        openAnimation.play(LauncherAnimUtils.ofPropertyValuesHolder(
                deepShortcutIcon, new PropertyListBuilder().scale(1).build()));
    }
    return openAnimation;
}
ShortcutsItemView.java 文件源码 项目:LaunchEnr 阅读 36 收藏 0 点赞 0 评论 0
@Override
public Animator createCloseAnimation(boolean isContainerAboveIcon, boolean pivotLeft,
        long duration) {
    AnimatorSet closeAnimation = LauncherAnimUtils.createAnimatorSet();
    closeAnimation.play(super.createCloseAnimation(isContainerAboveIcon, pivotLeft, duration));
    for (int i = 0; i < mShortcutsLayout.getChildCount(); i++) {
        if (!(mShortcutsLayout.getChildAt(i) instanceof DeepShortcutView)) {
            continue;
        }
        DeepShortcutView shortcutView = ((DeepShortcutView) mShortcutsLayout.getChildAt(i));
        View deepShortcutIcon = shortcutView.getIconView();
        deepShortcutIcon.setScaleX(1);
        deepShortcutIcon.setScaleY(1);
        closeAnimation.play(LauncherAnimUtils.ofPropertyValuesHolder(
                deepShortcutIcon, new PropertyListBuilder().scale(0).build()));
    }
    return closeAnimation;
}
ZoomInAnimatorDecoration.java 文件源码 项目:LuaViewPlayground 阅读 31 收藏 0 点赞 0 评论 0
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
    animatorSet.playTogether(
            ObjectAnimator.ofFloat(target, "scaleX", 0.45f, 1),
            ObjectAnimator.ofFloat(target, "scaleY", 0.45f, 1),
            ObjectAnimator.ofFloat(target, "alpha", 0, 1)
    );
}
QuranPageReadActivity.java 文件源码 项目:QuranAndroid 阅读 35 收藏 0 点赞 0 评论 0
/**
 * Function to hide tool bar
 */
public void hideToolbar() {

    ObjectAnimator toolbarAnimY = ObjectAnimator.ofFloat(myToolbarContainer, "y", -(myToolbarContainer.getHeight()));
    AnimatorSet toolbarHideAnimation = new AnimatorSet();
    toolbarHideAnimation.setInterpolator(new LinearInterpolator());
    toolbarHideAnimation.play(toolbarAnimY);
    toolbarHideAnimation.start();
}
PasscodeView.java 文件源码 项目:PlusGram 阅读 28 收藏 0 点赞 0 评论 0
private void shakeTextView(final float x, final int num) {
    if (num == 6) {
        return;
    }
    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.playTogether(ObjectAnimator.ofFloat(passcodeTextView, "translationX", AndroidUtilities.dp(x)));
    AnimatorSet.setDuration(50);
    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animation) {
            shakeTextView(num == 5 ? 0 : -x, num + 1);
        }
    });
    AnimatorSet.start();
}
QMUIAnimationListView.java 文件源码 项目:QMUI_Android 阅读 45 收藏 0 点赞 0 评论 0
protected Animator getAddAnimator(View view, int top, int position, int addOccurTop, int addOccurPosition) {
    view.setAlpha(0);
    view.clearAnimation();
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(alphaObjectAnimator(view, true, 50, false));
    if (addOccurTop != top) {
        animatorSet.play(getOffsetAnimator(view, addOccurTop, top));
    }
    animatorSet.setStartDelay((long) (view.getHeight() * mOffsetDurationUnit));
    return animatorSet;
}
QMUIAnimationListView.java 文件源码 项目:qmui 阅读 37 收藏 0 点赞 0 评论 0
private void doPreLayoutAnimation(Animator.AnimatorListener listener) {
    final AnimatorSet animatorSet = new AnimatorSet();
    ArrayList<Long> deleteIds = new ArrayList<>();
    int i;
    for (i = 0; i < mTopMap.size(); i++) {
        long id = mTopMap.keyAt(i);
        int newPos = getPositionForId(id);
        if (newPos < 0) {
            // delete
            int oldPos = mPositionMap.get(id);
            View child = getChildAt(oldPos);
            final Animator anim = getDeleteAnimator(child);
            mPositionMap.remove(id);
            animatorSet.play(anim);
            deleteIds.add(id);
        }
    }

    for (i = 0; i < deleteIds.size(); i++) {
        mTopMap.remove(deleteIds.get(i));
    }

    if (mOpenChangeDisappearAnimation) {
        for (i = 0; i < mPositionMap.size(); i++) {
            View view = getChildAt(mPositionMap.valueAt(i));
            ViewCompat.setHasTransientState(view, true);
            mDetachViewsMap.put(mPositionMap.keyAt(i), view);
        }
    }
    if (!animatorSet.getChildAnimations().isEmpty()) {
        animatorSet.addListener(listener);
        animatorSet.start();
    } else {
        listener.onAnimationEnd(animatorSet);
    }
}
FunGameHeader.java 文件源码 项目:SmartRefreshLayout 阅读 21 收藏 0 点赞 0 评论 0
private void doStart(long delay) {
    ObjectAnimator topMaskAnimator = ObjectAnimator.ofFloat(topMaskView, "translationY", topMaskView.getTranslationY(), -halfHitBlockHeight);
    ObjectAnimator bottomMaskAnimator = ObjectAnimator.ofFloat(bottomMaskView, "translationY", bottomMaskView.getTranslationY(), halfHitBlockHeight);
    ObjectAnimator maskShadowAnimator = ObjectAnimator.ofFloat(maskReLayout, "alpha", maskReLayout.getAlpha(), 0);

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(topMaskAnimator).with(bottomMaskAnimator).with(maskShadowAnimator);
    animatorSet.setDuration(800);
    animatorSet.setStartDelay(delay);
    animatorSet.start();

    animatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            topMaskView.setVisibility(View.GONE);
            bottomMaskView.setVisibility(View.GONE);
            maskReLayout.setVisibility(View.GONE);
            onGameStart();
        }
    });
}
GiftAnimationUtil.java 文件源码 项目:LiveGiftLayout 阅读 28 收藏 0 点赞 0 评论 0
/**
     * @param animator1
     * @param animator2
     * @param animator3
     * @param animator4
     * @param animator5
     * @return 按顺序播放动画
     */
    public static AnimatorSet startAnimation(ObjectAnimator animator1, ObjectAnimator animator2, ObjectAnimator animator3, ObjectAnimator animator4, ObjectAnimator animator5) {
        AnimatorSet animSet = new AnimatorSet();
//        animSet.playSequentially(animators);
        animSet.play(animator1).before(animator2);
        animSet.play(animator3).after(animator2);
        animSet.play(animator4).after(animator3);
        animSet.play(animator5).after(animator4);
        animSet.start();
        return animSet;
    }
QsbBlockerView.java 文件源码 项目:SimpleUILauncher 阅读 27 收藏 0 点赞 0 评论 0
@Override
public void prepareStateChange(State toState, AnimatorSet targetAnim) {
    int finalAlpha = getAlphaForState(toState);
    if (targetAnim == null) {
        mBgPaint.setAlpha(finalAlpha);
        invalidate();
    } else {
        ObjectAnimator anim = ObjectAnimator.ofArgb(mBgPaint, "alpha", finalAlpha);
        anim.addUpdateListener(new AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                invalidate();
            }
        });
        targetAnim.play(anim);
    }
}
SignUpFragment.java 文件源码 项目:LoginConcept 阅读 23 收藏 0 点赞 0 评论 0
@Override
public void fireAnimation() {
    float offsetX=parent.getWidth()-(parent.getWidth()-first.getLeft()+getResources().getDimension(R.dimen.option_size));
    ObjectAnimator firstAnimator=ObjectAnimator.ofFloat(first,View.TRANSLATION_X,0);
    ObjectAnimator secondAnimator=ObjectAnimator.ofFloat(second,View.TRANSLATION_X,0);
    ObjectAnimator lastAnimator=ObjectAnimator.ofFloat(last,View.TRANSLATION_X,0);
    ObjectAnimator buttonAnimator=ObjectAnimator.ofFloat(controller,View.TRANSLATION_X,controller.getTranslationX());

    first.setTranslationX(-offsetX);
    second.setTranslationX(-offsetX);
    last.setTranslationX(-offsetX);
    controller.setTranslationX(-controller.getWidth());

    buttonAnimator.setInterpolator(new BounceOvershootInterpolator(4));
    AnimatorSet buttonSet=new AnimatorSet();
    buttonSet.playTogether(firstAnimator,secondAnimator,lastAnimator);
    buttonSet.setInterpolator(new BounceOvershootInterpolator(2));

    AnimatorSet animatorSet=new AnimatorSet();
    animatorSet.setStartDelay(500);
    animatorSet.playTogether(buttonSet,buttonAnimator);
    animatorSet.start();
}
SimpleTVRecyclerViewAdapter.java 文件源码 项目:TVRecyclerView 阅读 27 收藏 0 点赞 0 评论 0
@Override
protected void focusOut(View v,int pos) {
    ObjectAnimator scaleX = ObjectAnimator.ofFloat(v, "scaleX", 1.05f, 1.0f);
    ObjectAnimator scaleY = ObjectAnimator.ofFloat(v, "scaleY", 1.05f, 1.0f);
    AnimatorSet set = new AnimatorSet();
    set.play(scaleX).with(scaleY);
    set.start();
}
PhotoViewer.java 文件源码 项目:airgram 阅读 34 收藏 0 点赞 0 评论 0
private void toggleCheckImageView(boolean show) {
    AnimatorSet animatorSet = new AnimatorSet();
    ArrayList<Animator> arrayList = new ArrayList<>();
    arrayList.add(ObjectAnimator.ofFloat(pickerView, "alpha", show ? 1.0f : 0.0f));
    if (needCaptionLayout) {
        arrayList.add(ObjectAnimator.ofFloat(captionTextView, "alpha", show ? 1.0f : 0.0f));
    }
    if (sendPhotoType == 0) {
        arrayList.add(ObjectAnimator.ofFloat(checkImageView, "alpha", show ? 1.0f : 0.0f));
    }
    animatorSet.playTogether(arrayList);
    animatorSet.setDuration(200);
    animatorSet.start();
}
PlayerFragment.java 文件源码 项目:Material-Motion 阅读 48 收藏 0 点赞 0 评论 0
private void runRevealNProgress(){
    revealAnimator.setDuration(duration(R.integer.conceal_duration));
    revealAnimator.setInterpolator(new DecelerateInterpolator());
    seekBar.setProgress(80);
    ObjectAnimator progressAnimator=ObjectAnimator.ofInt(seekBar,"progress",80,20);
    ObjectAnimator scaleY=ObjectAnimator.ofFloat(seekBar,View.SCALE_Y,0,1f);
    progressAnimator.setInterpolator(new DecelerateInterpolator());
    progressAnimator.setDuration(duration(R.integer.progress_duration));
    scaleY.setDuration(duration(R.integer.progress_duration));
    AnimatorSet animatorSet=new AnimatorSet();
    animatorSet.play(revealAnimator);
    animatorSet.play(progressAnimator).with(scaleY);
    animatorSet.start();
}
SplashActivity.java 文件源码 项目:QNewsDemo 阅读 48 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SPUtils sp=new SPUtils("theme_id");
    int theme_id = sp.getInt("theme_id", R.style.AppTheme);
    setTheme(theme_id);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        //透明状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明导航栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    }
    setContentView(R.layout.activity_solash);
    ButterKnife.bind(this);
    set = new AnimatorSet();
    ObjectAnimator translationX = ObjectAnimator.ofFloat(ivSplash, "translationX", 600, 0);
    ObjectAnimator translationY = ObjectAnimator
            .ofFloat(ivSplash, "translationY", -100, 90, -80, 70, -60, 50);

    set.playTogether(translationX, translationY);
    set.setDuration(2000);
    addListener();
}
ActionBarPopupWindow.java 文件源码 项目:PlusGram 阅读 31 收藏 0 点赞 0 评论 0
private void startChildAnimation(View child) {
    if (animationEnabled) {
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(
                ObjectAnimator.ofFloat(child, "alpha", 0.0f, 1.0f),
                ObjectAnimator.ofFloat(child, "translationY", AndroidUtilities.dp(showedFromBotton ? 6 : -6), 0));
        animatorSet.setDuration(180);
        animatorSet.setInterpolator(decelerateInterpolator);
        animatorSet.start();
    }
}
FaceDetailActivity.java 文件源码 项目:Swface 阅读 25 收藏 0 点赞 0 评论 0
private void showTitleAndMenu(Point globalOffset) {
    linearLayout_contains.setVisibility(View.GONE);
    toolbar.setTitle(userHasSigned.getUser_name());
    toolbar.setSubtitle("注册时间:" + userHasSigned.getCreated_at());
    toolbar.setAlpha(1.0f);
    Rect finnal_toobar = new Rect();
    Rect finnal_liner_bottom = new Rect();
    toolbar.getGlobalVisibleRect(finnal_toobar);
    linearLayout_bottom.getGlobalVisibleRect(finnal_liner_bottom);
    Log.i(TAG, "showTitleAndMenu: " + finnal_liner_bottom.toString() + finnal_toobar.toString());
    finnal_toobar.offset(-globalOffset.x, -globalOffset.y);
    finnal_liner_bottom.offset(-globalOffset.x, -globalOffset.y);
    Log.i(TAG, "showTitleAndMenu: " + finnal_liner_bottom.toString() + finnal_toobar.toString());
    linearLayout_bottom.setAlpha(1.0f);
    AnimatorSet set1 = new AnimatorSet();
    set1.play(ObjectAnimator.ofFloat(toolbar, View.Y, -finnal_toobar.height(), 0.0f))
            //(1280+finnal_liner_bottom.top)/2
            .with(ObjectAnimator.ofFloat(linearLayout_bottom, View.Y, finnal_liner_bottom.bottom, finnal_liner_bottom.top));
    set1.setDuration(400);
    set1.start();
}
eqlizerMain.java 文件源码 项目:Android-Music-Player 阅读 22 收藏 0 点赞 0 评论 0
public eqlizerMain(Context context, int width, int height) {
    super(context, width, height);
    setBackgroundColor(mainBackground.Color0);
    setPivotY(height*0.7f);
    setPivotX(width*0.5f);
    Ui.ef.clickPlay();
    setAlpha(0);
    Set = new AnimatorSet();
    Set.setInterpolator(Ui.cd.TH);
    Set.setDuration(200);
    Set.playTogether(
            ObjectAnimator.ofFloat(this, "Y",height * 0.5f, 0),
            ObjectAnimator.ofFloat(this, "Alpha", 1.0F)
    );
    Set.start();
    init();
}
PhotoFilterView.java 文件源码 项目:airgram 阅读 88 收藏 0 点赞 0 评论 0
private void checkEnhance() {
    if (enhanceValue == 0) {
        AnimatorSet AnimatorSet = new AnimatorSet();
        AnimatorSet.setDuration(200);
        AnimatorSet.playTogether(ObjectAnimator.ofInt(valueSeekBar, "progress", 50));
        AnimatorSet.start();
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号