Search in sources :

Example 66 with RotateAnimation

use of android.view.animation.RotateAnimation in project vlc-android by videolan.

the class UiTools method fillAboutView.

public static void fillAboutView(View v) {
    final TextView link = v.findViewById(R.id.main_link);
    link.setText(Html.fromHtml(VLCApplication.getAppResources().getString(R.string.about_link)));
    final String revision = VLCApplication.getAppResources().getString(R.string.build_revision) + " VLC: " + VLCApplication.getAppResources().getString(R.string.build_vlc_revision);
    final String builddate = VLCApplication.getAppResources().getString(R.string.build_time);
    final String builder = VLCApplication.getAppResources().getString(R.string.build_host);
    final TextView compiled = v.findViewById(R.id.main_compiled);
    compiled.setText(builder + " (" + builddate + ")");
    final TextView textview_rev = v.findViewById(R.id.main_revision);
    textview_rev.setText(VLCApplication.getAppResources().getString(R.string.revision) + " " + revision + " (" + builddate + ") " + BuildConfig.FLAVOR_abi);
    final ImageView logo = v.findViewById(R.id.logo);
    logo.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AnimationSet anim = new AnimationSet(true);
            RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
            rotate.setDuration(800);
            rotate.setInterpolator(new DecelerateInterpolator());
            anim.addAnimation(rotate);
            logo.startAnimation(anim);
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) RotateAnimation(android.view.animation.RotateAnimation) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) AnimationSet(android.view.animation.AnimationSet)

Example 67 with RotateAnimation

use of android.view.animation.RotateAnimation in project Zom-Android by zom.

the class ConversationView method showSubscriptionUI.

private void showSubscriptionUI() {
    if (isGroupChat())
        return;
    mHandler.post(new Runnable() {

        public void run() {
            if (mSubscriptionStatus == Imps.Contacts.SUBSCRIPTION_STATUS_SUBSCRIBE_PENDING) {
                if (mSubscriptionType == Imps.Contacts.SUBSCRIPTION_TYPE_FROM) {
                    Snackbar sb = Snackbar.make(mHistory, mContext.getString(R.string.subscription_prompt, mRemoteNickname), Snackbar.LENGTH_INDEFINITE);
                    sb.setAction(mActivity.getString(R.string.approve_subscription), new View.OnClickListener() {

                        @Override
                        public void onClick(View view) {
                            approveSubscription();
                        }
                    });
                    sb.show();
                } else if (mSubscriptionType == Imps.Contacts.SUBSCRIPTION_TYPE_TO) {
                    mActivity.findViewById(R.id.waiting_view).setVisibility(View.VISIBLE);
                    final View buttonRefresh = mActivity.findViewById(R.id.waiting_refresh_background);
                    final ImageView iconRefresh = (ImageView) mActivity.findViewById(R.id.waiting_refresh);
                    buttonRefresh.setOnClickListener(new View.OnClickListener() {

                        @Override
                        public void onClick(View v) {
                            Animation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                            rotate.setRepeatCount(4);
                            rotate.setInterpolator(new LinearInterpolator());
                            rotate.setDuration(800);
                            rotate.setAnimationListener(new Animation.AnimationListener() {

                                @Override
                                public void onAnimationStart(Animation animation) {
                                }

                                @Override
                                public void onAnimationEnd(Animation animation) {
                                    iconRefresh.clearAnimation();
                                    Drawable check = ContextCompat.getDrawable(iconRefresh.getContext(), R.drawable.ic_check_white_24dp).mutate();
                                    DrawableCompat.setTint(check, ContextCompat.getColor(iconRefresh.getContext(), R.color.zom_primary));
                                    iconRefresh.setImageDrawable(check);
                                    Drawable back = buttonRefresh.getBackground().mutate();
                                    DrawableCompat.setTint(back, Color.WHITE);
                                    ViewCompat.setBackground(buttonRefresh, back);
                                    buttonRefresh.setEnabled(false);
                                    mActivity.findViewById(R.id.waiting_view).setVisibility(View.GONE);
                                }

                                @Override
                                public void onAnimationRepeat(Animation animation) {
                                }
                            });
                            resendFriendRequest();
                            iconRefresh.startAnimation(rotate);
                        }
                    });
                } else {
                    mActivity.findViewById(R.id.waiting_view).setVisibility(View.GONE);
                }
            }
        }
    });
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) Drawable(android.graphics.drawable.Drawable) RoundedAvatarDrawable(org.awesomeapp.messenger.ui.widgets.RoundedAvatarDrawable) Animation(android.view.animation.Animation) RotateAnimation(android.view.animation.RotateAnimation) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) AbsListView(android.widget.AbsListView) Snackbar(android.support.design.widget.Snackbar)

