Search in sources :

Example 1 with RotateAnimation

use of android.view.animation.RotateAnimation 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;
}
Also used : Intent(android.content.Intent) SpannableString(android.text.SpannableString) ImageView(android.widget.ImageView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) LoodView(com.wm.remusic.widget.LoodView) NetItemChangeActivity(com.wm.remusic.activity.NetItemChangeActivity) RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) TextView(android.widget.TextView) ImageView(android.widget.ImageView)

Example 2 with RotateAnimation

use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.

the class MenuCircleShowingAnimation method closeRotation.

private void closeRotation() {
    rotateCloseAnimation = new RotateAnimation(45, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateCloseAnimation.setFillAfter(true);
    rotateCloseAnimation.setFillEnabled(true);
    rotateCloseAnimation.setDuration(ANIMATION_TIME);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Example 3 with RotateAnimation

use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.

the class DropDownListView method initDropDownStyle.

/**
     * init drop down style, only init once
     */
private void initDropDownStyle() {
    if (headerLayout != null) {
        if (isDropDownStyle) {
            addHeaderView(headerLayout);
        } else {
            removeHeaderView(headerLayout);
        }
        return;
    }
    if (!isDropDownStyle) {
        return;
    }
    headerReleaseMinDistance = context.getResources().getDimensionPixelSize(R.dimen.drop_down_list_header_release_min_distance);
    flipAnimation = new RotateAnimation(0, 180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    flipAnimation.setInterpolator(new LinearInterpolator());
    flipAnimation.setDuration(250);
    flipAnimation.setFillAfter(true);
    reverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    reverseFlipAnimation.setInterpolator(new LinearInterpolator());
    reverseFlipAnimation.setDuration(250);
    reverseFlipAnimation.setFillAfter(true);
    headerDefaultText = context.getString(R.string.drop_down_list_header_default_text);
    headerPullText = context.getString(R.string.drop_down_list_header_pull_text);
    headerReleaseText = context.getString(R.string.drop_down_list_header_release_text);
    headerLoadingText = context.getString(R.string.drop_down_list_header_loading_text);
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    headerLayout = (RelativeLayout) inflater.inflate(R.layout.drop_down_list_header, this, false);
    headerText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_default_text);
    headerImage = (ImageView) headerLayout.findViewById(R.id.drop_down_list_header_image);
    headerProgressBar = (ProgressBar) headerLayout.findViewById(R.id.drop_down_list_header_progress_bar);
    headerSecondText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_second_text);
    headerLayout.setClickable(true);
    headerLayout.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            onDropDown();
        }
    });
    headerText.setText(headerDefaultText);
    addHeaderView(headerLayout);
    measureHeaderLayout(headerLayout);
    headerOriginalHeight = headerLayout.getMeasuredHeight();
    headerOriginalTopPadding = headerLayout.getPaddingTop();
    currentHeaderStatus = HEADER_STATUS_CLICK_TO_LOAD;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) LayoutInflater(android.view.LayoutInflater) View(android.view.View)

Example 4 with RotateAnimation

use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.

the class DropDownListView method initDropDownStyle.

/**
     * init drop down style, only init once
     */
private void initDropDownStyle() {
    if (headerLayout != null) {
        if (isDropDownStyle) {
            addHeaderView(headerLayout);
        } else {
            removeHeaderView(headerLayout);
        }
        return;
    }
    if (!isDropDownStyle) {
        return;
    }
    headerReleaseMinDistance = context.getResources().getDimensionPixelSize(R.dimen.drop_down_list_header_release_min_distance);
    flipAnimation = new RotateAnimation(0, 180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    flipAnimation.setInterpolator(new LinearInterpolator());
    flipAnimation.setDuration(250);
    flipAnimation.setFillAfter(true);
    reverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    reverseFlipAnimation.setInterpolator(new LinearInterpolator());
    reverseFlipAnimation.setDuration(250);
    reverseFlipAnimation.setFillAfter(true);
    headerDefaultText = context.getString(R.string.drop_down_list_header_default_text);
    headerPullText = context.getString(R.string.drop_down_list_header_pull_text);
    headerReleaseText = context.getString(R.string.drop_down_list_header_release_text);
    headerLoadingText = context.getString(R.string.drop_down_list_header_loading_text);
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    headerLayout = (RelativeLayout) inflater.inflate(R.layout.drop_down_list_header, this, false);
    headerText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_default_text);
    headerImage = (ImageView) headerLayout.findViewById(R.id.drop_down_list_header_image);
    headerProgressBar = (ProgressBar) headerLayout.findViewById(R.id.drop_down_list_header_progress_bar);
    headerSecondText = (TextView) headerLayout.findViewById(R.id.drop_down_list_header_second_text);
    headerLayout.setClickable(true);
    headerLayout.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            onDropDown();
        }
    });
    headerText.setText(headerDefaultText);
    addHeaderView(headerLayout);
    measureHeaderLayout(headerLayout);
    headerOriginalHeight = headerLayout.getMeasuredHeight();
    headerOriginalTopPadding = headerLayout.getPaddingTop();
    currentHeaderStatus = HEADER_STATUS_CLICK_TO_LOAD;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) LayoutInflater(android.view.LayoutInflater) ImageView(android.widget.ImageView) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView)

Example 5 with RotateAnimation

use of android.view.animation.RotateAnimation in project UltimateAndroid by cymcsg.

the class PullToRefreshView method init.

/**
     * init
     *
     * @param
     * @description
     */
private void init() {
    // Load all of the animations we need in code rather than through XML
    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);
    mInflater = LayoutInflater.from(getContext());
    // header view 在此添加,保证是第一个添加到linearlayout的最上端
    addHeaderView();
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator)

Aggregations

RotateAnimation (android.view.animation.RotateAnimation)111 LinearInterpolator (android.view.animation.LinearInterpolator)38 Animation (android.view.animation.Animation)27 AnimationSet (android.view.animation.AnimationSet)24 ScaleAnimation (android.view.animation.ScaleAnimation)17 ImageView (android.widget.ImageView)15 View (android.view.View)14 TextView (android.widget.TextView)14 AlphaAnimation (android.view.animation.AlphaAnimation)13 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)12 TranslateAnimation (android.view.animation.TranslateAnimation)9 Context (android.content.Context)5 LinearLayout (android.widget.LinearLayout)5 Intent (android.content.Intent)4 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)4 IOException (java.io.IOException)4 Paint (android.graphics.Paint)3 Drawable (android.graphics.drawable.Drawable)3 RecyclerView (android.support.v7.widget.RecyclerView)3 AttributeSet (android.util.AttributeSet)3