java类android.view.animation.RotateAnimation的实例源码

ExpandButtonLayout.java 文件源码 项目:ExpandButton 阅读 39 收藏 0 点赞 0 评论 0
public void open() {

        AnimationSet animationSet = new AnimationSet(true);
        animationSet.setDuration(duration);
        animationSet.setAnimationListener(this);
        animationSet.setFillAfter(true);

        RotateAnimation rotateAnimation = new RotateAnimation(270, 360,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        animationSet.addAnimation(rotateAnimation);
        Animation scaleAnimation = new ScaleAnimation(1.25f, 1f, 1.25f, 1f,
                ScaleAnimation.RELATIVE_TO_SELF, 0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
        animationSet.addAnimation(scaleAnimation);
        imageView.startAnimation(animationSet);


        AnimatorSet animatorSet = new AnimatorSet();
        ObjectAnimator animator1 = ObjectAnimator.ofInt(mLinearLayout, "width", 0, mLinearLayoutWidth);
        ObjectAnimator animator2 = ObjectAnimator.ofInt(mLinearLayout, "paddingLeft", 0, savePaddingLeft);
        ObjectAnimator animator3 = ObjectAnimator.ofInt(mLinearLayout, "paddingRight", 0, savePaddingRight);
        ObjectAnimator animator4 = ObjectAnimator.ofInt(mLinearLayout, "marginLeft", 0, saveMarginLeft);
        ObjectAnimator animator5 = ObjectAnimator.ofInt(mLinearLayout, "marginRight", 0, saveMarginRight);
        animatorSet.playTogether(animator1, animator2, animator3, animator4, animator5);
        animatorSet.setDuration(duration).start();

    }
PullToRefreshListView.java 文件源码 项目:GitHub 阅读 47 收藏 0 点赞 0 评论 0
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;
    mRefreshViewImage.setMinimumHeight(50); //设置下拉最小的高度为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();
}
XListViewHeader.java 文件源码 项目:GitHub 阅读 35 收藏 0 点赞 0 评论 0
private void initView(Context context) {
    // 初始情况,设置下拉刷新view高度为0
    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, 0);
    mContainer = (LinearLayout) LayoutInflater.from(context).inflate(
            R.layout.xlistview_header, null);
    addView(mContainer, lp);
    setGravity(Gravity.BOTTOM);

    mArrowImageView = findViewById(R.id.xlistview_header_arrow);
    mHintTextView = (TextView)findViewById(R.id.xlistview_header_hint_textview);
    mProgressBar = findViewById(R.id.xlistview_header_progressbar);

    mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
}
XFooterView.java 文件源码 项目:GitHub 阅读 32 收藏 0 点赞 0 评论 0
private void initView(Context context) {
        mLayout = LayoutInflater.from(context).inflate(R.layout.vw_footer, null);
        mLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                LayoutParams.WRAP_CONTENT));
        addView(mLayout);

        mProgressBar = mLayout.findViewById(R.id.footer_progressbar);
        mHintView = (TextView) mLayout.findViewById(R.id.footer_hint_text);
//        mHintImage = (ImageView) mLayout.findViewById(R.id.footer_arrow);

        mRotateUpAnim = new RotateAnimation(0.0f, 180.0f, Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
        mRotateUpAnim.setFillAfter(true);

        mRotateDownAnim = new RotateAnimation(180.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
        mRotateDownAnim.setFillAfter(true);
    }
RayLayout.java 文件源码 项目:FLFloatingButton 阅读 39 收藏 0 点赞 0 评论 0
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
        long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);

    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);

    animationSet.addAnimation(rotateAnimation);

    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);

    animationSet.addAnimation(translateAnimation);

    return animationSet;
}
WelcomeFragment.java 文件源码 项目:GitHub 阅读 35 收藏 0 点赞 0 评论 0
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  final SimpleDraweeView draweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
  draweeView.setActualImageResource(R.drawable.logo);
  draweeView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      final RotateAnimation rotateAnimation = new RotateAnimation(
          0,
          360,
          Animation.RELATIVE_TO_SELF,
          0.5f,
          Animation.RELATIVE_TO_SELF,
          0.5f);
      rotateAnimation.setDuration(1000);
      rotateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
      draweeView.startAnimation(rotateAnimation);
    }
  });

  final Button buttonGitHub = (Button) view.findViewById(R.id.button_github);
  setUriIntent(buttonGitHub, URL_GITHUB);

  final Button buttonDocumentation = (Button) view.findViewById(R.id.button_documentation);
  setUriIntent(buttonDocumentation, URL_DOCUMENTATION);
}
RotateLoadingLayout.java 文件源码 项目:ultrasonic 阅读 40 收藏 0 点赞 0 评论 0
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);

    mHeaderImage.setScaleType(ScaleType.MATRIX);
    mHeaderImageMatrix = new Matrix();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);

    mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}
