android.view.animation.OvershootInterpolator Java Examples

The following examples show how to use android.view.animation.OvershootInterpolator. 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: HazeType.java    From FakeWeather with Apache License 2.0 6 votes vote down vote up
@Override
public void startAnimation(final DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator1 = ValueAnimator.ofFloat(0, 1);
    animator1.setInterpolator(new OvershootInterpolator());
    animator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            speed = (float) animation.getAnimatedValue() * 32;
            rotate = (float) animation.getAnimatedValue();
        }
    });

    AnimatorSet animSet = new AnimatorSet();
    animSet.play(animator1);
    animSet.setDuration(1000);
    animSet.start();

}
 
Example #2
Source File: WelcomeActivity.java    From Twire with GNU General Public License v3.0 6 votes vote down vote up
private void startHideContinueIconAnimations() {
    Animation mScaleAnimation = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    Animation mRotateAnimation = new RotateAnimation(
            0, 360,
            Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f
    );
    mRotateAnimation.setRepeatCount(0);

    AnimationSet mAnimations = new AnimationSet(true);
    mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
    mAnimations.setFillAfter(true);
    mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
    mAnimations.addAnimation(mScaleAnimation);
    mAnimations.addAnimation(mRotateAnimation);

    mContinueIcon.startAnimation(mAnimations);
}
 
Example #3
Source File: WelcomeActivity.java    From Twire with GNU General Public License v3.0 6 votes vote down vote up
private void startShowContinueIconAnimations() {
    Animation mScaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    Animation mRotateAnimation = new RotateAnimation(
            0, 360,
            Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f
    );
    mRotateAnimation.setRepeatCount(0);

    AnimationSet mAnimations = new AnimationSet(true);
    mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
    mAnimations.setFillAfter(true);
    mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
    mAnimations.addAnimation(mScaleAnimation);
    mAnimations.addAnimation(mRotateAnimation);

    mContinueIcon.startAnimation(mAnimations);
}
 
Example #4
Source File: DotsFragment.java    From android-material-motion with Apache License 2.0 6 votes vote down vote up
private void addScaleAnimation(int startDelay, int duration, AnimatorSet set) {
  final int start = !isFolded ? 1 : 0;
  final int end = ~start & 0x1;
  AnimatorSet buttonSet = new AnimatorSet();
  for (int index = 0; index < dots.size(); index++) {
    FloatingActionButton tempDot = dots.get(index);
    if (tempDot.getId() != lastDot.getId()) {
      ObjectAnimator scaleX = ObjectAnimator.ofFloat(tempDot, View.SCALE_X, start, end);
      ObjectAnimator scaleY = ObjectAnimator.ofFloat(tempDot, View.SCALE_Y, start, end);
      ObjectAnimator fade = ObjectAnimator.ofFloat(tempDot, View.ALPHA, start, end);
      scaleX.setStartDelay(startDelay);
      scaleY.setStartDelay(startDelay);
      scaleX.setInterpolator(new OvershootInterpolator(2));
      scaleY.setInterpolator(new OvershootInterpolator(2));
      fade.setStartDelay(startDelay);
      buttonSet.playTogether(scaleX, scaleY, fade);
    }
  }
  buttonSet.setDuration(duration);
  set.playTogether(buttonSet);
}
 
Example #5
Source File: WelcomeActivity.java    From Pocket-Plays-for-Twitch with GNU General Public License v3.0 6 votes vote down vote up
private AnimationSet startHideContinueIconAnimations() {
	Animation mScaleAnimation = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
	Animation mRotateAnimation = new RotateAnimation(
				0, 360,
				Animation.RELATIVE_TO_SELF, 0.5f,
				Animation.RELATIVE_TO_SELF, 0.5f
	);
	mRotateAnimation.setRepeatCount(0);

	AnimationSet mAnimations = new AnimationSet(true);
	mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
	mAnimations.setFillAfter(true);
	mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
	mAnimations.addAnimation(mScaleAnimation);
	mAnimations.addAnimation(mRotateAnimation);

	mContinueIcon.startAnimation(mAnimations);
	return mAnimations;
}
 
