android-animation

Oreo: disable Activity transition animation

落爺英雄遲暮 提交于 2020-01-01 10:35:07
问题 I need to disable Activity transition animation for all the screens in my application. Previous solution worked fine for all Android version: <style name="base_theme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowAnimationStyle">@null</item> </style> ... but for Android 8 "Oreo" it cause black screen blinking for every transition (forward or back move). I.e. there is still no any animation, but very annoying blinking take place (90% chance, ~20-30 milliseconds, the

Android - Button with rotating/spinning 'loading' image when pressed

对着背影说爱祢 提交于 2020-01-01 08:59:29
问题 I have a big 'Log in' button on my app. When the user taps this button, I want to replace the text with 'Logging in...', align it to the left instead of center and put a spinning circle on the right (but still inside the button). I'd like to use essentially the same button (but with different initial and loading text) in other places in my app. What's the neatest way to do this? For the actual spinning graphic, I was planning to use the @drawable/spinner_white_16 that comes with Android.

how to animate one item of layer-list

这一生的挚爱 提交于 2020-01-01 02:48:06
问题 I have a layer list object, it contain two images, one is background, and the other is a rotation disk image which will be raotated at the top of the background image. i.e. I use this layer-list as a linearlayout background, and I only want to animate "disk_bg" item of the layer-list; <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/ android"> <item android:drawable="@drawable/player_bg" /> <item android:top="166dp" > <bitmap android:id="@

TextView animation - fade in, wait, fade out

余生长醉 提交于 2019-12-31 18:59:22
问题 I am making a picture gallery app. I current have a imageview with a text view at the bottom. Currently it is just semitransparent. I want to make it fade in, wait 3 second, then fade out 90%. Bringing focus to it or loading a new pic will make it repeat the cycle. I have read thru a dozen pages and have tried a few things, no success. All I get is a fade in and instant fade out 回答1: You can use an extra animation object (which doesn't modify its alpha) to prevent the instant fade out, set

Collapsing CardView inside RecyclerView when animating

狂风中的少年 提交于 2019-12-31 10:34:11
问题 What I'm trying to do I have a CardView with a supporting text on the bottom that is GONE by default. I want to make this section of the card visible only when the user clicks the "action arrow", as shown on the image below: I know I can achieve that by simply setting that View visibility to VISIBLE , but I also want to animate the expand and the collapse events. The problem and what I've tried so far To do that I've used the android:animateLayoutChanges="true" property on my CardView xml,

Shared element activity transition on android 5

折月煮酒 提交于 2019-12-31 08:30:10
问题 I wanted to setup a shared element transition when going from one Activity to another. The first Activity has a RecyclerView with items. When an item is clicked that item should animate to the new activity. So i've set a android:transitionName="item" on both the final activity views, as wel as the recycler-view item views. I'm also using this code when going to the next activity: this.startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(this, itemView, "boomrang_item").toBundle(

NineOldAndroids animation not working on API>10

我的梦境 提交于 2019-12-30 12:24:10
问题 I am using NineOldAndroid library to perform animations. The animations work fine for API<=10. But for API>10 the app force closes. This is my code: import static com.nineoldandroids.view.ViewPropertyAnimator.animate; import android.content.Intent; import android.graphics.Canvas; import android.graphics.PixelFormat; import android.os.Build; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import

Using Animation to swipe views

拟墨画扇 提交于 2019-12-30 11:05:49
问题 I have a FrameLayout that recognize swipe gestures (up and down). For example: if a swipe up are performed, I should animate the current view (that is MATCH_PARENT x MATCH_PARENT) to goes up at the same time a new view come from bottom. I can achieve this with animations? 回答1: I solved this way: private void swipeUp() { current.currentPage++; final View hidingView = currentView; TranslateAnimation hide = new TranslateAnimation(0, 0, 0, -getHeight()); hide.setAnimationListener(new

How a Translate Animation works: Android

妖精的绣舞 提交于 2019-12-30 06:55:26
问题 I'm trying to move a RelativeLayout using TranslateAnimation . Code I have written for performing the same is: translateAnimation = new TranslateAnimation(0, 0, heightOfRootView-excuseContainer.getHeight(), currentYPoint); translateAnimation.setRepeatMode(0); translateAnimation.setDuration(500); translateAnimation.setFillAfter(true); excuseContainer.startAnimation(translateAnimation); I'm trying to start animation from current y position of particular view (I do not need to change x position

What is the default transition between activities in Android 4.0 (API 14+)

左心房为你撑大大i 提交于 2019-12-30 06:07:43
问题 I built an application with quite a few activities and I would like to have "slide from right on enter/slide from left on exit" transitions between them. I read more than once that slide transitions should be the Android default, but on the device I am developing on the transitions are fade in/fade out by default (Galaxy Tab 2 7", on ICS 4.0). Is there anything I need to declare at application level, for example in the manifest file? I am asking because otherwise I would need to add