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);
}
});
}
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);
}
}
}
});
}
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();
}
}
}
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);
}
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);
}
Aggregations