android-animation

How to transition the activity from top to bottom and viceversa?

南笙酒味 提交于 2020-01-12 07:58:49
问题 Can anybody tell how to transition the activity from top to bottom in Android, perhaps with an example? 回答1: Define an animation in res/anim/slide_in_up.xml: <?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromYDelta="100%p" android:toYDelta="0%p" android:duration="@android:integer/config_longAnimTime"/> and another at res/anim/slide_out_up.xml: <?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas

Make a layout appear with animation after button click in Android

浪子不回头ぞ 提交于 2020-01-12 05:45:06
问题 I'm trying to implement a simple animation effect for login screen. Here's the scenario, 1: Some text and a login button will be displayed by default. 2: After clicking the login button a new frame layout will appear from bottom to top. This layout will prompt user to enter their username and password. I can make an animation which will overlay from one parent to another. In this scenario, I'm looking for an animation that will appear without leaving the activity. 回答1: First set invisible to

Make bounce animation

这一生的挚爱 提交于 2020-01-12 05:11:35
问题 I would like to do bounce animation of layer. I have done that layer comes from right to center, now I would like to move it a little back and then back to center. That would create bounce effect. I was thinking that I can do it with a translate like this: <translate android:duration="900" android:fromXDelta="100%p" android:toXDelta="0%p" /> <translate android:duration="900" android:fromXDelta="0%p" android:toXDelta="100%p" /> <translate android:duration="900" android:fromXDelta="70%p"

Android views expand animation

三世轮回 提交于 2020-01-12 03:58:07
问题 I'm trying to edit these source to create a simple function that will work on all of my views. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); RelativeLayout mLayout1 = (RelativeLayout) findViewById(R.id.layout1); RelativeLayout mLayoutToBeExpanded1 = (RelativeLayout) findViewById(R.id.layout_exp_1); addAction(mLayout, mLayoutToBeExpanded); RelativeLayout mLayout2 = (RelativeLayout) findViewById(R.id.layout2);

Moving a RecyclerView via Touch or Gesture Recognition

こ雲淡風輕ζ 提交于 2020-01-11 12:39:29
问题 I am attempting to move and grow, a RecyclerView so that the contents take up the full screen base on touch input. I want the RecyclerView to maintain the ability to scroll left and right. I was unable to get a GestureDetector to work properly with the RecyclerView. Catching the onScrollChange doesn't work as it may not have the ability to scroll. I attempting onTouchEvent but the results were rather buggy. Does anyone have any advice? Repo: https://github.com/CubanAzcuy/Animation-Test

CoordinatorLayout with multiple snapping points

落爺英雄遲暮 提交于 2020-01-10 11:36:31
问题 Here I've got quite a complex animation that may be resolved (I believe) in a simple way using the CoordinatorLayout. It has 3 states: Initial (left screen) - Header view is shown fully (orange background): Toolbar, grey roundrect (it's actually a photo there) plus some other views below (TextViews, RatingBar etc) Scrolling the content up (middle screen) - roundrect is zooming up with a changing green foreground alpha level over it, so it becomes green while scrolling (well, it is not obvious

Android TranslateAnimation animation

荒凉一梦 提交于 2020-01-07 00:34:31
问题 I have a compound view mixed by some buttons on it that is attached on top-right corner of screen with RelativeLayout. I want this view to animate to right when I click on "open-close" button on it and stays there until user selects/clicks one of its buttons or clicks again on "open-close" button and then it should animate to right and become invisible. The problem is that it animates to left and then it moves back to its original place! What should I do to solve this problem? Code: public

Android TranslateAnimation animation

假装没事ソ 提交于 2020-01-07 00:34:11
问题 I have a compound view mixed by some buttons on it that is attached on top-right corner of screen with RelativeLayout. I want this view to animate to right when I click on "open-close" button on it and stays there until user selects/clicks one of its buttons or clicks again on "open-close" button and then it should animate to right and become invisible. The problem is that it animates to left and then it moves back to its original place! What should I do to solve this problem? Code: public

Image click after animation

社会主义新天地 提交于 2020-01-06 03:00:06
问题 I have this strange issue. I have an image which I rotate about a fixed point using rotateAnimation . I have handled the click event when the user clicks the images as shown below: @Override public void onClick(View v) { switch (v.getId()) { case R.id.imageView1: finish(); Intent i = new Intent(this, Next.class); startActivity(i); break; } } The problem I face is that, after I rotate the image, the click event is not triggered when I click the image, but is triggered when I click the position

LayoutTransition: 2 containers

南笙酒味 提交于 2020-01-06 02:47:08
问题 I'm trying out an official example on LayoutTransition. I've modified it in order to have 2 containers. I add new items to 1'st (top) container with animation and the 2'nd (bottom) container moves down with slide animation, as expected. But when I remove item from 1'st container, the whole 2'nd container goes beneath 1'st container, while 1'st container is shrinking height with animation (while animation is playing last element of 1'st and first element of 2'nd are intersecting). Is there any