Example #6
Source File: FABsMenu.java    From FABsMenu with Apache License 2.0 6 votes vote down vote up
private void createRotatingDrawable() {
    RotatingDrawable dr = new RotatingDrawable(menuButtonIcon);

    final OvershootInterpolator interpolator = new OvershootInterpolator();

    final ObjectAnimator collapseAnimator = ObjectAnimator
            .ofFloat(dr, "rotation", EXPANDED_PLUS_ROTATION, COLLAPSED_PLUS_ROTATION);
    final ObjectAnimator expandAnimator = ObjectAnimator
            .ofFloat(dr, "rotation", COLLAPSED_PLUS_ROTATION, EXPANDED_PLUS_ROTATION);

    collapseAnimator.setInterpolator(interpolator);
    expandAnimator.setInterpolator(interpolator);

    expandAnimation.play(expandAnimator);
    collapseAnimation.play(collapseAnimator);

    menuButton.setImageDrawable(dr);
    rotatingDrawable = dr;
}
 
Example #7
Source File: TrashView.java    From dingo with GNU General Public License v3.0 6 votes vote down vote up
/**
 * アクションする削除アイコンの設定を更新します。
 *
 * @param width  対象となるViewの幅
 * @param height 対象となるViewの高さ
 * @param shape  対象となるViewの形状
 */
void updateActionTrashIcon(float width, float height, float shape) {
    // アクションする削除アイコンが設定されていない場合は何もしない
    if (!hasActionTrashIcon()) {
        return;
    }
    // 拡大率の設定
    mAnimationHandler.mTargetWidth = width;
    mAnimationHandler.mTargetHeight = height;
    final float newWidthScale = width / mActionTrashIconBaseWidth * shape;
    final float newHeightScale = height / mActionTrashIconBaseHeight * shape;
    mActionTrashIconMaxScale = Math.max(newWidthScale, newHeightScale);
    // ENTERアニメーション作成
    mEnterScaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mActionTrashIconView, PropertyValuesHolder.ofFloat(ImageView.SCALE_X, mActionTrashIconMaxScale), PropertyValuesHolder.ofFloat(ImageView.SCALE_Y, mActionTrashIconMaxScale));
    mEnterScaleAnimator.setInterpolator(new OvershootInterpolator());
    mEnterScaleAnimator.setDuration(TRASH_ICON_SCALE_DURATION_MILLIS);
    // Exitアニメーション作成
    mExitScaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mActionTrashIconView, PropertyValuesHolder.ofFloat(ImageView.SCALE_X, 1.0f), PropertyValuesHolder.ofFloat(ImageView.SCALE_Y, 1.0f));
    mExitScaleAnimator.setInterpolator(new OvershootInterpolator());
    mExitScaleAnimator.setDuration(TRASH_ICON_SCALE_DURATION_MILLIS);
}
 
Example #8
Source File: AlbumsFragment.java    From leafpicrevived with GNU General Public License v3.0 6 votes vote down vote up
@Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View v = inflater.inflate(R.layout.fragment_albums, container, false);
        ButterKnife.bind(this, v);

        int spanCount = columnsCount();
//        spacingDecoration = new GridSpacingItemDecoration(spanCount, Measure.pxToDp(3, getContext()), true);
        spacingDecoration = new GridSpacingItemDecoration(spanCount, Measure.pxToDp(3, mContext), true);
        mAlbumsRecyclerView.setHasFixedSize(true);
        mAlbumsRecyclerView.addItemDecoration(spacingDecoration);
        mAlbumsRecyclerView.setLayoutManager(new GridLayoutManager(getContext(), spanCount));
        if (Prefs.animationsEnabled()) {
            mAlbumsRecyclerView.setItemAnimator(
                    AnimationUtils.getItemAnimator(
                            new LandingAnimator(new OvershootInterpolator(1f))
                    ));
        }

        mAdapter = new AlbumsAdapter(getContext(), this);

        refresh.setOnRefreshListener(this::displayAlbums);
        mAlbumsRecyclerView.setAdapter(mAdapter);
        return v;
    }
 
