use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.
the class FriendlyFloatingActionButton method show.
public void show() {
if (mShowing) {
return;
}
mShowing = true;
cancelAnimator();
mAnimator = ObjectAnimator.ofFloat(this, TRANSLATION_Y, getTranslationY(), 0).setDuration(mAnimationDuration);
mAnimator.setInterpolator(new FastOutSlowInInterpolator());
mAnimator.start();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Tapad by berict.
the class MainActivity method closeAbout.
private void closeAbout() {
Log.d("closeAbout", "triggered");
anim.circularRevealInPx(R.id.placeholder, coord[0], coord[1], (int) Math.hypot(coord[0], coord[1]) + 200, 0, new AccelerateDecelerateInterpolator(), circularRevealDuration, fadeAnimDuration, a);
anim.fadeIn(R.id.placeholder, 0, fadeAnimDuration, "aboutOut", a);
setAboutVisible(false);
Handler closeAbout = new Handler();
closeAbout.postDelayed(new Runnable() {
@Override
public void run() {
setPresetInfo();
w.getView(R.id.fragment_about_container, a).setVisibility(View.GONE);
}
}, fadeAnimDuration);
// Firstrun tutorial
if (prefs.getInt(qs, 0) == 8) {
promptPreset = new MaterialTapTargetPrompt.Builder(a).setTarget(a.findViewById(R.id.toolbar_preset)).setPrimaryText(R.string.dialog_tap_target_preset_primary).setSecondaryText(R.string.dialog_tap_target_preset_secondary).setAnimationInterpolator(new FastOutSlowInInterpolator()).setFocalColourFromRes(R.color.blue_500).setAutoDismiss(false).setAutoFinish(false).setCaptureTouchEventOutsidePrompt(true).setOnHidePromptListener(new MaterialTapTargetPrompt.OnHidePromptListener() {
@Override
public void onHidePrompt(MotionEvent event, boolean tappedTarget) {
if (tappedTarget) {
promptPreset.finish();
promptPreset = null;
prefs.edit().putInt(qs, 9).apply();
Log.i("sharedPrefs", "quickstart edited to 9");
}
}
@Override
public void onHidePromptComplete() {
// idk why is this here
//isTutorialVisible = false;
}
}).show();
}
// reset the touch coords
coord[0] = 0;
coord[1] = 0;
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project android-topeka by googlesamples.
the class QuizActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
mCountingIdlingResource = new CountingIdlingResource("Quiz");
String categoryId = getIntent().getStringExtra(Category.TAG);
mInterpolator = new FastOutSlowInInterpolator();
if (null != savedInstanceState) {
mSavedStateIsPlaying = savedInstanceState.getBoolean(STATE_IS_PLAYING);
}
super.onCreate(savedInstanceState);
populate(categoryId);
int categoryNameTextSize = getResources().getDimensionPixelSize(R.dimen.category_item_text_size);
int paddingStart = getResources().getDimensionPixelSize(R.dimen.spacing_double);
final int startDelay = getResources().getInteger(R.integer.toolbar_transition_duration);
ActivityCompat.setEnterSharedElementCallback(this, new TextSharedElementCallback(categoryNameTextSize, paddingStart) {
@Override
public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots) {
super.onSharedElementStart(sharedElementNames, sharedElements, sharedElementSnapshots);
mToolbarBack.setScaleX(0f);
mToolbarBack.setScaleY(0f);
}
@Override
public void onSharedElementEnd(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots) {
super.onSharedElementEnd(sharedElementNames, sharedElements, sharedElementSnapshots);
// Make sure to perform this animation after the transition has ended.
ViewCompat.animate(mToolbarBack).setStartDelay(startDelay).scaleX(1f).scaleY(1f).alpha(1f);
}
});
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project kickmaterial by byoutline.
the class CategoriesListActivity method animateCircleReveal.
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void animateCircleReveal(final int color, Category category) {
// get the center for the clipping circle
int cx = (binding.categoryCircleRevealIv.getLeft() + binding.categoryCircleRevealIv.getRight()) / 2;
int cy = (binding.categoryCircleRevealIv.getTop() + binding.categoryCircleRevealIv.getBottom());
int finalRadius = Math.max(binding.categoryCircleRevealIv.getWidth(), binding.categoryCircleRevealIv.getHeight());
if (LUtils.hasL()) {
if (revealAnimation != null && revealAnimation.isRunning()) {
revealAnimation.end();
}
revealAnimation = ViewAnimationUtils.createCircularReveal(binding.categoryCircleRevealIv, cx, cy, 0.4f * finalRadius, finalRadius);
revealAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
ViewUtils.showView(binding.categoryCircleRevealIv, true);
binding.selectCategoryTv.setBackgroundColor(Color.TRANSPARENT);
LUtils.setStatusBarColor(CategoriesListActivity.this, color);
}
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (binding.categoryCircleIv != null) {
binding.categoryCircleIv.setColorFilter(color);
binding.selectCategoryTv.setBackgroundColor(color);
binding.selectCategoryTv.getBackground().setAlpha(85);
binding.categoryCircleRevealIv.setVisibility(View.INVISIBLE);
}
}
});
revealAnimation.setDuration(REVEAL_ANIM_DURATION);
revealAnimation.setInterpolator(new FastOutSlowInInterpolator());
revealAnimation.start();
} else {
binding.categoryCircleIv.setColorFilter(color);
}
if (category != null) {
finishWithResult(category);
}
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project TextSurface by elevenetc.
the class ShapeReveal method start.
@Override
public void start(@Nullable final IEndListener listener) {
text.setAlpha(255);
animator = revealShape.getAnimator();
animator.setInterpolator(new FastOutSlowInInterpolator());
Utils.addEndListener(this, animator, new IEndListener() {
@Override
public void onAnimationEnd(ISurfaceAnimation animation) {
text.removeEffect(ShapeReveal.this);
if (hideOnEnd)
text.setAlpha(0);
if (listener != null)
listener.onAnimationEnd(ShapeReveal.this);
}
});
animator.setDuration(duration);
animator.start();
}
Aggregations