android.support.v4.view.ViewPropertyAnimatorListener Java Examples

The following examples show how to use android.support.v4.view.ViewPropertyAnimatorListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BottomButton.java    From citrus with Apache License 2.0 6 votes vote down vote up
/**
 *
 * @param parent
 * @param bb
 * @param snackbar
 */
private void updateFabTranslationForSnackbar(CoordinatorLayout parent, BottomButton bb, View snackbar) {
    float translationY = this.getFabTranslationYForSnackbar(parent, bb);
    if (translationY != this.mTranslationY) {
        ViewCompat.animate(bb).cancel();
        if (Math.abs(translationY - this.mTranslationY) == (float) snackbar.getHeight()) {
            ViewCompat.animate(bb).translationY(translationY).setInterpolator(new FastOutSlowInInterpolator())
                    .setListener((ViewPropertyAnimatorListener) null);
        } else {
            ViewCompat.setTranslationY(bb, translationY);
        }

        this.mTranslationY = translationY;
    }

}
 
Example #2
Source File: AnimatorUtil.java    From JReadHub with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 隐藏view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void scaleHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    ViewCompat.animate(view)
            .scaleX(0.0f)
            .scaleY(0.0f)
            .alpha(0.0f)
            .setDuration(800)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #3
Source File: AnimatorUtil.java    From CoordinatorLayoutExample with Apache License 2.0 5 votes vote down vote up
public static void scaleHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    ViewCompat.animate(view)
            .scaleX(0.0f)
            .scaleY(0.0f)
            .alpha(0.0f)
            .setDuration(800)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #4
Source File: AnimatorUtil.java    From CoordinatorLayoutExample with Apache License 2.0 5 votes vote down vote up
public static void scaleShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .scaleX(1.0f)
            .scaleY(1.0f)
            .alpha(1.0f)
            .setDuration(800)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #5
Source File: AnimHelper.java    From okhttp-OkGo with Apache License 2.0 5 votes vote down vote up
public static void translateDown(View view, ViewPropertyAnimatorListener listener) {
    int height = view.getHeight();
    ViewGroup.LayoutParams params = view.getLayoutParams();
    ViewGroup.MarginLayoutParams layoutParams = params instanceof ViewGroup.MarginLayoutParams ? ((ViewGroup.MarginLayoutParams) params) : null;
    if (layoutParams != null) height += layoutParams.bottomMargin;
    ViewCompat.animate(view).translationY(height).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start();
}
 
Example #6
Source File: AnimatorUtil.java    From diycode with Apache License 2.0 5 votes vote down vote up
public static void translateHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(260)
            .setDuration(400)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #7
Source File: AnimatorUtil.java    From diycode with Apache License 2.0 5 votes vote down vote up
public static void translateShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(0)
            .setDuration(400)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #8
Source File: AnimatorUtil.java    From diycode with Apache License 2.0 5 votes vote down vote up
public static void scaleHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    ViewCompat.animate(view)
            .scaleX(0.0f)
            .scaleY(0.0f)
            .alpha(0.0f)
            .setDuration(800)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #9
Source File: AnimatorUtil.java    From diycode with Apache License 2.0 5 votes vote down vote up
public static void scaleShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .scaleX(1.0f)
            .scaleY(1.0f)
            .alpha(1.0f)
            .setDuration(800)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #10
Source File: AnimatorUtil.java    From MaoWanAndoidClient with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void translateHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(350)
            .setDuration(400)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #11
Source File: AnimatorUtil.java    From MaoWanAndoidClient with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void scaleHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    ViewCompat.animate(view)
            .scaleX(0.0f)
            .scaleY(0.0f)
            .alpha(0.0f)
            .setDuration(800)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #12