Example #9
Source File: VoiceRecodingPanel.java    From bcm-android with GNU General Public License v3.0 6 votes vote down vote up
private void display(float x) {
    this.startPositionX = x;
    this.lastPositionX = x;

    recordButtonFab.setVisibility(VISIBLE);
    recordButtonFab.setX(getWidthAdjustment() + getOffset(x));

    AnimationSet animation = new AnimationSet(true);

    ScaleAnimation scaleAnimation = new ScaleAnimation(0.5f, 1f, 0.5f, 1f,
            Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    animation.addAnimation(scaleAnimation);
    animation.setFillBefore(true);
    animation.setFillAfter(true);
    animation.setDuration(ANIMATION_DURATION);
    animation.setInterpolator(new OvershootInterpolator());

    recordButtonFab.startAnimation(animation);
}
 
Example #10
Source File: PlaylistFragment.java    From Melophile with Apache License 2.0 6 votes vote down vote up
@Override
public void showTitle(String title) {
  playlistTitle.setText(title);
  playlistTitle.setScaleX(0);
  playlistTitle.setScaleY(0);
  titleBackground.post(() -> {
    int cx = titleBackground.getWidth() / 2;
    int cy = titleBackground.getHeight() / 2;
    Animator animator = ViewAnimationUtils.createCircularReveal(titleBackground, cx, cy, 0,
            (int) Math.hypot(titleBackground.getWidth(), titleBackground.getHeight()));
    animator.setDuration(400);
    animator.addListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationStart(Animator animation) {
        super.onAnimationStart(animation);
        titleBackground.setVisibility(View.VISIBLE);
        playlistTitle.animate()
                .setDuration(400)
                .scaleX(1).scaleY(1)
                .setInterpolator(new OvershootInterpolator())
                .start();
      }
    });
    animator.start();
  });
}
 
Example #11
Source File: WelcomeActivity.java    From Pocket-Plays-for-Twitch with GNU General Public License v3.0 6 votes vote down vote up
private AnimationSet startShowContinueIconAnimations() {
	Animation mScaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
	Animation mRotateAnimation = new RotateAnimation(
				0, 360,
				Animation.RELATIVE_TO_SELF, 0.5f,
				Animation.RELATIVE_TO_SELF, 0.5f
	);
	mRotateAnimation.setRepeatCount(0);

	AnimationSet mAnimations = new AnimationSet(true);
	mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
	mAnimations.setFillAfter(true);
	mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
	mAnimations.addAnimation(mScaleAnimation);
	mAnimations.addAnimation(mRotateAnimation);

	mContinueIcon.startAnimation(mAnimations);
	return mAnimations;
}
 
Example #12
Source File: PieActivity.java    From PercentageChartView with Apache License 2.0 6 votes vote down vote up
private void setupLayout() {
    Explode transition = new Explode();
    transition.setDuration(600);
    transition.setInterpolator(new OvershootInterpolator(1f));
    getWindow().setEnterTransition(transition);

    FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
            getSupportFragmentManager(), FragmentPagerItems.with(this)
            .add("behavior", BehaviorSubFragment.class,  new Bundler().putBoolean(ORIENTATION_STATE_ARG, true).get())
            .add("progress", ProgressSubFragment.class)
            .add("background", BackgroundSubFragment.class, new Bundler().putBoolean(OFFSET_STATE_ARG, true).get())
            .add("text", TextSubFragment.class)
            .create());

    mViewPager.setAdapter(adapter);
    mViewPager.setOffscreenPageLimit(3);
    mTAbs.setViewPager(mViewPager);

    shadowColor = Color.WHITE;
    blur = distX = distY = 2f;
}
 