FlipLoadingLayout.java 文件源码 项目:ultrasonic 阅读 34 收藏 0 点赞 0 评论 0
public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;

    mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mRotateAnimation.setFillAfter(true);

    mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mResetRotateAnimation.setFillAfter(true);
}
RotateLoadingLayout.java 文件源码 项目:CustomListView 阅读 31 收藏 0 点赞 0 评论 0
public RotateLoadingLayout(Context context, PullToRefreshBase.Mode mode, PullToRefreshBase.Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);

    mHeaderImage.setScaleType(ScaleType.MATRIX);
    mHeaderImageMatrix = new Matrix();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);

    mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}
FlipLoadingLayout.java 文件源码 项目:CustomListView 阅读 33 收藏 0 点赞 0 评论 0
public FlipLoadingLayout(Context context, final PullToRefreshBase.Mode mode, final PullToRefreshBase.Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    final int rotateAngle = mode == PULL_FROM_START ? -180 : 180;

    mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mRotateAnimation.setFillAfter(true);

    mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mResetRotateAnimation.setFillAfter(true);
}
RefreshListView.java 文件源码 项目:yyox 阅读 33 收藏 0 点赞 0 评论 0
private void init(Context context) {
    inflater = LayoutInflater.from(context);
    headView = (LinearLayout) inflater.inflate(R.layout.kf5_list_head, null);
    arrowImageView = (ImageView) headView.findViewById(R.id.kf5_head_arrowImageView);
    arrowImageView.setMinimumWidth(70);
    arrowImageView.setMinimumHeight(50);
    progressBar = (ProgressBar) headView.findViewById(R.id.kf5_head_progressBar);
    tipsTextview = (TextView) headView.findViewById(R.id.kf5_head_tipsTextView);
    lastUpdatedTextView = (TextView) headView.findViewById(R.id.kf5_head_lastUpdatedTextView);
    measureView(headView);
    headContentHeight = headView.getMeasuredHeight();
    headContentWidth = headView.getMeasuredWidth();
    headView.setPadding(0, -1 * headContentHeight, 0, 0);
    headView.invalidate();
    addHeaderView(headView);
    setOnScrollListener(this);
    animation = new RotateAnimation(0, -180,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    animation.setInterpolator(new LinearInterpolator());
    animation.setDuration(250);
    animation.setFillAfter(true);
    reverseAnimation = new RotateAnimation(-180, 0,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    reverseAnimation.setInterpolator(new LinearInterpolator());
    reverseAnimation.setDuration(200);
    reverseAnimation.setFillAfter(true);

    state = DONE;
    isRefreshable = false;
}
FlipLoadingLayout.java 文件源码 项目:CustomAndroidOneSheeld 阅读 28 收藏 0 点赞 0 评论 0
public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;

    mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mRotateAnimation.setFillAfter(true);

    mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mResetRotateAnimation.setFillAfter(true);
}
AnimationUtil.java 文件源码 项目:CXJPadProject 阅读 33 收藏 0 点赞 0 评论 0
public static void rotate(View v){
    //创建旋转动画 对象   fromDegrees:旋转开始的角度  toDegrees:结束的角度
    RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    //设置动画的显示时间
    rotateAnimation.setDuration(1000);
    //设置动画重复播放几次
    rotateAnimation.setRepeatCount(RotateAnimation.INFINITE);
    //设置动画插值器
    rotateAnimation.setInterpolator(new LinearInterpolator());
    //设置动画重复播放的方式,翻转播放
    rotateAnimation.setRepeatMode(Animation.RESTART);
    //拿着imageview对象来运行动画效果
    v.setAnimation(rotateAnimation);
}
CustomRefreshLayout.java 文件源码 项目:BrotherWeather 阅读 35 收藏 0 点赞 0 评论 0
private void startLoadingAnimation(ImageView imageView) {
  RotateAnimation loadingAnimation =
      new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
          0.5f);
  loadingAnimation.setDuration(1000);
  loadingAnimation.setRepeatCount(-1);
  loadingAnimation.setInterpolator(new LinearInterpolator());
  loadingAnimation.setFillAfter(false);
  imageView.setAnimation(loadingAnimation);
  loadingAnimation.start();
}
CustomRefreshLayout2.java 文件源码 项目:BrotherWeather 阅读 43 收藏 0 点赞 0 评论 0
private void startLoadingAnimation(ImageView imageView) {
  RotateAnimation loadingAnimation =
      new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
          0.5f);
  loadingAnimation.setDuration(1000);
  loadingAnimation.setRepeatCount(-1);
  loadingAnimation.setInterpolator(new LinearInterpolator());
  imageView.setAnimation(loadingAnimation);
  loadingAnimation.start();
}
FlipLoadingLayout.java 文件源码 项目:sctalk 阅读 31 收藏 0 点赞 0 评论 0
public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;

    mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mRotateAnimation.setFillAfter(true);

    mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mResetRotateAnimation.setFillAfter(true);
}
RotateLoadingLayout.java 文件源码 项目:ywApplication 阅读 33 收藏 0 点赞 0 评论 0
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);

    mHeaderImage.setScaleType(ScaleType.MATRIX);
    mHeaderImageMatrix = new Matrix();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);

    mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}
