use of android.view.animation.LinearInterpolator in project remusic by aa112901.
the class RoundFragment method onStart.
@Override
public void onStart() {
super.onStart();
// animatorWeakReference = new WeakReference<ObjectAnimator>(new ObjectAnimator());
// animator = animatorWeakReference.get();
animatorWeakReference = new WeakReference(ObjectAnimator.ofFloat(getView(), "rotation", new float[] { 0.0F, 360.0F }));
animator = animatorWeakReference.get();
//animator = ObjectAnimator.ofFloat(getView(), "rotation", new float[]{0.0F, 360.0F});
animator.setRepeatCount(Integer.MAX_VALUE);
animator.setDuration(25000L);
animator.setInterpolator(new LinearInterpolator());
if (getView() != null)
getView().setTag(R.id.tag_animator, this.animator);
}
use of android.view.animation.LinearInterpolator in project remusic by aa112901.
the class RecommendFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mContent = (ViewGroup) inflater.inflate(R.layout.fragment_recommend_container, container, false);
mLayoutInflater = LayoutInflater.from(mContext);
mRecommendView = mLayoutInflater.inflate(R.layout.recommend, container, false);
String date = Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "";
TextView dailyText = (TextView) mRecommendView.findViewById(R.id.daily_text);
dailyText.setText(date);
mItemLayout = (LinearLayout) mRecommendView.findViewById(R.id.item_change);
mViewContent = (LinearLayout) mRecommendView.findViewById(R.id.recommend_layout);
if (!PreferencesUtility.getInstance(mContext).isCurrentDayFirst(date)) {
PreferencesUtility.getInstance(mContext).setCurrentDate(date);
View dayRec = mLayoutInflater.inflate(R.layout.loading_daymusic, container, false);
ImageView view1 = (ImageView) dayRec.findViewById(R.id.loading_dayimage);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, 1, 0.5F, 1, 0.5F);
rotateAnimation.setDuration(20000L);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setRepeatCount(Animation.INFINITE);
rotateAnimation.setRepeatMode(Animation.INFINITE);
view1.startAnimation(rotateAnimation);
isDayFirst = true;
mContent.addView(dayRec);
}
mLoadView = mLayoutInflater.inflate(R.layout.loading, null, false);
mItemLayout.setVisibility(View.INVISIBLE);
mViewContent.addView(mLoadView);
mRecomendAdapter = new RecommendAdapter(null);
mNewAlbumsAdapter = new NewAlbumsAdapter(null);
mRadioAdapter = new RadioAdapter(null);
TextView change = (TextView) mRecommendView.findViewById(R.id.change_item_position);
change.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent itent = new Intent(mContext, NetItemChangeActivity.class);
mContext.startActivity(itent);
}
});
mLoodView = (LoodView) mRecommendView.findViewById(R.id.loop_view);
if (!isDayFirst) {
mContent.addView(mRecommendView);
}
return mContent;
}
use of android.view.animation.LinearInterpolator in project FastDev4Android by jiangqqlmj.
the class PullToRefreshListView method init.
private void init(Context context) {
mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
mFlipAnimation.setInterpolator(new LinearInterpolator());
mFlipAnimation.setDuration(250);
mFlipAnimation.setFillAfter(true);
mReverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
mReverseFlipAnimation.setDuration(250);
mReverseFlipAnimation.setFillAfter(true);
mRefreshView = (LinearLayout) View.inflate(context, R.layout.pull_to_refresh_header, null);
mRefreshViewText = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_text);
mRefreshViewImage = (ImageView) mRefreshView.findViewById(R.id.pull_to_refresh_image);
mRefreshViewProgress = (ProgressBar) mRefreshView.findViewById(R.id.pull_to_refresh_progress);
mRefreshViewLastUpdated = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_updated_at);
mRefreshState = PULL_TO_REFRESH;
//设置下拉最小的高度为50
mRefreshViewImage.setMinimumHeight(50);
setFadingEdgeLength(0);
setHeaderDividersEnabled(false);
//把refreshview加入到listview的头部
addHeaderView(mRefreshView);
super.setOnScrollListener(this);
mRefreshView.setOnClickListener(this);
mRefreshView.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
mRefreshViewHeight = mRefreshView.getMeasuredHeight();
mRefreshOriginalTopPadding = -mRefreshViewHeight;
resetHeaderPadding();
}
use of android.view.animation.LinearInterpolator in project XRecyclerView by jianghejie.
the class BallScaleIndicator method createAnimation.
@Override
public List<Animator> createAnimation() {
List<Animator> animators = new ArrayList<>();
ValueAnimator scaleAnim = ValueAnimator.ofFloat(0, 1);
scaleAnim.setInterpolator(new LinearInterpolator());
scaleAnim.setDuration(1000);
scaleAnim.setRepeatCount(-1);
scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
scale = (float) animation.getAnimatedValue();
postInvalidate();
}
});
scaleAnim.start();
ValueAnimator alphaAnim = ValueAnimator.ofInt(255, 0);
alphaAnim.setInterpolator(new LinearInterpolator());
alphaAnim.setDuration(1000);
alphaAnim.setRepeatCount(-1);
alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
alpha = (int) animation.getAnimatedValue();
postInvalidate();
}
});
alphaAnim.start();
animators.add(scaleAnim);
animators.add(alphaAnim);
return animators;
}
use of android.view.animation.LinearInterpolator in project XRecyclerView by jianghejie.
the class BallScaleMultipleIndicator method createAnimation.
@Override
public List<Animator> createAnimation() {
List<Animator> animators = new ArrayList<>();
long[] delays = new long[] { 0, 200, 400 };
for (int i = 0; i < 3; i++) {
final int index = i;
ValueAnimator scaleAnim = ValueAnimator.ofFloat(0, 1);
scaleAnim.setInterpolator(new LinearInterpolator());
scaleAnim.setDuration(1000);
scaleAnim.setRepeatCount(-1);
scaleAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
scaleFloats[index] = (float) animation.getAnimatedValue();
postInvalidate();
}
});
scaleAnim.setStartDelay(delays[i]);
scaleAnim.start();
ValueAnimator alphaAnim = ValueAnimator.ofInt(255, 0);
alphaAnim.setInterpolator(new LinearInterpolator());
alphaAnim.setDuration(1000);
alphaAnim.setRepeatCount(-1);
alphaAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
alphaInts[index] = (int) animation.getAnimatedValue();
postInvalidate();
}
});
scaleAnim.setStartDelay(delays[i]);
alphaAnim.start();
animators.add(scaleAnim);
animators.add(alphaAnim);
}
return animators;
}
Aggregations