Example #13
Source File: FillActivity.java    From PercentageChartView with Apache License 2.0 6 votes vote down vote up
private void setupLayout() {
    Explode transition = new Explode();
    transition.setDuration(600);
    transition.setInterpolator(new OvershootInterpolator(1f));
    getWindow().setEnterTransition(transition);

    FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
            getSupportFragmentManager(), FragmentPagerItems.with(this)
            .add("behavior", BehaviorSubFragment.class, new Bundler().putBoolean(ORIENTATION_STATE_ARG, false).get())
            .add("progress", ProgressSubFragment.class)
            .add("background", BackgroundSubFragment.class, new Bundler().putBoolean(OFFSET_STATE_ARG, true).get())
            .add("text", TextSubFragment.class)
            .create());

    mViewPager.setAdapter(adapter);
    mViewPager.setOffscreenPageLimit(3);
    mTAbs.setViewPager(mViewPager);

    shadowColor = Color.WHITE;
    blur = distX = distY = 2f;
}
 
Example #14
Source File: MicrophoneRecorderView.java    From mollyim-android with GNU General Public License v3.0 6 votes vote down vote up
void display(float x, float y) {
  this.startPositionX = x;
  this.startPositionY = y;

  recordButtonFab.setVisibility(View.VISIBLE);

  AnimationSet animation = new AnimationSet(true);
  animation.addAnimation(new TranslateAnimation(Animation.ABSOLUTE, 0,
                                                Animation.ABSOLUTE, 0,
                                                Animation.ABSOLUTE, 0,
                                                Animation.ABSOLUTE, 0));

  animation.addAnimation(new ScaleAnimation(.5f, 1f, .5f, 1f,
                                            Animation.RELATIVE_TO_SELF, .5f,
                                            Animation.RELATIVE_TO_SELF, .5f));

  animation.setDuration(ANIMATION_DURATION);
  animation.setInterpolator(new OvershootInterpolator());

  recordButtonFab.startAnimation(animation);
}
 
Example #15
Source File: HailType.java    From FakeWeather with Apache License 2.0 6 votes vote down vote up
@Override
public void startAnimation(DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator = ValueAnimator.ofFloat(-bitmap.getWidth() * 0.25f, getWidth() - bitmap.getWidth() * 0.25f);
    animator.setDuration(1000);
    animator.setRepeatCount(0);
    animator.setInterpolator(new OvershootInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            transFactor = (float) animation.getAnimatedValue();
        }
    });

    animator.start();
}
 
Example #16
Source File: HotMovieViewHolder.java    From qvod with MIT License 6 votes vote down vote up
@Override
public void setData(HotMovieBean.SubjectsBean data) {
    super.setData(data);
    ImageLoader.load(data.getImages().getLarge(), ivRanking, 200);
    tvRankingTitle.setText(data.getTitle());
    tvDirectContent.setText(StringFormatUtil.formatName(data.getDirectors()));
    tvActorContent.setText(StringFormatUtil.formatName(data.getCasts(), true));
    tvTypeContent.setText(StringFormatUtil.formatGenres(data.getGenres()));
    tvScoreContent.setText(String.valueOf(data.getRating().getAverage()));
    //动画
    itemView.setScaleX(0.8f);
    itemView.setScaleY(0.8f);
    itemView.animate().scaleX(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();
    itemView.animate().scaleY(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();
    //
    itemView.setOnClickListener(view -> MovieDetailsActivity.startAction((Activity) getContext(), data, ivRanking));
}
 
Example #17
Source File: SnowType.java    From FakeWeather with Apache License 2.0 6 votes vote down vote up
@Override
public void startAnimation(DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator = ValueAnimator.ofFloat(-bitmap.getWidth() * 0.25f, getWidth() - bitmap.getWidth() * 0.25f);
    animator.setDuration(1000);
    animator.setRepeatCount(0);
    animator.setInterpolator(new OvershootInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            transFactor = (float) animation.getAnimatedValue();
        }
    });

    animator.start();
}
 
Example #18
Source File: SandstormType.java    From FakeWeather with Apache License 2.0 6 votes vote down vote up
@Override
public void startAnimation(final DynamicWeatherView dynamicWeatherView, int fromColor) {
    super.startAnimation(dynamicWeatherView, fromColor);
    ValueAnimator animator1 = ValueAnimator.ofFloat(0, 1);
    animator1.setInterpolator(new OvershootInterpolator());
    animator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            speed = (float) animation.getAnimatedValue() * 32;
            rotate = (float) animation.getAnimatedValue();
        }
    });

    AnimatorSet animSet = new AnimatorSet();
    animSet.play(animator1);
    animSet.setDuration(1000);
    animSet.start();

}
 