MainActivity.java 文件源码 项目:secretknock 阅读 24 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);

    sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);
    editor = sharedPreferences.edit();

    an = new RotateAnimation(0.0f,
            360.0f,Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF,
            0.5f);

    // Set the animation's parameters
    an.setInterpolator(new LinearInterpolator());
    an.setDuration(7000);               // duration in ms
    an.setRepeatCount(-1);                // -1 = infinite repeated
}
CustomLoadDetailFooter.java 文件源码 项目:SmoothRefreshLayout 阅读 29 收藏 0 点赞 0 评论 0
public CustomLoadDetailFooter(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF,
            0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mFlipAnimation.setInterpolator(new LinearInterpolator());
    mFlipAnimation.setDuration(200);
    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(200);
    mReverseFlipAnimation.setFillAfter(true);
    View header = LayoutInflater.from(getContext()).inflate(R.layout.layout_custom_load_detail_footer, this);
    mRotateView = (ImageView) header.findViewById(R.id.imageView_load_detail_footer_rotation);
    mTitleTextView = (TextView) header.findViewById(R.id.textView_load_detail_footer_title);
}
ReleaseStatusRecyclerViewAdapter.java 文件源码 项目:ITSM 阅读 25 收藏 0 点赞 0 评论 0
private void startLoadingAnimation(ImageView imageView) {

    RotateAnimation loadingAnimation =
        new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    loadingAnimation.setDuration(1000);
    loadingAnimation.setRepeatCount(-1);
    loadingAnimation.setInterpolator(new LinearInterpolator());
    imageView.setAnimation(loadingAnimation);
    loadingAnimation.start();
  }
