use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Signal-Android by WhisperSystems.
the class InviteActivity method loadAnimation.
private Animation loadAnimation(@AnimRes int animResId) {
final Animation animation = AnimationUtils.loadAnimation(this, animResId);
animation.setInterpolator(new FastOutSlowInInterpolator());
return animation;
}
use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Signal-Android by WhisperSystems.
the class VerifyDisplayFragment method animateVerified.
private void animateVerified() {
ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1, ScaleAnimation.RELATIVE_TO_SELF, 0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setInterpolator(new FastOutSlowInInterpolator());
scaleAnimation.setDuration(800);
scaleAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
qrVerified.postDelayed(() -> {
ScaleAnimation scaleAnimation1 = new ScaleAnimation(1, 0, 1, 0, ScaleAnimation.RELATIVE_TO_SELF, 0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation1.setInterpolator(new AnticipateInterpolator());
scaleAnimation1.setDuration(500);
ViewUtil.animateOut(qrVerified, scaleAnimation1, View.GONE);
ViewUtil.fadeIn(qrCode, 800);
qrCodeContainer.setEnabled(true);
tapLabel.setText(getString(R.string.verify_display_fragment__tap_to_scan));
}, 2000);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
ViewUtil.fadeOut(qrCode, 200, View.INVISIBLE);
ViewUtil.animateIn(qrVerified, scaleAnimation);
qrCodeContainer.setEnabled(false);
}
use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.
the class CrossfadeSubtitleToolbar method init.
private void init() {
mSubtitleAnimator = ObjectAnimator.ofFloat(null, ALPHA, 1, 0, 1).setDuration(2 * ViewUtils.getShortAnimTime(this));
mSubtitleAnimator.setInterpolator(new FastOutSlowInInterpolator());
AnimatorListener listener = new AnimatorListener();
mSubtitleAnimator.addUpdateListener(listener);
mSubtitleAnimator.addListener(listener);
}
use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.
the class GalleryFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setSupportActionBar(mToolbar);
mSystemUiHelper = new SystemUiHelper(activity, SystemUiHelper.LEVEL_IMMERSIVE, SystemUiHelper.FLAG_IMMERSIVE_STICKY, visible -> {
if (visible) {
mToolbar.animate().alpha(1).translationY(0).setDuration(mToolbarHideDuration).setInterpolator(new FastOutSlowInInterpolator()).start();
} else {
mToolbar.animate().alpha(0).translationY(-mToolbar.getBottom()).setDuration(mToolbarHideDuration).setInterpolator(new FastOutSlowInInterpolator()).start();
}
});
// This will set up window flags.
mSystemUiHelper.show();
mAdapter = new GalleryAdapter(mImageList, new GalleryAdapter.Listener() {
@Override
public void onTap() {
mSystemUiHelper.toggle();
}
@Override
public void onFileDownloaded(int position) {
if (position == mViewPager.getCurrentItem()) {
updateOptionsMenu();
}
}
});
mViewPager.setAdapter(mAdapter);
mViewPager.setCurrentItem(mInitialPosition);
mViewPager.setPageTransformer(true, ViewPagerTransformers.DEPTH);
mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
updateTitle();
updateOptionsMenu();
}
});
updateTitle();
}
use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.
the class ViewUtils method fadeIn.
public static void fadeIn(@NonNull View view, int duration) {
if (view.getVisibility() == View.VISIBLE && view.getAlpha() == 1) {
// Cancel any starting animation.
view.animate().alpha(1).setDuration(0).start();
return;
}
view.setAlpha(isVisible(view) ? view.getAlpha() : 0);
view.setVisibility(View.VISIBLE);
view.animate().alpha(1).setDuration(duration).setInterpolator(new FastOutSlowInInterpolator()).setListener(null).start();
}
Aggregations