FAQ Database Discussion Community


Android Home screen animation using widget

android,android-widget,android-animation,android-wallpaper,daydream
I am trying to create an Android app where there will be simple animations on the phone at all times. The app will be similar to "Crack Your Screen Prank" or Facebook Messenger, where it will be on top of the home screen, but animated. At first I thought this...

Designing Toolbar and using Floating Action Buttons

android,android-animation,material-design,android-toolbar,floating-action-button
Although there is some information on the Internet on more or less how the extended Toolbar works and how you are meant to add different Views to it, I would like to have a step-by-step guide for me and everyone else who wants to implement the extended Toolbar into their...

Android 5.0 List Animation

android,android-animation
I have a list of items that is composed of a View and a TextView. I defined an animation: View mView = findViewById(R.id.view); Intent detailIntent = new Intent(this, DetailActivity.class); String transitionName = getString(R.string.my_transition); ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, mView, transitionName); startActivity(detailIntent, options.toBundle()); and in my list_item.xml I have: <View android:id="@+id/view" android:layout_width="@dimen/list_dimen"...

Animations are clipped to ViewGroup bounds in Android 4.3 and below?

android,animation,android-animation,viewgroup,android-viewgroup
I'm working on a custom ViewGroup which draws some animations in the dispatchDraw() method. I came across this in my Google search: https://groups.google.com/forum/#!topic/android-developers/dZ0Yxjz3v7o And I have set clipChildren="false" inside my XML to both the parent and the grandparent view of my custom ViewGroup. However, this fixed the clipping of the...

Can't animate Custom View

android,android-animation
I was creating my textview which use as a header in my MainActivity file and everything was okay until I thought I'd better move the code to another class. While it works and displays the text however when I try to animate it it doesn't work. The code I was...

Slide up/down layout on click

android,android-animation
I am looking to slide/up down a nested layout on its parent layout click. Ie the parent layout will have a hidden child. On click I would like the parents height to animate down (slide down) to fit the child layout. On click again I would like the child to...

Android viewpager with DepthPageTransformer z-index issue

android,android-layout,android-viewpager,android-animation
I implemented a viewpager with a DepthPageTransformer , in pages I have some inputs ( radio , check boxs , select options ... ). It works fine except one wired bug: Sometimes when I click on position(x,y) on a page P1 the input in that position of page P2 gets...

How to blink image in back to back 4 image in android

java,android,animation,android-animation
I want to blink the images in back to back upto 4 images. this means that 1 image is shown n gone and when 1st image is gone then show the 2nd image and when 2nd image is gone then show 3rd image this process is continue for my requirement...

Fragment flashes after removal and animation ends

android,android-fragments,android-animation,material-design
I've been trying to get a fragment to be inserted and removed from my activity with a circular reveal animation. I found this demo repo here that does exactly this. The only change I made was to have the fragment removed on a button click, instead of the fragment touched...

Develop animated button in android

android,android-animation,android-button
Please refer the attached picture when user click on GO button all the other button comes under the GO button and when user again clicks the GO button all the buttons get distributed. I want to make same button and animation. I searched a lot but not got anything relevant,...

Animating drawable alpha property