Example #19
Source File: PlaylistDetailActivity.java    From RetroMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
private void showFab() {
    shuffleButton.animate()
            .setDuration(500)
            .setInterpolator(new OvershootInterpolator())
            .scaleX(1)
            .scaleY(1)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    super.onAnimationEnd(animation);

                }
            })
            .start();
    shuffleButton.setVisibility(View.VISIBLE);
    shuffleButton.setEnabled(true);
}
 
Example #20
Source File: BookResultsHeaderViewHolder.java    From IslamicLibraryAndroid with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onExpansionToggled(boolean expanded) {
    super.onExpansionToggled(expanded);
    ObjectAnimator imageViewObjectAnimator;
    if (expanded) { // rotate clockwise
         imageViewObjectAnimator = ObjectAnimator.ofFloat(mArrowExpandImageView ,
                View.ROTATION, ROTATED_POSITION,INITIAL_POSITION);

    } else { // rotate counterclockwise
         imageViewObjectAnimator = ObjectAnimator.ofFloat(mArrowExpandImageView ,
                View.ROTATION,INITIAL_POSITION, ROTATED_POSITION);
    }

    imageViewObjectAnimator.setDuration(1000);
    imageViewObjectAnimator.setInterpolator(new OvershootInterpolator());
    imageViewObjectAnimator.start();
}
 
Example #21
Source File: FloatingView.java    From text_converter with GNU General Public License v3.0 6 votes vote down vote up
AnimationTask() {
    if (mIsAnimationLocked)
        throw new RuntimeException("Returning to user's finger. Avoid animations while mIsAnimationLocked flag is set.");
    mDestX = calculateX();
    mDestY = calculateY();
    mDynamicUpdate = null;

    setAnimationFinishedListener(new AnimationFinishedListener() {
        @Override
        public void onAnimationFinished() {
            adjustInactivePosition();
        }
    });

    float velocityX = calculateVelocityX();
    float velocityY = calculateVelocityY();
    mTension += Math.sqrt(sqr(velocityX) + sqr(velocityY)) / 200;
    mInterpolator = new OvershootInterpolator(mTension);

    mCurrentPosX = mDestX;
    mCurrentPosY = mDestY;
}
 
Example #22
Source File: AlbumDetailsActivity.java    From RetroMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
private void showFab() {
    playSongs.animate()
            .setDuration(500)
            .setInterpolator(new OvershootInterpolator())
            .scaleX(1)
            .scaleY(1)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    super.onAnimationEnd(animation);

                }
            })
            .start();
    playSongs.setVisibility(View.VISIBLE);
    playSongs.setEnabled(true);
}
 
Example #23
Source File: RingActivity.java    From PercentageChartView with Apache License 2.0 6 votes vote down vote up
private void setupLayout() {
    Explode transition = new Explode();
    transition.setDuration(600);
    transition.setInterpolator(new OvershootInterpolator(1f));
    getWindow().setEnterTransition(transition);

    FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
            getSupportFragmentManager(), FragmentPagerItems.with(this)
            .add("behavior", BehaviorSubFragment.class, new Bundler().putBoolean(ORIENTATION_STATE_ARG, true).get())
            .add("progress bar", ProgressSubFragment.class, new Bundler().putBoolean(BAR_STATE_ARG, true).get())
            .add("background bar", BackgroundBarSubFragment.class)
            .add("background", BackgroundSubFragment.class, new Bundler().putBoolean(ORIENTATION_STATE_ARG, false).get())
            .add("text", TextSubFragment.class)
            .create());

    mViewPager.setAdapter(adapter);
    mViewPager.setOffscreenPageLimit(4);
    mTAbs.setViewPager(mViewPager);

    shadowColor = Color.WHITE;
    blur = distX = distY = 2f;
}
 
