android-animation

Correctly animate removing row in ListView?

本秂侑毒 提交于 2019-12-18 18:24:11
问题 The problem: (1) add a touch listener to rows in a listview so that on swipe. (2) swipe animation plays (3) rows get deleted in the backend, and (4) the animation plays without any flicker or jerkiness. By "flicker" I mean that the deleted row briefly shows after the animation finished. I suspect that something funky was happening with the animation listener, so I ended up doing the following (done in the order given): Do the animation and make it persist by setting setFillAfter and

Change activity transition when inside a TabHost

岁酱吖の 提交于 2019-12-18 18:22:25
问题 I have successfully changed the transitions between activities using overridePendingTransition() . Unfortunately when I am on a TabActivity and use activities inside each tab. When one of those activities inside the content of the tab, starts another activity, the overridePendingTransition() seems to not work. I basically have a TabActivity , inside it resides an activity with a ListView . What I'm doing is when the item is clicked, I launch the item details' activity. This new activity's

Change activity transition when inside a TabHost

我怕爱的太早我们不能终老 提交于 2019-12-18 18:21:33
问题 I have successfully changed the transitions between activities using overridePendingTransition() . Unfortunately when I am on a TabActivity and use activities inside each tab. When one of those activities inside the content of the tab, starts another activity, the overridePendingTransition() seems to not work. I basically have a TabActivity , inside it resides an activity with a ListView . What I'm doing is when the item is clicked, I launch the item details' activity. This new activity's

Navigation Component set transition animation programmatically

北城余情 提交于 2019-12-18 13:41:53
问题 yesterday i come across with a problem that i needed to set animation from nav_graph.xml in my baseFragment and programatically get action object from current node which includes enterAnim and exitAnim resource. Could not find solution here so here we go. First we need to feed anim folder with our animations in res folder because its hungry. slide_in_left.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:duration=

How to animate the width and height of a Layout?

☆樱花仙子☆ 提交于 2019-12-18 13:37:25
问题 I have a LinearLayout which is expanded to full screen by hiding all other layouts and views on onClick . There is a Relativelayout above LinearLayout I want to apply custom animation on this. The size should should increase slowly (like in 500 milli seconds). But I doubt is it possible? Thanks. Here is what I am doing onClick : private void expandView (int viewId) { RelativeLayout relativeLayout = (RelativeLayout) ((LinearLayout) view.findViewById(viewId)).getParent(); ViewGroup

How to move a view in Android?

試著忘記壹切 提交于 2019-12-18 13:28:58
问题 I have a project where I have 2 challenges: First: Move an icon to wherever the finger touches the screen: For this, the best approach I've found, is to use .layout() method on the view. Second: I have two layouts, on a RelativeLayout , both with screen width and height (1 is hidden behind the other). I want to move the one above a few dips to the right every time I click a button. Is there a better way to move views on Android? What could be the disadvantages of using the method .layout() ?

How to implement Custom listview text animation

情到浓时终转凉″ 提交于 2019-12-18 12:35:30
问题 I am creating shopping application in android. In my app, I show list of items from custom list view. If customer select an item, Selected item text moves from listview into shopping cart image. Like below image, This type of animation is my requirement. But my animated view stopped at end of custom row.. like this image. My animation.xml code, <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear

Skewing a text view in Android

人盡茶涼 提交于 2019-12-18 11:57:18
问题 I'm looking to replicate the following within my application: As you can see, its basically a button which increases/decreases the value of the text view contained within it. This button will have three visual states -> unpressed, decrease and increase (as seen in the image above, the user taps the increase arrows and the button appears pressed in on that side) Here are my 3 button states currently: As you can see, the problem I have is being able to correctly skew/rotate the text view so it

How to create animated background gradient like Instagram app?

心不动则不痛 提交于 2019-12-18 11:36:49
问题 Below are screenshots of instagram app. The background keeps on transforming from one gradient to other very beautifully. I want to know how can I achieve this. IS THERE ANY CODE TO ANIMATE A GRADIENT AUTOMATICALLY OR DO I NEED TO ADD DIFFERENT GRADIENTS WITH SLIGHT VARIATION, and if I use it won't cause any copyright issues with Instagram? I have tried animating using multiple gradient files with slight variation using Frame Animation but it isn't smooth and doesn't work well. Thanks 回答1:

iOS like over scroll effect on Android

六月ゝ 毕业季﹏ 提交于 2019-12-18 11:33:23
问题 I want to implement the iOS-like bounce overscroll effect in my app. I came across this link which suggests creating a custom ScrollView . But the problem is that when I am scrolling up and down fast it's working fine but as soon as I pull the bottom or top of the screen it's just stuck and the effect is not working anymore. As an example of the kind of animation I want to achieve you can look at this: This is the code I currently have: public class ObservableScrollView extends ScrollView {