android,android-animation
I want to animate the alpha property of a ViewGroup's background Drawable. I get a reference to the background's drawable using view.getBackground(). Then I use the following code (from this thread): if (backgroundDrawable.getAlpha() == 0) { ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(backgroundDrawable, PropertyValuesHolder.ofInt("alpha", 255)); animator.setTarget(backgroundDrawable); animator.setDuration(2000); animator.start(); } else { ObjectAnimator animator...

Translate a view and get click event

android,android-animation
First of all please excuse me if this question is already asked. I am new to android animations. I want a view lets say an Image View (with animation i.e,smooth movement) to permanently move one position to some other position of the screen lets say if current X co-ordinate to...

Custom animations in Android

android,android-animation
How would I make animations like this and this? I couldn't find any result on Google showing me how to do it. I have absolutely no idea of how to go about making such animations. Any help would be greatly appreciated....

Combining Move Tranlation + Activity Transition Animation

android,android-animation,translate-animation,activity-transition
What I want to do: Lets say I have an imageView in top right corner of the screen. A. When I click on it it will move/translate to center of the screen B. It should then animate into new activity using SharedElement Transition I am able to do A using...

Custom ordering in LayoutAnimationController

android,animation,android-animation
If i want to add animation on each item of ListView with some delay, i use LayoutAnimationControllerand specify the delay. But the order of animation here can be only NORMAL,REVERSE or RANDOM. I am working on an animation where suppose the rows of ListView are 1,2,3,4,5. Then when i touch...

Could not find method makeScaleUpAnimation

android,android-intent,android-activity,android-fragments,android-animation
I am using makeScaleUpAnimation in my project like below, (in a fragment) ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(i, options.toBundle()); The project is building successfully but in runtime I had that error: I/dalvikvm(5432): Could not find method android.app.ActivityOptions.makeScaleUpAnimation, referenced from method com.example.webapicaller.ui.fragment.ImageGridFragment.onItemClick But I can found that method...

How to understand uses your application hardware acceleration or not

android,android-layout,view,android-animation,hardware-acceleration
I want to enable hardware acceleration for application. I added in Android manifest line <application android:hardwareAccelerated="true"/> I think this line should enable hardware acceleration on all view in the app, but when I check (using a method view.getLayerType()), I get a result of 0. I conclude that you are not...

Can you draw multiple Bitmaps on a single View Method?

android,canvas,bitmap,android-animation
currently I am trying to make an animation where some fish move around. I have successfully add one fish and made it animate using canvas and Bitmap. But currently I am trying to add a background that I made in Photoshop and whenever I add it in as a bitmap...

Shared Element Transition Glitch in Android Lollipop

android,android-animation,android-5.0-lollipop,activity-transition,shared-element-transition
I'm trying to do an Android 5.0 shared element transition in a Master Detail situation from a ListView. I'm sending an Image. I've run into a glitch on the enter transition where the Image doesn't move at all while the Master activity transitions out. Once the Detail activity is loaded,...

OutOfMemoryError when loading an animation .xml

android,android-animation,drawable,android-drawable
I have the following ImageView: imageView.setBackgroundResource(R.drawable.create_user); My create_user drawable looks like this: <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/create_user_0" android:duration="500" /> <item android:drawable="@drawable/create_user_1" android:duration="500" /> </animation-list> But when the .xml is being set in imageView.setBacgroundResource(R.drawable.create_user), it launches the...

EditText expands too slow inside AlertDialog on android

android,dialog,android-animation,alertdialog
Simplifying a more complex problem. I have an AlertDialog with this view dialog.xml (I might be wrong and this problem has nothing to do with AlertDialog, but Views in general): <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> // <ImageView 48dp x 48dp/> ImageView for profile photo <EditText android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content"...

how to apply animation on andoid activity

animation,android-animation
i am working on app in which i need some animation on activity i cannot find any solution. please any one help me public class MainActivity extends Activity implements AnimationListener { TextView tv; Animation animFadein; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv = (TextView) findViewById(R.id.textView1); animFadein = AnimationUtils.loadAnimation(getApplicationContext(),...

How to clear Animation Listeners set by NineOldAndroids?

android,android-animation,nineoldandroids
I am trying to have a view animated in my app and am using NineOldAndroid for animations. The desired effect is to fade the view out and then set it's visibility to gone so that it doesn't get clicked while invisible. Here is How I do it. ViewPropertyAnimator.animate(view).alpha(0).setListener(new Animator.AnimatorListener() {...

Android Studio fading splash into main

android,android-studio,android-animation,fadein,splash-screen
I currently am working on an android app. Just started and I was able to implement my splash screen. However, I don't like the transition between that and the main activity. I want the splash screen to fade out and main to fade in. Looks like they blend together since...

How to change activity after 5 seconds?

android,android-animation
I made a sort of index activity with my personal logo. I want that after 5 seconds change activity. So I prepared 2 layout, I run the launcher. In launcher activity I set: Intent intent = new Intent(Home.this, IndexActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); }...

None linear activity transition animation

android,android-activity,android-animation,android-transitions
I want to implement a none linear activity transition animation. My current anime xml file <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="@android:integer/config_mediumAnimTime"/> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="@android:integer/config_mediumAnimTime" /> </set> What i want to do is animation to start slow end in faster speed....

expanding recyclerview item

android,android-animation,recyclerview
if i expand any item in the recyclerview it expands fine but when i scroll down the recylerview i found other items also expanded , due to recycling it took the expanded size not the original one public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.MyViewHolder> implements View.OnClickListener { private LayoutInflater inflater; private Context...

Animate View and keep visible after animation

java,android,android-animation
I have two indicators, each need to be invisible to start. I want them to be visible after animating in, how do i do this? Right now they animate in then disappear, here is the code: indicator.setVisibility(View.INVISIBLE); indicator2.setVisibility(View.INVISIBLE); Animation fadeInAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.fade_in_view); indicator.startAnimation(fadeInAnimation); indicator2.startAnimation(fadeInAnimation); My xml is: <?xml version="1.0"...

Android: Animate Custom Drawable programmatically

android,android-animation,android-drawable
I have a Custom Class extending Drawable as seen below which is meant to draw an Arc. From my MainActivity controlling the Drawable, I am redrawing it based on some input values that I translate to the appropriate "angle" for the shape. E.g. This is the initial state of the...

How to set two animations to layouts and trigger it when the orientation changes?

android,android-layout,android-animation
I want my layout to animate and rotate 90 degrees (left/right) rather than creating a new xml layout for its landscape mode.

Android animations and screen rotation

android,android-animation
I have animated some properties with AnimatorSet (simple fade-in, fade-out etc.) but when I change the screen rotation my activity always goes back to its starting layout. Is there something I'm missing here? ObjectAnimator fadeOut = ObjectAnimator.ofFloat(loginBtn, "alpha", 1f, 0f); fadeOut.setDuration(300); ObjectAnimator fadeIn = ObjectAnimator.ofFloat(backBtn, "alpha", 0f, 1f); fadeIn.setDuration(300); final...

(Partially Solved) ViewAnimationUtils - No animation occurs

android,animation,android-animation,android-5.0-lollipop,viewanimator
I'm trying to use a Circular Reveal to animate in a LinearLayout on click of a FAB. Onclick, the view changes to become visible after a time delay, but no visible animation runs? In addition, when the function is reversed as an exit animation the view is invisible for the...

How to enable the animation on textview borders in Android

android,xml,textview,android-animation
I created an XML file that enables the textview border change colour on click. Now I want to add another feather that the border softly fades away. How can I do that? Here's the XML code. <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true"> <shape android:shape="rectangle"> <solid android:color="@color/textbox" /> <stroke...

play audio with animation

android,android-animation
I am working on application when touch it, it plays audio. But after 10,14 times later it not working, any idea ? // on touch method img.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { anim_value = true; handler.post(runnable); } else if (event.getAction()...

Android 5.0 Slide Animation Flashing fragment

android,android-fragments,android-animation,android-5.0-lollipop
I'm looking to use the Slide Transition class added in the Android SDK 21. Currently I have this code to replace my fragment: Fragment fragment = getFragment(fragmentManager); Slide slide = new Slide(Gravity.RIGHT); fragment.setEnterTransition(slide); fragmentManager.beginTrSlideansaction() .replace(R.id.content, fragment, getKey()) .commit(); The Slide animation works for the fragment coming into view, but the...

Android Flip vertical animation xml

android,android-animation
i want to create Flip vertical animation in my application but all of my found document are flip horizontal and i can not find any document about flip vertical by xml or java class

Slide out effect (translationX) doesn't work with LayoutTransition + ObjectAnimator

android,android-animation
I tend to have a slide out effect, when I make a View invisible (Not gone) in LinearLayout. My expect animation effect are :- The view will fade out slowly (alpha) The view will slide from left toward right (translationX) I try to achieve such effect via LayoutTransition + ObjectAnimator,...

How to add Ripple effect in RecyclerView

android,android-animation,android-recyclerview
I would like to add this nice effect to my RecyclerView items but I don't know where to start. If somebody knows a good and simple tutorial on this topic I would appreciate sharing it with me.

Animating a TextView height increasing

android,android-layout,android-animation,android-textview
Could someone please post a simple example of how to animate a TextView growing in height from 0dp to a dynamic value? I would like to increase the height of a textview, but allow the user to SEE it like an animation. The only condition is I know my max...

Zoomout animation on button press in android

android,xml,animation,android-animation
When press a button,i need to animate that button....button will zoom out little on pressed and in orignal size on released..(very much like in tinder) i use this : <?xml version="1.0" encoding="utf-8"?> <scale xmlns:android="http://schemas.android.com/apk/res/android" android:duration="200" android:fromXScale="1.0" android:fromYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:toXScale="0.9" android:toYScale="0.9" > </scale> but it not work according to my...

Animation of imageView in WindowManager does not work in android 4.xx

android,android-animation,window-managers
Hi I need a floating bubble on top of my activity and I decided to use a service for that. Everything works well except that in Android 4.xx devices the imageView is not being animated. I have added listeners to the animation and the animation is run (it starts, repeats......

Animating views parallely

java,android,xml,android-animation,objectanimator
I'm designing a login/signup interface. The idea is like this: The XML I've got two EditText views: one for username, the other for password, like this: [USERNAME] [PASSWORD] [SIGN IN BUTTON] The XML for both elements: <EditText android:layout_width="270dp" android:layout_height="@dimen/ui_element_height" android:id="@+id/usernameField" android:background="@drawable/field_start_screen" android:layout_gravity="center_horizontal" android:paddingLeft="@dimen/field_padding_left" android:drawableLeft="@drawable/ic_user"...

Android RecyclerView notifyItemRangeChanged vs notifyItemChanged

android,performance,android-animation,android-recyclerview
I have a dataset that possibly changes upon refresh. It's quite unpredictable to determine which entries in the existing dataset has been changed. I read through the recyclerview adapter desciptions and the main question I have is. Is it more efficient figuring out which data-view changed, then use notifyItemRangeChanged for...

Android Animation Repeating

android,android-animation
I have three views with the same translate animation. Using a random number from 0-2, one of the three views is animated. I'm having trouble repeating the animation and the delay of each animation from each other (should be around 2000ms). Animation move = AnimationUtils.loadAnimation(this, R.anim.move); View view1 = (View)...

RippleDrawable - Show Ripple Effect programatically

java,android,android-animation,android-5.0-lollipop,rippledrawable
I have a view with like this <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New Button" android:id="@+id/button" android:background="@drawable/ripple" android:layout_centerVertical="true" android:layout_alignParentStart="true" /> And ripple.xml as <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight" > <item android:id="@android:id/mask"...

Android Animate GONE visibility

android,android-layout,android-animation
in my application i have RelativeLayout with any widgets,into layout and i want to move up that by xml animate. RelativeLayout visibility is GONE and that must be set visibilty to GONE again and move that to up. my problem is this, after set again visibilty to GONE move animate...

Replacing fragments blocks the animation of the drawer

android,android-fragments,android-animation,navigation-drawer
I've added a navigation drawer to my applicaton, it's one single activity that manage 3 fragments. Now when I click in an item from the navigation drawer list, I get the position of selected item and I call the following method to display the selected fragment : private void displayView(int...

How to achieve uniform velocity throughout a Translate Animation?

android,android-animation,translate-animation
I have an infinite translate animation applied to an ImageView: Animation animation = new TranslateAnimation(0, 0, -500, 500); animation.setDuration(4000); animation.setFillAfter(false); myimage.startAnimation(animation); animation.setRepeatCount(Animation.INFINITE); What I have noticed is that the translation process is slower when the image is near the starting and ending point compared to when its near half the...

Material sidebar icon animation (e.g. Gmail)

android,android-animation,material-design
I am investigating if there is a 15+ API to implement sidebar icon transitions as displayed on the video by google: http://material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0B0NGgBg38lWWRm5QODB0bk95SUE/patterns-loadingimages-loading-070901_Load_Add_Animation_xhdpi_002.mp4 If I use the classic ObjectAnimator.fromFloat() the code will be huge and cumbersome. Is there a way to reposition the items with a reasonable length of code?...

delay slide action when an image is clicked using viewpager android

android,android-viewpager,android-animation
I have created a slideshow in which i have disabled the default swipe action to slide screens. Instead when I click an image the slide performs. But I want to delay the slide for say t milliseconds after the image is clicked. The method of click action is onClickSlideDown. The...

Proper way to (animate) show/hide a view in android? [closed]

android,android-layout,android-animation
Imagine having a panel, say an stickers panel (something like Viber or Telegram) in your app which needs to be visible and gone every now and then. What would be the proper way of showing/hiding it? For example I used to change (animate) the height of the wrapper layout but...

How can an Interpolator be used with an animation in Android?

android,android-animation
I have the following code: ObjectAnimator.ofInt(this, "barHeight", maxInPx).setDuration(1000).start(); I would like to add an Interpolator to the ObjectAnimator; however, I receive an error stating, "Can not call start() on primitive type void" when I use the following code: ObjectAnimator.ofInt(this, "barHeight", maxInPx).setDuration(1000).setInterpolator(new BounceInterpolator()).start(); How can I use an Interpolator with an...

Rotating wheel in android

android,rotation,android-animation,android-imageview
My imageview consists of circle wheel as shown in below pic.I want that wheel should start rotating as soon as user presses a start button and stop rotating when user presses stop button.Is it possible programmatically?If yes,how can i do that? ...

How to add an exit / return TransitionAdapter

android,android-animation,android-transitions
I'm creating a scene transition using to move from Activity A to Activity B: ActivityOptions.makeSceneTransitionAnimation In Activity B I add a TransitionAdapter to perform certain tasks when the scene transition is completed: getWindow().getEnterTransition().addListener(...) Is there a way to add a TransitionAdapter to the exit / return in Activity B so...

The screen becomes a Blur on Android Lollipop devices

android,android-layout,android-animation,android-5.0-lollipop
The code which worked for lower versions of android preior to 5.0 now on android lollipop devices are showing screens like these Even on updating my code to the 5.0 android toolbar, material theme effects. these screens are totally mibehaving in some screens like On Back press from one fragment...

Animations Timings for different Images

android,android-layout,android-animation
guys i have set five different imageview in XML i want same animation effect with one second delay.Animation must occur in sequence order one by one.For a starting page in android app i have done this.so what should i do here's my code protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome);...

What is the difference between an Animator and an Animation?

android,android-animation
It looks like both Animations and Animators allow me to animate properties (position, opacity, scale, rotation, etc) on objects, and I'm having a hard time differentiating between the use case for both. When should I use an animator versus an animation and vice versa?

Add view by sliding in from left

android,android-animation,android-view
I want to add a view to a fragment via an animation. I want the view to appear by sliding in from the left of the screen and exit by sliding out the same way. I'm not able to get this to work. When the fragment appears, the view is...

slide out animation not working on back press button?

android,animation,android-activity,android-animation
I am using animations when entering or exiting the activity,entering to an activity animation works fine but exit animation does not work well. I start exit animation when i press back button.What happens is it first start enter animation for current activity then show the last activity what i want...

How to create swipeable views in android?

android,android-animation,swipeview
I want to create a swipeable views in android. My aim is to achieve this effect. Here, on swiping right i want to change only image source, background image should be fixed. How can this be achieved?...

Composing Simple Animations

android,xml,animation,android-animation
I need your help to understand how to manage a complex animation built from some simple animations in Android: I have this animation xml file: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <!-- A: executed only one time at the beginning --> <scale xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:fromXScale="1" android:fromYScale="1" android:pivotX="50%" android:pivotY="50%" android:toXScale="0.2" android:toYScale="0.2" />...

Fragment Transition not working

android,android-fragments,android-animation
In my app I have 3 tabs(buttons) and on its swipe I am changing the fragment.So for this I am using slide left and slide right animations.But it seems not working for me. Slide_Left <?xml version="1.0" encoding="utf-8"?> <set> <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1000" android:propertyName="x" android:valueFrom="2000" android:valueTo="0" android:valueType="floatType" /> </set> Fragment Call try...

Animate the rotation of the Marker in google map v2

android,google-maps,google-maps-markers,android-animation
i am using google maps v2. i have a marker on map, this marker changes rotation every while. I want to animate the rotation of my maker to rotate smoothly. Can anyone help please

How to animate background color change on relative layouts views when pressing a ToggleButton in Android?

java,android,view,android-animation,seekbar
I have a RelativeLayout containing another relative layout which has several backgroundColored views inside of it, like this, and continuing with more views: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity "> <RelativeLayout android:id="@+id/palette" android:layout_width="fill_parent" android:layout_height="fill_parent"...

make android splash screen animation with xml

android,android-animation,splash-screen
I want to make an animated splash screen in android related to quiz. Can anyone help me for making the splash screen which gives good start to my application of quiz?

Android pop in animation

android,button,android-activity,android-animation
I mave a floating action button in my app which I want to sort of pop in, where it is invisible and starts to grow to a size like 60dp and then resizes back to the normal size of 56dp. How can that be done? I know how to do...

Android ViewFlipper with translation animation - not working properly

android-layout,android-animation,translation,viewflipper
I want to display banner(images moving in x direction) in my application. For that i am using ViewFlipper with Translation animation. Please find my below code.. my layout: banner.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <ViewFlipper android:id="@+id/banner_image" android:layout_width="match_parent" android:layout_height="258dp" /> </RelativeLayout> In...

Move ImageView To Center Of Screen in android

android,android-animation,android-imageview,android-image,android-windowmanager
i m working in an application which have 2 imageview 1st one is left and onother is in right ...when page will loaded imageview move nd it goes to center of screen.. i.e imageview-------->center<----------imageview i m using translate animation to move the images which take 4 parameter i.e TranslateAnimation (float...

How to repeat an AnimationSet with sequentially added animations

android,android-animation
I am trying to make an animation in my Activity, to be repeated infinite times. I have already tried it in XML file with repeatCount and repeatMode attributes, but it doesn't work. The thing is that myanimation.xml file is constructed of a set of different animations. My XML file for...

Rotation animation is not spinning the asset in center point

android,mobile,android-animation
I'm trying to rotate a round button when is pressed.My problem is the button doesn't rotate around it's own centre. Followed other examples but the outcome is the same. Here is my code: rotate.xml: ?xml version="1.0" encoding="utf-8"?> <rotate android:duration="1500" android:interpolator="@android:anim/linear_interpolator" android:pivotX="50%" android:pivotY="50%" android:repeatCount="infinite" android:repeatMode="restart" android:toDegrees="360" /> and in the class...

ViewPropertyAnimator without start call, is there a difference?

android,android-animation,android-view,viewpropertyanimator
Sometimes I see code like view.animate().alpha(1).start(); And sometimes view.animate().alpha(1); What (if any) is the difference? The animation always starts but from my understanding of the source code two entirely different things happen in the background before it does so depending on the start call. ...

Android - Updating View's Height on translationY() Animation

android,android-layout,android-animation
I have a layout that I want to expand after button click, as shown below: The problem is I need to use Animation, so I decided to use View.animate.translationY(). Here is my code: private void showBottomThreeLines(boolean show){ if(show) mShiftContainer.animate().translationY(0); else mShiftContainer.animate().translationY(-(mFifthLineContainer.getHeight() * 3)); } However, this is what I get...

Android Fragment Translate Animation Not Working

android,android-fragments,android-animation
I'm trying to do a simple translate animation for two fragments. One comes in from the right while the other goes out to the left. My min SDK is 14. What happens is the transition takes place, but without the actual animation. After the time specified in the animation xml,...

Difference between setWindowAnimations and overridePendingTransition?

android,android-activity,android-animation
What is the difference between, getWindow().setWindowAnimations() and Activity.overridePendingTransition() It seems like both have the same functionality....

Android Studio. Animating a moving symbol/label

android,android-layout,android-animation
I am trying to create a simple program that prints a symbol at the (x,y_const) coordinate of the screen and then animates it moving from coordinate (x,y_const) to (x+somevalue,y_const) and then back to (x,y_const). Aside from frame animation, what other ways of doing this exist? I assume I could create...

Trouble with Android character by character display text animation

android,android-animation,android-textview
I'm following this solution Android character by character display text animation I get unresolved method for setContentView Here is the Typewriter Class public class Typewriter extends TextView { private CharSequence mText; private int mIndex; private long mDelay = 500; //Default 500ms delay public Typewriter(Context context) { super(context); } public Typewriter(Context...

Rotate an Imagewith Animation

android,android-animation,android-imageview,image-rotation
What I Have I have an arrow image (like the left one). When the user clicks on it, it should rotate 180 degree with an animation and should look like the right one. What I Have Done private void rotate(float degree, final int toggleV) { final RotateAnimation rotateAnim =...

What is wrong with my code? I want to make a 'card-flip' animation in Android

java,android,xml,runtime-error,android-animation
Here's my Main Activity: public class Main extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getFragmentManager() .beginTransaction() .add(R.id.container, new CardFrontFragment()) .commit(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it...

Turn code into reusable Class - Android

android,android-layout,android-animation
I'm using the following code to animate a TextView's height growing from 0 to 100 (or whatever is specified as the "m" value on the animateHeight method. My question is, how can I turn this into a class so that I can call it for all 12 of my textviews...

Circular Reveal Android Soften Edges

android-animation,android-5.0-lollipop,android-transitions,circularreveal
I'm just experimenting with the new Lollipop transitions and was curious if the following was possible. Right now I have a circular reveal animation working beautifully but it reveals the background with a very hard line. I was wondering if it was possible to soften the line or to fade...

Increasing the visibility of a view on Swipe using Gestures in android

java,android,eclipse,android-studio,android-animation
I am using following code private GestureDetector.OnGestureListener mGestureListener = new GestureDetector.OnGestureListener() { private float lastDeltaValue; private static final int MIN_DISTANCE = 15; private static final int MIN_DISTANCE_Y = 25; @Override public boolean onDown(MotionEvent e) { lastDeltaValue = 0; return false; } @Override public void onShowPress(MotionEvent e) { } @Override public...

How to disable animations in code when running Espresso tests

android,android-animation,android-permissions,android-espresso,android-instrumentation
Has anybody managed to disable animations through code when running Espresso tests? I've been trying to follow the instructions in this webpage (linked to from here): https://code.google.com/p/android-test-kit/wiki/DisablingAnimations Unfortunately it does not appear to be working, as I keep seeing this permissions error: 04-27 15:48:28.694 303-342/system_process W/PackageManager´╣Ľ Not granting permission android.permission.SET_ANIMATION_SCALE...

Set TransitionDrawable with ImageView ScaleType

android,android-animation,android-drawable,android-bitmap,transitiondrawable
I have got this code to crossfade the background of an ImageView: private void setWithCrossfade(Bitmap bitmap) { //create drawable vector Drawable backgrounds[] = new Drawable[2]; //getting first image backgrounds[0] = mImageView.getDrawable(); backgrounds[1] = new BitmapDrawable(mImageView.getResources(), bitmap); TransitionDrawable transitionDrawable = new TransitionDrawable(backgrounds); transitionDrawable.setCrossFadeEnabled(true); mImageView.setAdjustViewBounds(false); mImageView.setImageDrawable(transitionDrawable); //it is needed to...

Don't understand why OutOfMemory on setImageDrawable

android,imageview,out-of-memory,android-animation
Having a problem with a custom button control which I have made. The button is defined in layout like this: <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:layout_width="180dp" android:layout_height="180dp" android:layout_centerInParent="true" android:layout_margin="20dp" android:background="#fff" android:contentDescription="@string/my_button_info"...

Animate changing LayoutParams (RelativeLayout)

android,android-layout,android-animation
when I click on a RelativeLayout it change the size. How can I make this change animated? So it looks like the rectangle grows to full screen? My Layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin"...

Android line path morphing animation

android,android-animation,android-canvas,android-view
I basically have two lines, drawn by two paths on my canvas. Each one has only two points, one is supposed to remain standstill and the other one moves. I realized this simply by creating a Path and then call moveTo(x1, y1) and lineTo(x2, y2). (x1, y1) never changes during...

Android ListView Item animates after scrolling

android,android-listview,android-animation
My Problem: An item in my ListView animates after I begin scrolling. It is not the last item and animation should be finished. After I have scrolled once the problem is gone, It only happens once and on a single item in the list. How can I stop that single...