android-animation

Continuously animate Text from left to right

三世轮回 提交于 2020-04-08 07:26:26
问题 I'm trying to create an animation which moves a TextView from left to right and loop indefinitely. This is the TextView I want to animate: <TextView android:id="@+id/txtTitle" android:layout_width="280dp" android:layout_height="wrap_content" android:textSize="16sp" android:textStyle="italic" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:layout_marginTop="20dp" android:ellipsize="end" android:maxLines="1" android:layout_centerHorizontal="true" android:layout_below=

GridView animated HORIZONTAL sliding

落花浮王杯 提交于 2020-03-25 17:54:08
问题 For one reason or another, I had to create a custom calendar component with custom views for days - different views for different types of dates - normal, events, etc - loading year configuration from JSON, etc. I've created it by extending the GridView with an adapter. I've created JSON-configuration loading etc. I've used grid touch events to make changing of current month easy. But I need to do this "sliding" left and right animated - as it is in the android calendar application. for

Android: start the app with animation

烈酒焚心 提交于 2020-02-14 20:44:10
问题 I have an app that is launched by clicking a link in a webpage. No problem, that works fine. However, the app main screen just sort of bumps away the browser. I'd like to add a little animation. Maybe it can fade-in or something. I have done tween animations on ImageView but not sure how to do it for the full layout screen. Any ideas? 回答1: i think you can simply use the AlphaAnimation , and apply it to the layout of your Activity like this , in the onCreate method : super.onCreate

Fade animation blinks - Android

我与影子孤独终老i 提交于 2020-01-24 12:50:06
问题 I'm trying to set up 2 layouts - I want one layout to slide up, and when it's finished another layout should fade in. I've managed to get it working, but at the end of the two animation and first layout blinks once. How can I solve it? Here's the code(first layout is named titleLay and the second one is called registerLayout)- final TranslateAnimation slide = new TranslateAnimation(0, 0, 0,-100 ); slide.setDuration(500); slide.setFillAfter(true); slide.setAnimationListener(new

AnimatedVectorDrawableCompat looping animation using callback

隐身守侯 提交于 2020-01-24 08:54:27
问题 I'm trying to implement an animation in my Android app using AnimatedVectorDrawableCompat, for compatibility for API >= 21. I want the animation to loop for the duration of the Activity. I'm able to play the animation, and it will also loop fine on API >= 25. But when I run it on devices or emulators with API 21 through 24 I only see the animation once. If I set a breakpoint inside the callback method, I see that it executes the callback too, but the animation does not repeat. I find that the

Edittext change width with animation

℡╲_俬逩灬. 提交于 2020-01-22 15:44:28
问题 I want to make an edittext which aligns in its parent's left and when users click it, edittext's width'll increase to right side. Here is the code that i used. But when animation ended, edittext width come to first size. Can any one help me.? And is there any solution to set "fillparent" to width's final size in animation? Animation scaleAnimation = new ScaleAnimation(0, -500, 1, 1); scaleAnimation.setDuration(750); editText.startAnimation(scaleAnimation); I added scaleAnimation.setFillAfter

Android ScaleAnimation and TranslateAnimation, how to avoid ScaleAnimation movement

浪子不回头ぞ 提交于 2020-01-22 12:34:00
问题 I have an AnimationSet with inside a ScaleAnimation and a TranslateAnimation like this: TranslateAnimation: TranslateAnimation goTopFromRight = new TranslateAnimation(0, -(right.getLeft()-top.getLeft()), 0,-(right.getTop()-top.getTop())); ScaleAnimation: ScaleAnimation = setSizeForTop = new ScaleAnimation(1, 2, 1, 2); and AnimationSet: bringToLeftFromTopAnimationSet = new AnimationSet(true); bringToTopFromRightAnimationSet.addAnimation(goTopFromRight); bringToTopFromRightAnimationSet

Android ScaleAnimation and TranslateAnimation, how to avoid ScaleAnimation movement

泄露秘密 提交于 2020-01-22 12:31:26
问题 I have an AnimationSet with inside a ScaleAnimation and a TranslateAnimation like this: TranslateAnimation: TranslateAnimation goTopFromRight = new TranslateAnimation(0, -(right.getLeft()-top.getLeft()), 0,-(right.getTop()-top.getTop())); ScaleAnimation: ScaleAnimation = setSizeForTop = new ScaleAnimation(1, 2, 1, 2); and AnimationSet: bringToLeftFromTopAnimationSet = new AnimationSet(true); bringToTopFromRightAnimationSet.addAnimation(goTopFromRight); bringToTopFromRightAnimationSet

How Do I Make a Swipe Animation From Left To Right Transition Between Activities In Monodroid?

佐手、 提交于 2020-01-21 18:15:12
问题 I'm developing using Monodroid and want to be able to swipe left or right and load new activities as I do so. I also want to have an animation that shows the next activity slide into the screen while the other slides out. I've tried OverridePendingTransition using XML resource files as well as implementing animations. None of this is working for me, however. Has anyone had success with this? Could you place your code here and not a link to some blog or website? Putting this in OnCreate in all

Android change background image with fade in/out animation

假如想象 提交于 2020-01-20 19:14:10
问题 I wrote code which can change background image random every 5 second.now i want to use fade in/out animation to change background image,but I do not know how I can use this animation. This is a my source: void handlechange() { Handler hand = new Handler(); hand.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub // change image here change(); } private void change() { // TODO Auto-generated method stub Random rand = new Random(); int index = rand