XListViewHeader.java 文件源码 项目:XERUNG 阅读 34 收藏 0 点赞 0 评论 0
private void initView(Context context) {
    // 初始情况,设置下拉刷新view高度为0
    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
            LayoutParams.FILL_PARENT, 0);
    mContainer = (LinearLayout) LayoutInflater.from(context).inflate(
            R.layout.xlistview_header, null);
    addView(mContainer, lp);
    setGravity(Gravity.BOTTOM);

    mArrowImageView = (ImageView)findViewById(R.id.xlistview_header_arrow);
    mHintTextView = (TextView)findViewById(R.id.xlistview_header_hint_textview);
    mProgressBar = (ProgressBarCircularIndeterminate)findViewById(R.id.xlistview_header_progressbar);

    mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
}
ExpandButtonLayout.java 文件源码 项目:ExpandButton 阅读 36 收藏 0 点赞 0 评论 0
public void close() {

        AnimationSet animationSet = new AnimationSet(true);
        animationSet.setDuration(duration);
        animationSet.setAnimationListener(this);
        animationSet.setFillAfter(true);

        RotateAnimation rotateAnimation = new RotateAnimation(360, 270,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        animationSet.addAnimation(rotateAnimation);
        Animation scaleAnimation = new ScaleAnimation(1f, 1.25f, 1f, 1.25f,
                ScaleAnimation.RELATIVE_TO_SELF, 0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
        animationSet.addAnimation(scaleAnimation);
        imageView.startAnimation(animationSet);
        AnimatorSet animatorSet = new AnimatorSet();
        ObjectAnimator animator1 = ObjectAnimator.ofInt(mLinearLayout, "width", mLinearLayoutWidth, 0);
        ObjectAnimator animator2 = ObjectAnimator.ofInt(mLinearLayout, "paddingLeft", savePaddingLeft, 0);
        ObjectAnimator animator3 = ObjectAnimator.ofInt(mLinearLayout, "paddingRight", savePaddingRight, 0);
        ObjectAnimator animator4 = ObjectAnimator.ofInt(mLinearLayout, "marginLeft", saveMarginLeft, 0);
        ObjectAnimator animator5 = ObjectAnimator.ofInt(mLinearLayout, "marginRight", saveMarginRight, 0);
        animatorSet.playTogether(animator1, animator2, animator3, animator4, animator5);
        animatorSet.setDuration(duration).start();

    }
RefreshViewHeader.java 文件源码 项目:iReading 阅读 33 收藏 0 点赞 0 评论 0
private void initView(Context context) {
    mContent = (ViewGroup) LayoutInflater.from(context).inflate(R.layout.rfv_header, this);
    imgDirectionArrow = (ImageView) findViewById(R.id.imgDirectionArrow);
    tvRefreshState = (TextView) findViewById(R.id.tvRefreshState);
    tvLastRefreshTime = (TextView) findViewById(R.id.tvLastRefreshTime);
    mProgressBar = (ProgressBar) findViewById(R.id.rfv_header_progressbar);

    mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
}
BPProgressDialog.java 文件源码 项目:ITSM 阅读 36 收藏 0 点赞 0 评论 0
@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.progress_dialog);
  getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  ivProgress = (ImageView) findViewById(R.id.ivProgress);
  //tvMessage = (TextView) findViewById(R.id.tvProgressMsg);
  //if (!StringUtil.isEmpty(message)) {
  //  tvMessage.setVisibility(View.VISIBLE);
  //  tvMessage.setText(this.message);
  //} else {
  //  tvMessage.setVisibility(View.GONE);
  //}
  animation =
      new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
          0.5f);
  animation.setInterpolator(new LinearInterpolator());
  animation.setRepeatCount(Animation.INFINITE);
  animation.setDuration(500);
}
FlipLoadingLayout.java 文件源码 项目:Hotspot-master-devp 阅读 33 收藏 0 点赞 0 评论 0
public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;

    mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mRotateAnimation.setFillAfter(true);

    mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
    mResetRotateAnimation.setFillAfter(true);
}
CustomProgressDialog.java 文件源码 项目:AmenWeather 阅读 36 收藏 0 点赞 0 评论 0
public void onWindowFocusChanged(boolean hasFocus) {

        if (customProgressDialog == null) {
            return;
        }
        ImageView mprogressImage = (ImageView) findViewById(R.id.loadingImageView);

        Animation animRoute = new RotateAnimation(0.0f, +360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        animRoute.setDuration(1000);
        animRoute.setRepeatMode(Animation.RESTART);
        animRoute.setRepeatCount(Animation.INFINITE);

        LinearInterpolator lir = new LinearInterpolator();
        animRoute.setInterpolator(lir);
        mprogressImage.startAnimation(animRoute);
    }
CompassFragment.java 文件源码 项目:MuslimMateAndroid 阅读 26 收藏 0 点赞 0 评论 0
private void init(View view) {

        countryName = (TextView) view.findViewById(R.id.textView11);
        if( MainActivity.locationInfo != null)
            countryName.setText(getResources().getConfiguration().locale.getDisplayLanguage()
                    .equals("العربية") ? ConfigPreferences.getLocationConfig(getContext()).name_english :
                    ConfigPreferences.getLocationConfig(getContext()).name);
        Quibladegree = (TextView) view.findViewById(R.id.textView12);
        Quibladegree.setText("Qibla direction from North: "+ ConfigPreferences.getQuibla(getContext()));
        indicator = (ImageView) view.findViewById(R.id.imageView2);
        compass = (RelativeLayout) view.findViewById(R.id.compassContainer);
        mSensorManager = (SensorManager) getContext().getSystemService(getContext().SENSOR_SERVICE);
        RotateAnimation ra = new RotateAnimation(currentDegree, MainActivity.quiblaDegree,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        ra.setDuration(400);
        ra.setFillAfter(true);
        indicator.startAnimation(ra);

    }
XFooterView.java 文件源码 项目:EducationalAdministrationSystem 阅读 39 收藏 0 点赞 0 评论 0
private void initView(Context context) {
        mLayout = LayoutInflater.from(context).inflate(R.layout.vw_footer, null);
        mLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                LayoutParams.WRAP_CONTENT));
        addView(mLayout);

        mProgressBar = mLayout.findViewById(R.id.footer_progressbar);
        mHintView = (TextView) mLayout.findViewById(R.id.footer_hint_text);
//        mHintImage = (ImageView) mLayout.findViewById(R.id.footer_arrow);

        mRotateUpAnim = new RotateAnimation(0.0f, 180.0f, Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
        mRotateUpAnim.setFillAfter(true);

        mRotateDownAnim = new RotateAnimation(180.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
        mRotateDownAnim.setFillAfter(true);
    }
RayLayout.java 文件源码 项目:UiLib 阅读 37 收藏 0 点赞 0 评论 0
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta,
                                               long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);

    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);

    animationSet.addAnimation(rotateAnimation);

    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);

    animationSet.addAnimation(translateAnimation);

    return animationSet;
}
RotateLoadingLayout.java 文件源码 项目:sctalk 阅读 26 收藏 0 点赞 0 评论 0
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);

    mHeaderImage.setScaleType(ScaleType.MATRIX);
    mHeaderImageMatrix = new Matrix();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);

    mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}


问题


面经


文章

微信
公众号

扫码关注公众号