use of android.support.v4.view.animation.FastOutSlowInInterpolator in project TeamCityApp by vase4kin.
the class OverviewViewImpl method showPrompt.
/**
* Show prompt
*
* @param secondaryText - secondary text
* @param listener - listener to receive callback when prompt is shown
*/
private void showPrompt(@StringRes int secondaryText, final OnboardingManager.OnPromptShownListener listener) {
// Creating prompt
final Toolbar toolbar = (Toolbar) mActivity.findViewById(R.id.toolbar);
int color = ((ColorDrawable) toolbar.getBackground()).getColor();
final MaterialTapTargetPrompt.Builder promptBuilder = new MaterialTapTargetPrompt.Builder(mActivity).setPrimaryText(R.string.title_onboarding_build_menu).setSecondaryText(secondaryText).setAnimationInterpolator(new FastOutSlowInInterpolator()).setIcon(R.drawable.ic_more_vert_black_24dp).setIconDrawableTintList(ColorStateList.valueOf(color)).setBackgroundColour(color).setCaptureTouchEventOutsidePrompt(true).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
listener.onPromptShown();
}
});
// Show prompt
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
final View child = toolbar.getChildAt(2);
if (child instanceof ActionMenuView) {
final ActionMenuView actionMenuView = ((ActionMenuView) child);
promptBuilder.setTarget(actionMenuView.getChildAt(actionMenuView.getChildCount() - 1));
}
promptBuilder.show();
}
}, TIMEOUT_PROMPT);
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project TeamCityApp by vase4kin.
the class BuildListViewImpl method showFilterBuildsPrompt.
/**
* {@inheritDoc}
*/
@Override
public void showFilterBuildsPrompt(final OnboardingManager.OnPromptShownListener listener) {
int color = getToolbarColor();
new MaterialTapTargetPrompt.Builder(mActivity).setTarget(R.id.filter_builds).setPrimaryText(R.string.title_onboarding_filter_builds).setSecondaryText(R.string.text_onboarding_filter_builds).setAnimationInterpolator(new FastOutSlowInInterpolator()).setIcon(R.drawable.ic_filter_list_white_24px).setIconDrawableTintList(ColorStateList.valueOf(color)).setBackgroundColour(color).setCaptureTouchEventOutsidePrompt(true).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {
@Override
public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
listener.onPromptShown();
}
}).show();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project NewPipe by TeamNewPipe.
the class AnimationUtils method animateSlideAndAlpha.
private static void animateSlideAndAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
if (enterOrExit) {
view.setTranslationY(-view.getHeight());
view.setAlpha(0f);
view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1f).translationY(0).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (execOnEnd != null)
execOnEnd.run();
}
}).start();
} else {
view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(0f).translationY(-view.getHeight()).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
if (execOnEnd != null)
execOnEnd.run();
}
}).start();
}
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project NewPipe by TeamNewPipe.
the class AnimationUtils method animateBackgroundColor.
/**
* Animate the background color of a view
*/
public static void animateBackgroundColor(final View view, long duration, @ColorInt final int colorStart, @ColorInt final int colorEnd) {
if (DEBUG) {
Log.d(TAG, "animateBackgroundColor() called with: view = [" + view + "], duration = [" + duration + "], colorStart = [" + colorStart + "], colorEnd = [" + colorEnd + "]");
}
final int[][] EMPTY = new int[][] { new int[0] };
ValueAnimator viewPropertyAnimator = ValueAnimator.ofObject(new ArgbEvaluator(), colorStart, colorEnd);
viewPropertyAnimator.setInterpolator(new FastOutSlowInInterpolator());
viewPropertyAnimator.setDuration(duration);
viewPropertyAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
ViewCompat.setBackgroundTintList(view, new ColorStateList(EMPTY, new int[] { (int) animation.getAnimatedValue() }));
}
});
viewPropertyAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
ViewCompat.setBackgroundTintList(view, new ColorStateList(EMPTY, new int[] { colorEnd }));
}
@Override
public void onAnimationCancel(Animator animation) {
onAnimationEnd(animation);
}
});
viewPropertyAnimator.start();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project NewPipe by TeamNewPipe.
the class AnimationUtils method animateLightSlideAndAlpha.
private static void animateLightSlideAndAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
if (enterOrExit) {
view.setTranslationY(-view.getHeight() / 2);
view.setAlpha(0f);
view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1f).translationY(0).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (execOnEnd != null)
execOnEnd.run();
}
}).start();
} else {
view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(0f).translationY(-view.getHeight() / 2).setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.GONE);
if (execOnEnd != null)
execOnEnd.run();
}
}).start();
}
}
Aggregations