use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Carbon by ZieIony.
the class SearchToolbarActivity method closeSearch.
private void closeSearch() {
int[] setLocation = new int[2];
searchBar.getLocationOnScreen(setLocation);
int[] sbLocation = new int[2];
closeButton.getLocationOnScreen(sbLocation);
Animator animator = searchBar.createCircularReveal(sbLocation[0] - setLocation[0] + closeButton.getWidth() / 2, searchBar.getHeight() / 2, searchBar.getWidth(), 0);
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
searchBar.setVisibility(View.INVISIBLE);
}
});
animator.start();
searchEditText.clearFocus();
}
use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Carbon by ZieIony.
the class SearchToolbarActivity method openSearch.
private void openSearch(View view) {
searchBar.setVisibility(View.VISIBLE);
int[] setLocation = new int[2];
searchBar.getLocationOnScreen(setLocation);
int[] sbLocation = new int[2];
view.getLocationOnScreen(sbLocation);
Animator animator = searchBar.createCircularReveal(sbLocation[0] - setLocation[0] + view.getWidth() / 2, searchBar.getHeight() / 2, 0, searchBar.getWidth());
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.start();
searchEditText.requestFocus();
}
use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Transitions-Everywhere by andkulikov.
the class InterpolatorDurationStartDelaySample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_interpolator, container, false);
final ViewGroup transitionsContainer = view.findViewById(R.id.transitions_container);
final View button = transitionsContainer.findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
boolean mToRightAnimation;
@Override
public void onClick(View v) {
mToRightAnimation = !mToRightAnimation;
Transition transition = new ChangeBounds();
transition.setDuration(mToRightAnimation ? 700 : 300);
transition.setInterpolator(mToRightAnimation ? new FastOutSlowInInterpolator() : new AccelerateInterpolator());
transition.setStartDelay(mToRightAnimation ? 0 : 500);
TransitionManager.beginDelayedTransition(transitionsContainer, transition);
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) button.getLayoutParams();
params.gravity = mToRightAnimation ? (Gravity.RIGHT | Gravity.TOP) : (Gravity.LEFT | Gravity.TOP);
button.setLayoutParams(params);
}
});
return view;
}
use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Signal-Android by signalapp.
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 Slide by ccrama.
the class CommentAdapterHelper method showChildrenObject.
public static void showChildrenObject(final View v) {
v.setVisibility(View.VISIBLE);
ValueAnimator animator = ValueAnimator.ofFloat(0, 1f);
animator.setDuration(250);
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (Float) animation.getAnimatedValue();
v.setAlpha(value);
v.setScaleX(value);
v.setScaleY(value);
}
});
animator.start();
}
Aggregations