Source File: AnimatorUtil.java    From MaoWanAndoidClient with Apache License 2.0 5 votes vote down vote up
/**
 * 显示view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void translateShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(0)
            .setDuration(400)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #13
Source File: AnimatorUtil.java    From JReadHub with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 显示view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void scaleShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .scaleX(1.0f)
            .scaleY(1.0f)
            .alpha(1.0f)
            .setDuration(800)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #14
Source File: AnimatorUtil.java    From MaoWanAndoidClient with Apache License 2.0 5 votes vote down vote up
/**
 * 显示view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void scaleShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .scaleX(1.0f)
            .scaleY(1.0f)
            .alpha(1.0f)
            .setDuration(800)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #15
Source File: AnimatorUtil.java    From Awesome-WanAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void translateHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(350)
            .setDuration(400)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #16
Source File: AnimatorUtil.java    From Awesome-WanAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * 显示view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void translateShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(0)
            .setDuration(400)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #17
Source File: AnimatorUtil.java    From Awesome-WanAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void scaleHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    ViewCompat.animate(view)
            .scaleX(0.0f)
            .scaleY(0.0f)
            .alpha(0.0f)
            .setDuration(800)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #18
Source File: AnimatorUtil.java    From JReadHub with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 显示view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void translateShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(0)
            .setDuration(400)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #19
Source File: AnimatorUtil.java    From JReadHub with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 隐藏view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void translateHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .translationY(350)
            .setDuration(400)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .setListener(viewPropertyAnimatorListener)
            .start();
}
 
Example #20
Source File: AnimatorUtil.java    From Awesome-WanAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * 显示view
 *
 * @param view View
 * @param viewPropertyAnimatorListener ViewPropertyAnimatorListener
 */
public static void scaleShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view)
            .scaleX(1.0f)
            .scaleY(1.0f)
            .alpha(1.0f)
            .setDuration(800)
            .setListener(viewPropertyAnimatorListener)
            .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
            .start();
}
 
Example #21
Source File: AnimateViewHolder.java    From SimpleNews with Apache License 2.0 4 votes vote down vote up
void animateRemoveImpl(final RecyclerView.ViewHolder holder,
ViewPropertyAnimatorListener listener);
 
Example #22
Source File: AnimHelper.java    From okhttp-OkGo with Apache License 2.0 4 votes vote down vote up
public static void translateUp(View view, ViewPropertyAnimatorListener listener) {
    ViewCompat.animate(view).translationY(0).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start();
}
 
Example #23
Source File: AnimHelper.java    From okhttp-OkGo with Apache License 2.0 4 votes vote down vote up
public static void alphaHide(View view, ViewPropertyAnimatorListener listener) {
    ViewCompat.animate(view).alpha(0f).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start();
}
 
Example #24
Source File: AnimHelper.java    From okhttp-OkGo with Apache License 2.0 4 votes vote down vote up
public static void alphaShow(View view, ViewPropertyAnimatorListener listener) {
    ViewCompat.animate(view).alpha(1.0f).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start();
}
 
Example #25
Source File: AnimHelper.java    From okhttp-OkGo with Apache License 2.0 4 votes vote down vote up
public static void scaleHide(View view, ViewPropertyAnimatorListener listener) {
    ViewCompat.animate(view).scaleX(0f).scaleY(0f).alpha(0f).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start();
}
 
Example #26
Source File: AnimHelper.java    From okhttp-OkGo with Apache License 2.0 4 votes vote down vote up
public static void scaleShow(View view, ViewPropertyAnimatorListener listener) {
    ViewCompat.animate(view).scaleX(1.0f).scaleY(1.0f).alpha(1.0f).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start();
}
 
Example #27
Source File: VideoListAdapter.java    From VideoDemoJava with MIT License 4 votes vote down vote up
@Override
public void animateRemoveImpl(RecyclerView.ViewHolder holder, ViewPropertyAnimatorListener listener) {
    ViewCompat.animate(itemView)
            .alpha(0).setDuration(MainActivity.DURATION).start();
}
 
Example #28
Source File: VideoListAdapter.java    From VideoDemoJava with MIT License 4 votes vote down vote up
@Override
public void animateAddImpl(RecyclerView.ViewHolder holder, ViewPropertyAnimatorListener listener) {
    ViewCompat.animate(itemView)
            .alpha(1).setDuration(MainActivity.DURATION).start();
}
 
Example #29
Source File: AnimateViewHolder.java    From Nimingban with Apache License 2.0 votes vote down vote up
public abstract void animateAddImpl(ViewPropertyAnimatorListener listener); 
Example #30
Source File: AnimateViewHolder.java    From Nimingban with Apache License 2.0 votes vote down vote up
public abstract void animateRemoveImpl(ViewPropertyAnimatorListener listener);