Example 68 with RotateAnimation

use of android.view.animation.RotateAnimation in project GzuClassSchedule by mnnyang.

the class ImptActivity method captchaIsLoading.

@Override
public void captchaIsLoading(boolean isLoading) {
    if (getCaptchaIV() == null) {
        return;
    }
    if (isLoading) {
        getCaptchaIV().setImageResource(R.drawable.ic_svg_refresh);
        RotateAnimation rotateAnimation = new RotateAnimation(0, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        rotateAnimation.setDuration(1000);
        rotateAnimation.setInterpolator(new LinearInterpolator());
        rotateAnimation.setRepeatCount(-1);
        getCaptchaIV().startAnimation(rotateAnimation);
    } else {
        Animation animation = getCaptchaIV().getAnimation();
        if (animation != null) {
            animation.cancel();
        }
    }
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) RotateAnimation(android.view.animation.RotateAnimation) Animation(android.view.animation.Animation)

Example 69 with RotateAnimation

use of android.view.animation.RotateAnimation in project KL2 by jweihao.

the class AnimTools method openView.

/*打开菜单*/
public static void openView(RelativeLayout view, long offset) {
    RotateAnimation rotateAnimation = new RotateAnimation(-180f, 0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 1f);
    rotateAnimation.setDuration(200);
    rotateAnimation.setFillAfter(true);
    rotateAnimation.setStartOffset(offset);
    view.startAnimation(rotateAnimation);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Example 70 with RotateAnimation

use of android.view.animation.RotateAnimation in project KL2 by jweihao.

the class AnimTools method hideView.

// 隐藏菜单
/**
 * @param view 要执行动画的视图对象
 */
public static void hideView(RelativeLayout view, long offset) {
    // 旋转动画
    RotateAnimation rotateAnimation = new RotateAnimation(// 开始角度
    0f, // 结束角度
    -180f, // 相对于自我,也就是屏幕
    Animation.RELATIVE_TO_SELF, // 旋转中心点,0.5f是指X轴的一半。
    0.5f, Animation.RELATIVE_TO_SELF, // 旋转中心点,1f是指Y轴的整个高度。
    1.0f);
    rotateAnimation.setFillAfter(true);
    // 动画持续时间
    rotateAnimation.setDuration(200);
    rotateAnimation.setStartOffset(offset);
    // 执行动画
    view.startAnimation(rotateAnimation);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Aggregations

RotateAnimation (android.view.animation.RotateAnimation)117 LinearInterpolator (android.view.animation.LinearInterpolator)39 Animation (android.view.animation.Animation)30 AnimationSet (android.view.animation.AnimationSet)24 ImageView (android.widget.ImageView)18 ScaleAnimation (android.view.animation.ScaleAnimation)17 View (android.view.View)16 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)16 TextView (android.widget.TextView)16 AlphaAnimation (android.view.animation.AlphaAnimation)13 TranslateAnimation (android.view.animation.TranslateAnimation)9 Context (android.content.Context)5 LinearLayout (android.widget.LinearLayout)5 SuppressLint (android.annotation.SuppressLint)4 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