use of android.view.animation.OvershootInterpolator in project MusicDNA by harjot-oberai.
the class FavouritesFragment method onResume.
@Override
public void onResume() {
super.onResume();
mLayoutManager2.scrollToPositionWithOffset(0, 0);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
playAll.animate().scaleX(1.0f).scaleY(1.0f).setDuration(300).setInterpolator(new OvershootInterpolator());
}
}, 500);
}
use of android.view.animation.OvershootInterpolator in project MagicIndicator by hackware1993.
the class FixedTabExampleActivity method initMagicIndicator4.
private void initMagicIndicator4() {
MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator4);
CommonNavigator commonNavigator = new CommonNavigator(this);
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
@Override
public int getCount() {
return mDataList.size();
}
@Override
public IPagerTitleView getTitleView(Context context, final int index) {
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
simplePagerTitleView.setNormalColor(Color.GRAY);
simplePagerTitleView.setSelectedColor(Color.WHITE);
simplePagerTitleView.setText(mDataList.get(index));
simplePagerTitleView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewPager.setCurrentItem(index);
}
});
return simplePagerTitleView;
}
@Override
public IPagerIndicator getIndicator(Context context) {
LinePagerIndicator linePagerIndicator = new LinePagerIndicator(context);
linePagerIndicator.setMode(LinePagerIndicator.MODE_EXACTLY);
linePagerIndicator.setLineWidth(UIUtil.dip2px(context, 10));
linePagerIndicator.setColors(Color.WHITE);
return linePagerIndicator;
}
});
magicIndicator.setNavigator(commonNavigator);
// must after setNavigator
LinearLayout titleContainer = commonNavigator.getTitleContainer();
titleContainer.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
titleContainer.setDividerDrawable(new ColorDrawable() {
@Override
public int getIntrinsicWidth() {
return UIUtil.dip2px(FixedTabExampleActivity.this, 15);
}
});
final FragmentContainerHelper fragmentContainerHelper = new FragmentContainerHelper(magicIndicator);
fragmentContainerHelper.setInterpolator(new OvershootInterpolator(2.0f));
fragmentContainerHelper.setDuration(300);
mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
fragmentContainerHelper.handlePageSelected(position);
}
});
}
use of android.view.animation.OvershootInterpolator in project MusicDNA by harjot-oberai.
the class ViewAlbumFragment method onResume.
@Override
public void onResume() {
super.onResume();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
fab.animate().scaleX(1.0f).scaleY(1.0f).setDuration(300).setInterpolator(new OvershootInterpolator());
}
}, 500);
}
use of android.view.animation.OvershootInterpolator in project MusicDNA by harjot-oberai.
the class ViewPlaylistFragment method onResume.
@Override
public void onResume() {
super.onResume();
mLayoutManager2.scrollToPositionWithOffset(0, 0);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
playAll.animate().scaleX(1.0f).scaleY(1.0f).setDuration(300).setInterpolator(new OvershootInterpolator());
}
}, 500);
}
use of android.view.animation.OvershootInterpolator in project UltimateRecyclerView by cymcsg.
the class FloatingActionsMenu method createAddButton.
private void createAddButton(Context context) {
mAddButton = new AddFloatingActionButton(context) {
@Override
protected void updateBackground() {
mPlusColor = mAddButtonPlusColor;
mColorNormal = mAddButtonColorNormal;
mColorPressed = mAddButtonColorPressed;
super.updateBackground();
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected Drawable getIconDrawable() {
final RotatingDrawable rotatingDrawable = new RotatingDrawable(super.getIconDrawable());
mRotatingDrawable = rotatingDrawable;
final OvershootInterpolator interpolator = new OvershootInterpolator();
final ObjectAnimator collapseAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", EXPANDED_PLUS_ROTATION, COLLAPSED_PLUS_ROTATION);
final ObjectAnimator expandAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", COLLAPSED_PLUS_ROTATION, EXPANDED_PLUS_ROTATION);
collapseAnimator.setInterpolator(interpolator);
expandAnimator.setInterpolator(interpolator);
mExpandAnimation.play(expandAnimator);
mCollapseAnimation.play(collapseAnimator);
return rotatingDrawable;
}
};
mAddButton.setId(R.id.fab_expand_menu_button);
mAddButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
toggle();
}
});
addView(mAddButton, super.generateDefaultLayoutParams());
}
Aggregations