Questions tagged [animationdrawable]

An object used to create frame-by-frame animations in Android. Generally defined as an XML file, placed in the res/drawable/ folder.

An object used to create frame-by-frame animations in Android. Generally defined as an XML file, placed in the res/drawable/ folder. Reference: https://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html

153 questions
0
votes
0 answers

Android How to click to switch animation

I have an animation in imageview, I want to switch the second animation After the second animation running once, then return to the previous I add a OnClickListener and tried setOneShot(true) and if (ad.isRunning() == false) but it only runnind…
Xiayan
  • 5
  • 3
0
votes
1 answer

Animation Drawable Won't Resize Properly

I have a walking dinosaur that I animate using an animation drawable
Elliptica
  • 3,928
  • 3
  • 37
  • 68
0
votes
0 answers

Saving an AnimationDrawable object to a file

I am very new to android development and trying to make an application that will convert a video to GIf using MediaMetadataRetriever and AnimationDrawable. I am able to display the GIF but I am not able to save the file. I want to know how I can…
0
votes
1 answer

How to animate gradient colors in Android like Facebook Shimmer effect

I am trying to add a loading placeholder (just a linear layout) until I get a response from the API. I want to add a Shimmer like effect to the placeholder without using an external library. I tried using a GradientDrawable with a ValueAnimator from…
0
votes
1 answer

How to make animation with drawble animation

I would like to play 2 animationdrawables after eachother.. When the first one stops, the other one has to start..(using OnTouchListener) The problem is: AnimationListener is not possible with animationdrawables Does anybody know a solution? thank…
0
votes
3 answers

Android animate drawable

I'd like to display an animated drawable in my app. Just to make the reader visualize what I have in mind, I need an air-conditioning unit that emits flows of air; the "power" of the flows should be adjustable. It would be something like the…
0
votes
0 answers

setAnimatedVectorDrawable.start () does not work on some devices

I have a problem: 1. I have an Activty class in which vector animation is set as a background: private void showSplashScreenAnimation() { AnimatedVectorDrawable animationBackground = (AnimatedVectorDrawable)…
0
votes
0 answers

Every new animation always runs a function using AnimationDrawable

Right now I have a AnimationDrawable that runs 3 different pictures making it basically a GIF, what I want is every time a new picture is played it runs a function. My MainActivity protected void onCreate(Bundle savedInstanceState) { …
0
votes
1 answer

How to have an animated ImageButton in android

I have tried to set the image of an imagebutton to my drawable xml file. I don't know why it doesn't work. My drawable xml:
0
votes
1 answer

How to play animation drawable more than once in Android?

I have one drawable animation from png, and android:oneshot="true" because I don't want the animation play constantly, but only when I activate it. Problem is it plays only once and when I try myAnimation.play(); it doesn't play again. I've tried to…
zarez
  • 65
  • 1
  • 9
0
votes
1 answer

get the current animation frame by AnimationDrawable on android

I have two images for animation. each of them have three images. the first animation has start/stop button. the second animation played automatically. when the 3rd frame of 1st animation and 3rd frame of 2nd animation is played on the same time, I…
exception
  • 35
  • 7
0
votes
1 answer

Android: Stop AnimationDrawable after specified time, resume onResume(), pause onPause()

I needed to stop AnimationDrawable after the specified time, but the class doesn't provide any direct way to do so. I also demanded that the animation pauses onPause() callback and resumes onResume() callback. I couldn't find any complex answer here…
Hawklike
  • 952
  • 16
  • 23
0
votes
1 answer

How to combine an AnimationDrawable with another animation?

Is it possible to combine these 2 animations below? It works but it seems weird to have to call them separately ( 2 calls to start() ) ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image); …
Andy M
  • 3
  • 1
0
votes
1 answer

animationDrawable only displays last frame

I'm trying to create an animation out of multiple png images. Here's my code: AnimationDrawable animation = new AnimationDrawable(); for (int i = 0; i < translate_text.length(); i++) { byte[] byteArray =…
Bines
  • 78
  • 1
  • 7
0
votes
1 answer

Problem in AnimationDrawable android studio

I have animationdrawable I want to but same animationdrawable in two imageview. The problem the first do not work and the second work. AnimationDrawable animation1 = new AnimationDrawable(); Bitmap bitmapba1 =…
vinom
  • 17
  • 3