private void bindHelpButton() {
titleHelpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ScaleAnimation bounce = new ScaleAnimation(1.2f, 1f, 1.2f, 1, helpButtonSizePx / 2, helpButtonSizePx / 2);
bounce.setDuration(600);
bounce.setInterpolator(new BounceInterpolator());
if (helpLayout.getVisibility() == View.GONE) {
showHelpOverlay();
titleHelpButton.setBackgroundResource(R.drawable.sr_close_icon);
titleHelpButton.startAnimation(bounce);
} else {
hideHelpOverlay();
titleHelpButton.setBackgroundResource(R.drawable.sr_info_icon);
titleHelpButton.startAnimation(bounce);
}
}
});
}
java类android.view.animation.BounceInterpolator的实例源码
ShowroomActivity.java 文件源码
项目:showroom-android
阅读 31
收藏 0
点赞 0
评论 0
TranslationAnimator2.java 文件源码
项目:AndroidSkinAnimator
阅读 37
收藏 0
点赞 0
评论 0
@Override
public SkinAnimator apply(@NonNull View view, @Nullable final Action action) {
this.targetView = view;
preAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
PropertyValuesHolder.ofFloat("translationX",
view.getLeft(), view.getRight()))
.setDuration(PRE_DURATION * 3);
preAnimator.setInterpolator(new AccelerateInterpolator());
afterAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
PropertyValuesHolder.ofFloat("translationX",
view.getLeft() - view.getWidth(), view.getLeft()))
.setDuration(AFTER_DURATION * 3);
afterAnimator.setInterpolator(new BounceInterpolator());
preAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (action != null) {
action.action();
}
afterAnimator.start();
}
});
return this;
}
SplashScreenView.java 文件源码
项目:NoticeDog
阅读 30
收藏 0
点赞 0
评论 0
protected void onFinishInflate() {
super.onFinishInflate();
if (!isInEditMode()) {
TranslateAnimation translateAnimation = new TranslateAnimation(1, 2.0f, 1, 0.0f, 0, 0.0f, 0, 0.0f);
translateAnimation.setDuration(1500);
translateAnimation.setStartOffset(2500);
translateAnimation.setInterpolator(new BounceInterpolator());
animate().setStartDelay(5500).alpha(0.0f).setDuration(400).withEndAction(new Runnable() {
public void run() {
((ViewGroup) SplashScreenView.this.getParent()).removeView(SplashScreenView.this);
}
});
}
}
SafeView.java 文件源码
项目:SafeView
阅读 27
收藏 0
点赞 0
评论 0
/**
* 启动动画 回弹效果
*
*/
private void startBackAnimator() {
PropertyValuesHolder xValuesHolder = PropertyValuesHolder.ofFloat("x", canvasRotateX, 0);
PropertyValuesHolder yValuesHolder = PropertyValuesHolder.ofFloat("y", canvasRotateY, 0);
touchAnimator = ValueAnimator.ofPropertyValuesHolder(xValuesHolder, yValuesHolder).setDuration(700);
touchAnimator.setInterpolator(new BounceInterpolator());
touchAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
canvasRotateY = (Float) animation.getAnimatedValue("y");
canvasRotateX = (Float) animation.getAnimatedValue("x");
invalidate();
}
});
touchAnimator.start();
}
ToolTip.java 文件源码
项目:TaBeTa
阅读 29
收藏 0
点赞 0
评论 0
public ToolTip(){
/* default values */
mTitle = "";
mDescription = "";
mBackgroundColor = Color.parseColor("#3498db");
mTextColor = Color.parseColor("#FFFFFF");
mEnterAnimation = new AlphaAnimation(0f, 1f);
mEnterAnimation.setDuration(1000);
mEnterAnimation.setFillAfter(true);
mEnterAnimation.setInterpolator(new BounceInterpolator());
mShadow = true;
// TODO: exit animation
mGravity = Gravity.CENTER;
}
SplashActivty.java 文件源码
项目:ElephantReader
阅读 21
收藏 0
点赞 0
评论 0
@Override
protected void initViewsAndEvents() {
Presenter splashPresenter = new SplashPresenter(this, this);
splashPresenter.initialized();
ViewCompat.animate(fullscreenContent)
.scaleX(1.0f)
.scaleY(1.0f)
.translationY(-100)
.alpha(1f)
.setInterpolator(new BounceInterpolator())
.setStartDelay(DateUtils.SECOND_IN_MILLIS)
.setDuration(DateUtils.SECOND_IN_MILLIS * 2)
.start();
}
WindowActivity.java 文件源码
项目:GSYVideoPlayer
阅读 28
收藏 0
点赞 0
评论 0
@OnClick({R.id.start_window, R.id.jump_other})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.start_window:
if (FloatWindow.get() != null) {
return;
}
FloatPlayerView floatPlayerView = new FloatPlayerView(getApplicationContext());
FloatWindow
.with(getApplicationContext())
.setView(floatPlayerView)
.setWidth(Screen.width, 0.4f)
.setHeight(Screen.width, 0.4f)
.setX(Screen.width, 0.8f)
.setY(Screen.height, 0.3f)
.setMoveType(MoveType.slide)
.setFilter(false)
.setMoveStyle(500, new BounceInterpolator())
.build();
FloatWindow.get().show();
break;
case R.id.jump_other:
startActivity(new Intent(this, EmptyActivity.class));
break;
}
}
SegmentedButtonGroup.java 文件源码
项目:SegmentedButton
阅读 28
收藏 0
点赞 0
评论 0
private void initInterpolations() {
ArrayList<Class> interpolatorList = new ArrayList<Class>() {{
add(FastOutSlowInInterpolator.class);
add(BounceInterpolator.class);
add(LinearInterpolator.class);
add(DecelerateInterpolator.class);
add(CycleInterpolator.class);
add(AnticipateInterpolator.class);
add(AccelerateDecelerateInterpolator.class);
add(AccelerateInterpolator.class);
add(AnticipateOvershootInterpolator.class);
add(FastOutLinearInInterpolator.class);
add(LinearOutSlowInInterpolator.class);
add(OvershootInterpolator.class);
}};
try {
interpolatorSelector = (Interpolator) interpolatorList.get(animateSelector).newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
Toast.java 文件源码
项目:ToastBar
阅读 43
收藏 0
点赞 0
评论 0
public void setPosition(Position position) {
this.position = position;
if (position == Position.BOTTOM) {
if (getLayoutParams() instanceof FrameLayout.LayoutParams) {
((LayoutParams) getLayoutParams()).gravity = Gravity.BOTTOM;
} else if (getLayoutParams() instanceof RelativeLayout.LayoutParams) {
((RelativeLayout.LayoutParams) getLayoutParams()).addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
}
setAnimationInterpolator(new LinearInterpolator(), null);
} else {
if (getLayoutParams() instanceof FrameLayout.LayoutParams) {
((LayoutParams) getLayoutParams()).gravity = Gravity.TOP;
} else if (getLayoutParams() instanceof RelativeLayout.LayoutParams) {
((RelativeLayout.LayoutParams) getLayoutParams()).addRule(RelativeLayout.ALIGN_PARENT_TOP);
}
setAnimationInterpolator(new BounceInterpolator(), null);
}
}
DetailsTaskFragment.java 文件源码
项目:Rubit
阅读 28
收藏 0
点赞 0
评论 0
private void dropPinEffect(Marker marker) {
final Handler handler = new Handler();
final long start = SystemClock.uptimeMillis();
final long duration = 1500;
final Interpolator interpolator = new BounceInterpolator();
handler.post(new Runnable() {
@Override
public void run() {
long elapsed = SystemClock.uptimeMillis() - start;
float t = Math.max(1 - interpolator.getInterpolation((float) elapsed / duration), 0);
marker.setAnchor(0.5f, 1.0f + 14 * t);
if (t > 0.0) {
handler.postDelayed(this, 15);
} else {
marker.showInfoWindow();
}
}
});
}
PullDoorView.java 文件源码
项目:LLApp
阅读 30
收藏 0
点赞 0
评论 0
private void setupView() {
// 这个Interpolator你可以设置别的 我这里选择的是有弹跳效果的Interpolator
Interpolator polator = new BounceInterpolator();
mScroller = new Scroller(mContext, polator);
// 获取屏幕分辨率
WindowManager wm = (WindowManager) (mContext
.getSystemService(Context.WINDOW_SERVICE));
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
mScreenHeigh = dm.heightPixels;
mScreenWidth = dm.widthPixels;
// 这里你一定要设置成透明背景,不然会影响你看到底层布局
this.setBackgroundColor(Color.argb(0, 0, 0, 0));
mImgView = new ImageView(mContext);
mImgView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT));
mImgView.setScaleType(ImageView.ScaleType.FIT_XY);// 填充整个屏幕
// mImgView.setImageResource(R.drawable.ic_launcher); // 默认背景
mImgView.setBackgroundColor(Color.parseColor("#60000000"));
addView(mImgView);
}
SimpleRvActivity.java 文件源码
项目:SwipeMenuRecyclerView-master
阅读 94
收藏 0
点赞 0
评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
mContext = this;
users = getUsers();
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
}
});
mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
mRecyclerView.addItemDecoration(new VerticalSpaceItemDecoration(3));
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
// interpolator setting
mRecyclerView.setOpenInterpolator(new BounceInterpolator());
mRecyclerView.setCloseInterpolator(new BounceInterpolator());
mAdapter = new AppAdapter(this, users);
mRecyclerView.setAdapter(mAdapter);
}
StaggeredGridRvActivity.java 文件源码
项目:SwipeMenuRecyclerView-master
阅读 27
收藏 0
点赞 0
评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
mContext = this;
users = getUsers();
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
}
});
mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
mRecyclerView.addItemDecoration(new StaggeredSpaceItemDecoration(15, 0, 15, 45));
// interpolator setting
mRecyclerView.setOpenInterpolator(new BounceInterpolator());
mRecyclerView.setCloseInterpolator(new BounceInterpolator());
mAdapter = new AppAdapter(this, users);
mRecyclerView.setAdapter(mAdapter);
}
DifferentRvActivity.java 文件源码
项目:SwipeMenuRecyclerView-master
阅读 25
收藏 0
点赞 0
评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
mContext = this;
users = getUsers();
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
}
});
mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
// interpolator setting
mRecyclerView.setOpenInterpolator(new BounceInterpolator());
mRecyclerView.setCloseInterpolator(new BounceInterpolator());
mAdapter = new AppAdapter(this, users);
mRecyclerView.setAdapter(mAdapter);
}
GridRvActivity.java 文件源码
项目:SwipeMenuRecyclerView-master
阅读 31
收藏 0
点赞 0
评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
mContext = this;
users = getUsers();
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
swipeRefreshLayout.setRefreshing(false);
}
});
mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
mRecyclerView.addItemDecoration(new GridSpaceItemDecoration(3, 3));
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
mRecyclerView.setOpenInterpolator(new BounceInterpolator());
mRecyclerView.setCloseInterpolator(new BounceInterpolator());
mAdapter = new AppAdapter(this, users);
mRecyclerView.setAdapter(mAdapter);
}
MaterialWaveView.java 文件源码
项目:SprintNBA
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void onRefreshing(MaterialRefreshLayout br) {
setHeadHeight((int) (Util.dip2px(getContext(), DefaulHeadHeight)));
ValueAnimator animator = ValueAnimator.ofInt(getWaveHeight(),0);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
//Log.i("anim", "value--->" + (int) animation.getAnimatedValue());
setWaveHeight((int) animation.getAnimatedValue());
invalidate();
}
});
animator.setInterpolator(new BounceInterpolator());
animator.setDuration(200);
animator.start();
}
MainActivity.java 文件源码
项目:GankWL
阅读 32
收藏 0
点赞 0
评论 0
public void startAnimation(View[] views) {
isOpen = true;
fabReLayout.setVisibility(View.VISIBLE);
if (VersionHelper.isAtLeast()) {
/**
*ObjectAnimator
* */
for (int i = 0; i < views.length; i++) {
objectAnimator = ObjectAnimator.ofFloat(views[i], "translationY", 0, -(i * 250));
objectAnimator.setStartDelay(i * 150);
objectAnimator.setDuration(700);
objectAnimator.setInterpolator(new BounceInterpolator());
objectAnimator.start();
}
} else {
/**
*ViewCompat
* */
for (int i = 0; i < views.length; i++) {
ViewCompat.animate(views[i]).translationY(i * -ConverTool.px2dip(this, 400)).setDuration(600).setInterpolator(new BounceInterpolator()).start();
}
}
}
MainActivity.java 文件源码
项目:GankWL
阅读 23
收藏 0
点赞 0
评论 0
private void closeAnimation(View[] views) {
isOpen = false;
if (VersionHelper.isAtLeast()) {
/**
*ObjectAnimator
* */
for (int i = 0; i < views.length; i++) {
objectAnimator = ObjectAnimator.ofFloat(views[i], "translationY", i * 250, 0);
objectAnimator.setStartDelay(i * 150);
objectAnimator.setDuration(500);
objectAnimator.setInterpolator(new BounceInterpolator());
objectAnimator.start();
}
} else {
/**
*ViewCompat
* */
for (int i = 0; i < views.length; i++) {
ViewCompat.animate(views[i]).setDuration(500).translationY(0).start();
}
}
fabReLayout.setVisibility(View.GONE);
}
PostAJobAnimatedView.java 文件源码
项目:android-complex-animation
阅读 27
收藏 0
点赞 0
评论 0
private void launchCirclesAnimation() {
circleTwo.setScaleX(0f);
circleTwo.setScaleY(0f);
circleThree.setScaleX(0f);
circleThree.setScaleY(0f);
ObjectAnimator animator = getCircleAnimation(circleOne, CIRCLE_ANIMATION_TIME);
animator.setRepeatMode(ValueAnimator.RESTART);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setInterpolator(new FastOutLinearInInterpolator());
animator.start();
ObjectAnimator animator2 = getCircleAnimation(circleTwo, CIRCLE_ANIMATION_TIME);
animator2.setStartDelay(CIRCLE_ANIMATION_DELAY_ONE);
animator2.setRepeatMode(ValueAnimator.RESTART);
animator2.setRepeatCount(ValueAnimator.INFINITE);
animator.setInterpolator(new BounceInterpolator());
animator2.start();
ObjectAnimator animator3 = getCircleAnimation(circleThree, CIRCLE_ANIMATION_TIME);
animator3.setStartDelay(CIRCLE_ANIMATION_DELAY_TWO);
animator3.setRepeatMode(ValueAnimator.RESTART);
animator3.setRepeatCount(ValueAnimator.INFINITE);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator3.start();
}
PokemonInfoView.java 文件源码
项目:Pokebase
阅读 34
收藏 0
点赞 0
评论 0
private void loadChart(float[] data) {
BarSet dataSet = new BarSet();
float tempVal;
for (int index = 0; index < data.length; index++) {
tempVal = data[index];
dataSet.addBar(STATS[index], tempVal);
stats[index].setText(String.valueOf(Math.round(tempVal)));
}
dataSet.setColor(ContextCompat.getColor(context, R.color.colorPrimary));
barChart.addData(dataSet);
barChart.setXAxis(false);
barChart.setYAxis(false);
barChart.setYLabels(AxisRenderer.LabelPosition.NONE);
Animation animation = new Animation(1000);
animation.setInterpolator(new BounceInterpolator());
barChart.show(animation);
}
MaterialWaveView.java 文件源码
项目:MousePaintYzz
阅读 29
收藏 0
点赞 0
评论 0
@Override
public void onRefreshing(MaterialRefreshLayout br) {
setHeadHeight((int) (Util.dip2px(getContext(), DefaulHeadHeight)));
ValueAnimator animator = ValueAnimator.ofInt(getWaveHeight(),0);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Log.i("anim", "value--->" + (int) animation.getAnimatedValue());
setWaveHeight((int) animation.getAnimatedValue());
invalidate();
}
});
animator.setInterpolator(new BounceInterpolator());
animator.setDuration(200);
animator.start();
}
PropertyAnimActivity.java 文件源码
项目:AndroidStudyDemo
阅读 26
收藏 0
点赞 0
评论 0
public void testObjectAnimator(View v) {
if (v.getId() == R.id.sdi_objectanimator_btn) {
// 简单示例:View的横向移动
ObjectAnimator.ofFloat(mAnimView, "translationX", 0.0f, -200.0f)
.setDuration(C.Int.ANIM_DURATION * 2)
.start();
} else {
// 复合示例:View弹性落下然后弹起,执行一次
ObjectAnimator yBouncer = ObjectAnimator.ofFloat(mAnimView, "y", mAnimView.getY(), 400.0f);
yBouncer.setDuration(C.Int.ANIM_DURATION * 2);
// 设置插值器(用于调节动画执行过程的速度)
yBouncer.setInterpolator(new BounceInterpolator());
// 设置重复次数(缺省为0,表示不重复执行)
yBouncer.setRepeatCount(1);
// 设置重复模式(RESTART或REVERSE),重复次数大于0或INFINITE生效
yBouncer.setRepeatMode(ValueAnimator.REVERSE);
// 设置动画开始的延时时间(200ms)
yBouncer.setStartDelay(200);
yBouncer.start();
}
}
CreateNoteFragment.java 文件源码
项目:StreetComplete
阅读 30
收藏 0
点赞 0
评论 0
private Animation createFallDownAnimation()
{
AnimationSet a = new AnimationSet(false);
a.setStartOffset(200);
TranslateAnimation ta = new TranslateAnimation(0,0,0,0,1,-0.2f,0,0);
ta.setInterpolator(new BounceInterpolator());
ta.setDuration(400);
a.addAnimation(ta);
AlphaAnimation aa = new AlphaAnimation(0,1);
aa.setInterpolator(new AccelerateInterpolator());
aa.setDuration(200);
a.addAnimation(aa);
return a;
}
MainMapFragment.java 文件源码
项目:FastFoodFinder
阅读 27
收藏 0
点赞 0
评论 0
void animateMarker(final Bitmap bitmap, final Marker marker) {
if (marker == null)
return;
ValueAnimator animator = ValueAnimator.ofFloat(0.1f, 1);
animator.setDuration(1000);
animator.setStartDelay(500);
animator.setInterpolator(new BounceInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float scale = (float) animation.getAnimatedValue();
try {
marker.setIcon(BitmapDescriptorFactory.fromBitmap(DisplayUtils.resizeMarkerIcon(bitmap, Math.round(scale * 75), Math.round(scale * 75))));
} catch (IllegalArgumentException ex) {
Log.e("MAPP", ex.getMessage());
}
}
});
animator.start();
}
MaterialWaveView.java 文件源码
项目:BitkyShop
阅读 28
收藏 0
点赞 0
评论 0
@Override
public void onRefreshing(MaterialRefreshLayout br) {
setHeadHeight((int) (Util.dip2px(getContext(), DefaulHeadHeight)));
ValueAnimator animator = ValueAnimator.ofInt(getWaveHeight(),0);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Log.i("anim", "value--->" + (int) animation.getAnimatedValue());
setWaveHeight((int) animation.getAnimatedValue());
invalidate();
}
});
animator.setInterpolator(new BounceInterpolator());
animator.setDuration(200);
animator.start();
}
ContinueGiftView.java 文件源码
项目:MyAndroidTest
阅读 33
收藏 0
点赞 0
评论 0
public void setTimesAnimator() {
AnimationBuilder builder = ViewAnimator.animate(mCountText);
builder.scale(3.0f, 1f).interpolator(new BounceInterpolator());
builder.alpha(0f, 1f).interpolator(new BounceInterpolator())
.duration(900).onStop(new AnimationListener.Stop() {
@Override
public void onStop() {
if (mIsContinue) {
if (mCurrentContinueTimes < mContinueTimes) {
setTimes(mCurrentTimes);
setTimesAnimator();
mCurrentTimes++;
mCurrentContinueTimes++;
} else {
mCurrentContinueTimes = 0;
}
}
}
}).start();
mHandler.removeCallbacks(mRunnable);
mHandler.postDelayed(mRunnable, 3500L);
}
MainActivity.java 文件源码
项目:FragmentNavigationController
阅读 28
收藏 0
点赞 0
评论 0
private void setupNavigationController() {
listTab = FragmentNavigationController.navigationController(this, R.id.tabContainer1);
listTab.setPresentStyle(PresentStyle.ACCORDION_LEFT);
listTab.setInterpolator(new AccelerateDecelerateInterpolator());
listTab.presentFragment(new FragmentFirst());
cardTab = FragmentNavigationController.navigationController(this, R.id.tabContainer2);
cardTab.setPresentStyle(PresentStyle.ACCORDION_LEFT);
cardTab.setInterpolator(new BounceInterpolator());
cardTab.presentFragment(new FragmentSecond());
tileTab = FragmentNavigationController.navigationController(this, R.id.tabContainer3);
tileTab.setPresentStyle(PresentStyle.SLIDE_LEFT);
tileTab.setInterpolator(new OvershootInterpolator());
tileTab.presentFragment(new FragmentThird());
currentNavigationController = listTab;
}
ClockView.java 文件源码
项目:MiClockView
阅读 33
收藏 0
点赞 0
评论 0
private void startNewSteadyAnim() {
final String propertyNameRotateX = "canvasRotateX";
final String propertyNameRotateY = "canvasRotateY";
PropertyValuesHolder holderRotateX = PropertyValuesHolder.ofFloat(propertyNameRotateX, canvasRotateX, 0);
PropertyValuesHolder holderRotateY = PropertyValuesHolder.ofFloat(propertyNameRotateY, canvasRotateY, 0);
steadyAnim = ValueAnimator.ofPropertyValuesHolder(holderRotateX, holderRotateY);
steadyAnim.setDuration(1000);
steadyAnim.setInterpolator(new BounceInterpolator());
steadyAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
canvasRotateX = (float) animation.getAnimatedValue(propertyNameRotateX);
canvasRotateY = (float) animation.getAnimatedValue(propertyNameRotateY);
}
});
steadyAnim.start();
}
HomeFragment.java 文件源码
项目:BookMySkills
阅读 34
收藏 0
点赞 0
评论 0
private void setMarkerBounce(final Marker marker) {
final Handler handler = new Handler();
final long startTime = SystemClock.uptimeMillis();
final long duration = 2000;
final Interpolator interpolator = new BounceInterpolator();
handler.post(new Runnable() {
@Override
public void run() {
long elapsed = SystemClock.uptimeMillis() - startTime;
float t = Math.max(
1 - interpolator.getInterpolation((float) elapsed
/ duration), 0);
marker.setAnchor(0.5f, 1.0f + t);
if (t > 0.0) {
handler.postDelayed(this, 16);
} else {
setMarkerBounce(marker);
}
}
});
}
RainRefreshView.java 文件源码
项目:LoadMoreLayout
阅读 25
收藏 0
点赞 0
评论 0
public void onLoadMore() {
tvTip.setText(getContext().getString(R.string.loading));
mRainView.setVisibility(View.VISIBLE);
mRainView.StartRain();
ValueAnimator animator = ValueAnimator.ofInt(-mWaveView.getmWaveHeight(), 0, mWaveAnimeHeight, 0);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
// Log.d("anim", "value--->" + (int) animation.getAnimatedValue());
mWaveView.setmWaveHeight((int) animation.getAnimatedValue());
mWaveView.invalidate();
}
});
animator.setInterpolator(new BounceInterpolator());
animator.setDuration(1000);
animator.start();
if (mListener != null) {
mListener.onLoadMore();
}
}