Example #24
Source File: NumAnim.java    From RewardLayout with Apache License 2.0 5 votes vote down vote up
public void start(View view) {
    if (lastAnimator != null) {
        lastAnimator.removeAllListeners();
        lastAnimator.end();
        lastAnimator.cancel();
    }
    ObjectAnimator animX = ObjectAnimator.ofFloat(view, "scaleX", 1.6f, 1.0f);
    ObjectAnimator animY = ObjectAnimator.ofFloat(view, "scaleY", 1.6f, 1.0f);
    AnimatorSet animSet = new AnimatorSet();
    lastAnimator = animSet;
    animSet.setDuration(400);
    animSet.setInterpolator(new OvershootInterpolator());
    animSet.playTogether(animX, animY);
    animSet.start();
}
 
Example #25
Source File: ScaleAlphaAnimator.java    From YCDialog with Apache License 2.0 5 votes vote down vote up
@Override
public void animateShow() {
    targetView.animate().scaleX(1f).scaleY(1f).alpha(1f)
            .setDuration(animationDuration)
            .setInterpolator(new OvershootInterpolator(1f))
            .start();
}
 
Example #26
Source File: Animation.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public static List<Interpolator> getInterpolatorList() {
    List<Interpolator> interpolatorList = new ArrayList<>();
    interpolatorList.add(new LinearInterpolator());
    interpolatorList.add(new AccelerateInterpolator());
    interpolatorList.add(new DecelerateInterpolator());
    interpolatorList.add(new AccelerateDecelerateInterpolator());
    interpolatorList.add(new OvershootInterpolator());
    interpolatorList.add(new AnticipateInterpolator());
    interpolatorList.add(new AnticipateOvershootInterpolator());
    interpolatorList.add(new BounceInterpolator());
    interpolatorList.add(new FastOutLinearInInterpolator());
    interpolatorList.add(new FastOutSlowInInterpolator());
    interpolatorList.add(new LinearOutSlowInInterpolator());
    return interpolatorList;
}
 
Example #27
Source File: PlacePickerActivity.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void onCameraMoveStarted(int reason) {
  Timber.v("Map camera has begun moving.");
  if (markerImage.getTranslationY() == 0) {
    markerImage.animate().translationY(-75)
      .setInterpolator(new OvershootInterpolator()).setDuration(250).start();
    if (includeReverseGeocode) {
      if (bottomSheet.isShowing()) {
        bottomSheet.dismissPlaceDetails();
      }
    }
  }
}
 
Example #28
Source File: AbsTagEditorActivity.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
private void showFab() {
    fab.animate()
            .setDuration(500)
            .setInterpolator(new OvershootInterpolator())
            .scaleX(1)
            .scaleY(1)
            .start();
    fab.setEnabled(true);
}
 
Example #29
Source File: PlacePickerActivity.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void onCameraIdle() {
  Timber.v("Map camera is now idling.");
  markerImage.animate().translationY(0)
    .setInterpolator(new OvershootInterpolator()).setDuration(250).start();
  if (includeReverseGeocode) {
    bottomSheet.setPlaceDetails(null);
    // Initialize with the markers current location information.
    makeReverseGeocodingSearch();
  }
}
 
Example #30
Source File: ScaleAnimator.java    From AndroidSkinAnimator with MIT License 5 votes vote down vote up
@Override
public SkinAnimator apply(@NonNull View view, @Nullable final Action action) {
    this.targetView = view;
    preAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
            PropertyValuesHolder.ofFloat("ScaleX",
                    1, 0),
            PropertyValuesHolder.ofFloat("ScaleY",
                    1, 0))
            .setDuration(PRE_DURATION * 3);
    preAnimator.setInterpolator(new LinearInterpolator());
    afterAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
            PropertyValuesHolder.ofFloat("ScaleX",
                    0, 1),
            PropertyValuesHolder.ofFloat("ScaleY",
                    0, 1))
            .setDuration(AFTER_DURATION * 2);
    afterAnimator.setInterpolator(new OvershootInterpolator());

    preAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            if (action != null) {
                action.action();
            }
            afterAnimator.start();
        }
    });

    return this;
}