use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project react-native-navigation by wix.
the class VisibilityAnimator method createAnimator.
private ObjectAnimator createAnimator(final boolean show) {
ObjectAnimator animator = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, show ? SHOW_END_VALUE : hiddenEndValue);
animator.setDuration(DURATION);
animator.setInterpolator(new LinearOutSlowInInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
visibilityState = show ? VisibilityState.AnimateShow : VisibilityState.AnimateHide;
}
@Override
public void onAnimationEnd(Animator animation) {
visibilityState = show ? VisibilityState.Shown : VisibilityState.Hidden;
}
});
return animator;
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project ahbottomnavigation by aurelhubert.
the class DemoActivity method initUI.
/**
* Init UI
*/
private void initUI() {
bottomNavigation = (AHBottomNavigation) findViewById(R.id.bottom_navigation);
viewPager = (AHBottomNavigationViewPager) findViewById(R.id.view_pager);
floatingActionButton = (FloatingActionButton) findViewById(R.id.floating_action_button);
if (useMenuResource) {
tabColors = getApplicationContext().getResources().getIntArray(R.array.tab_colors);
navigationAdapter = new AHBottomNavigationAdapter(this, R.menu.bottom_navigation_menu_3);
navigationAdapter.setupWithBottomNavigation(bottomNavigation, tabColors);
} else {
AHBottomNavigationItem item1 = new AHBottomNavigationItem(R.string.tab_1, R.drawable.ic_apps_black_24dp, R.color.color_tab_1);
AHBottomNavigationItem item2 = new AHBottomNavigationItem(R.string.tab_2, R.drawable.ic_maps_local_bar, R.color.color_tab_2);
AHBottomNavigationItem item3 = new AHBottomNavigationItem(R.string.tab_3, R.drawable.ic_maps_local_restaurant, R.color.color_tab_3);
bottomNavigationItems.add(item1);
bottomNavigationItems.add(item2);
bottomNavigationItems.add(item3);
bottomNavigation.addItems(bottomNavigationItems);
}
bottomNavigation.manageFloatingActionButtonBehavior(floatingActionButton);
bottomNavigation.setTranslucentNavigationEnabled(true);
bottomNavigation.setOnTabSelectedListener(new AHBottomNavigation.OnTabSelectedListener() {
@Override
public boolean onTabSelected(int position, boolean wasSelected) {
if (currentFragment == null) {
currentFragment = adapter.getCurrentFragment();
}
if (wasSelected) {
currentFragment.refresh();
return true;
}
if (currentFragment != null) {
currentFragment.willBeHidden();
}
viewPager.setCurrentItem(position, false);
currentFragment = adapter.getCurrentFragment();
currentFragment.willBeDisplayed();
if (position == 1) {
bottomNavigation.setNotification("", 1);
floatingActionButton.setVisibility(View.VISIBLE);
floatingActionButton.setAlpha(0f);
floatingActionButton.setScaleX(0f);
floatingActionButton.setScaleY(0f);
floatingActionButton.animate().alpha(1).scaleX(1).scaleY(1).setDuration(300).setInterpolator(new OvershootInterpolator()).setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
floatingActionButton.animate().setInterpolator(new LinearOutSlowInInterpolator()).start();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
}).start();
} else {
if (floatingActionButton.getVisibility() == View.VISIBLE) {
floatingActionButton.animate().alpha(0).scaleX(0).scaleY(0).setDuration(300).setInterpolator(new LinearOutSlowInInterpolator()).setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
floatingActionButton.setVisibility(View.GONE);
}
@Override
public void onAnimationCancel(Animator animation) {
floatingActionButton.setVisibility(View.GONE);
}
@Override
public void onAnimationRepeat(Animator animation) {
}
}).start();
}
}
return true;
}
});
/*
bottomNavigation.setOnNavigationPositionListener(new AHBottomNavigation.OnNavigationPositionListener() {
@Override public void onPositionChange(int y) {
Log.d("DemoActivity", "BottomNavigation Position: " + y);
}
});
*/
viewPager.setOffscreenPageLimit(4);
adapter = new DemoViewPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(adapter);
currentFragment = adapter.getCurrentFragment();
handler.postDelayed(new Runnable() {
@Override
public void run() {
// Setting custom colors for notification
AHNotification notification = new AHNotification.Builder().setText(":)").setBackgroundColor(ContextCompat.getColor(DemoActivity.this, R.color.color_notification_back)).setTextColor(ContextCompat.getColor(DemoActivity.this, R.color.color_notification_text)).build();
bottomNavigation.setNotification(notification, 1);
Snackbar.make(bottomNavigation, "Snackbar with bottom navigation", Snackbar.LENGTH_SHORT).show();
}
}, 3000);
//bottomNavigation.setDefaultBackgroundResource(R.drawable.bottom_navigation_background);
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project ListenerMusicPlayer by hefuyicoder.
the class FastScroller method show.
private void show() {
if (!mAnimatingShow) {
if (mAutoHideAnimator != null) {
mAutoHideAnimator.cancel();
}
mAutoHideAnimator = ObjectAnimator.ofInt(this, "offsetX", 0);
mAutoHideAnimator.setInterpolator(new LinearOutSlowInInterpolator());
mAutoHideAnimator.setDuration(150);
mAutoHideAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationCancel(Animator animation) {
super.onAnimationCancel(animation);
mAnimatingShow = false;
}
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mAnimatingShow = false;
}
});
mAnimatingShow = true;
mAutoHideAnimator.start();
}
if (mAutoHideEnabled) {
postAutoHideDelayed();
} else {
cancelAutoHide();
}
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project UltimateRecyclerView by cymcsg.
the class SliderHeader method initSlider.
private View initSlider(UltimateRecyclerView listview) {
final View view = LayoutInflater.from(getApplication()).inflate(R.layout.list_item_header, null, false);
final ViewTreeObserver vto = listview.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onGlobalLayout() {
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
//Log.d("vto", "globallayout");
final SliderLayout sl = (SliderLayout) view.findViewById(R.id.header_slider);
try {
sl.setOffscreenPageLimit(1);
sl.setSliderTransformDuration(500, new LinearOutSlowInInterpolator());
sl.setPresetTransformer(TransformerL.Default);
sl.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
sl.getPagerIndicator().setDefaultIndicatorColor(R.color.accent, R.color.primaryDark);
sl.getPagerIndicator().setVisibility(View.GONE);
setup_double_faces(sl);
} catch (Exception e) {
e.printStackTrace();
}
}
});
return view;
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project Transitions-Everywhere by andkulikov.
the class ScaleSample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scale, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final TextView text1 = (TextView) transitionsContainer.findViewById(R.id.text1);
transitionsContainer.findViewById(R.id.button1).setOnClickListener(new VisibleToggleClickListener() {
@Override
protected void changeVisibility(boolean visible) {
TransitionManager.beginDelayedTransition(transitionsContainer, new Scale());
text1.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
}
});
final TextView text2 = (TextView) transitionsContainer.findViewById(R.id.text2);
transitionsContainer.findViewById(R.id.button2).setOnClickListener(new VisibleToggleClickListener() {
@Override
protected void changeVisibility(boolean visible) {
TransitionSet set = new TransitionSet().addTransition(new Scale(0.7f)).addTransition(new Fade()).setInterpolator(visible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
TransitionManager.beginDelayedTransition(transitionsContainer, set);
text2.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
}
});
return view;
}
Aggregations