android-animation

How to animate to wrap_content?

早过忘川 提交于 2020-06-16 01:33:54
问题 Is it possible to animate using ValueAnimator to wrap_content ? this only seems to work with constant values. public static void valueAnimate(final View obj, int from, int to, Interpolator interpolator, long duration, long delay){ ValueAnimator anim = ValueAnimator.ofInt(from, to); anim.setInterpolator(interpolator == null ? DEFAULT_INTERPOLATOR : interpolator); anim.setDuration(duration); anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void

How to animate to wrap_content?

南笙酒味 提交于 2020-06-16 01:33:33
问题 Is it possible to animate using ValueAnimator to wrap_content ? this only seems to work with constant values. public static void valueAnimate(final View obj, int from, int to, Interpolator interpolator, long duration, long delay){ ValueAnimator anim = ValueAnimator.ofInt(from, to); anim.setInterpolator(interpolator == null ? DEFAULT_INTERPOLATOR : interpolator); anim.setDuration(duration); anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void

What is the difference between enterAnim & popEnterAnim & exitAnim & popExitAnim?

℡╲_俬逩灬. 提交于 2020-06-08 03:30:09
问题 What is the difference between animation tags in latest Navigation Architecture Component? I got confused with enterAnim & popEnterAnim . Similarly, exitAnim & popExitAnim . Any visual expansions is more than welcomed. 回答1: The Animate transitions between destinations documentation details the four types of animations: Entering a destination Exiting a destination Entering a destination via a pop action Exiting a destination via a pop action "Entering" refers to the destination that is coming

Motion Layout with swipe gesture + SwipeRefreshLayout + RecyclerView bug wrong behavior scrolling up

别等时光非礼了梦想. 提交于 2020-05-14 10:08:09
问题 I'm using MotionLayout to build UI with 2 parts - top one with some view and bottom one with SwipeRefresh and RecyclerView inside. Also I have a single gesture for MotionLayout - SwipeRefresh moves up above top view on swipe up. The problem is when I scroll RecyclerView to the bottom (top view "collapses") and then to the top - MotionLayout starts to reverse my transition at once ("expand") - when RecyclerView is not fully scrolled to the top instead of scrolling RecyclerView first. While my

Motion Layout with swipe gesture + SwipeRefreshLayout + RecyclerView bug wrong behavior scrolling up

纵然是瞬间 提交于 2020-05-14 10:06:53
问题 I'm using MotionLayout to build UI with 2 parts - top one with some view and bottom one with SwipeRefresh and RecyclerView inside. Also I have a single gesture for MotionLayout - SwipeRefresh moves up above top view on swipe up. The problem is when I scroll RecyclerView to the bottom (top view "collapses") and then to the top - MotionLayout starts to reverse my transition at once ("expand") - when RecyclerView is not fully scrolled to the top instead of scrolling RecyclerView first. While my

How do I define default animations for Navigation Actions?

巧了我就是萌 提交于 2020-05-09 19:26:13
问题 I'm using Android Studio 3.2 Canary 14 and The Navigation Architecture Component. With this you can define transition animations pretty much as you would when using Intents. But the animations are set as properties of the actions in the navigation graph, like so: <fragment android:id="@+id/startScreenFragment" android:name="com.example.startScreen.StartScreenFragment" android:label="fragment_start_screen" tools:layout="@layout/fragment_start_screen" > <action android:id="@+id/action

How to implement flip animation for ViewPager in Android (GIF Added)

风格不统一 提交于 2020-05-09 17:20:39
问题 Edited: Adding the XML layout of my view (How to achieve flip animation android (GIF Added)) TopLayout : ivImage BottomLayout : layoutL I want to implement Vertical ViewPager as shown in the GIF image below. Implemented Vertical ViewPager but can't implement Flip Animation Any Code snippet or Library My Customized VerticalViewPager Class Implemented Vertical ViewPager with normal animation Motionevent in VerticalPageTransformer public class VViewPager2 extends ViewPager { String TAG =

MotionLayout roundPercent only works one time

怎甘沉沦 提交于 2020-04-16 03:37:36
问题 I have an ImageFilterView view that I am animating using a MotionLayout. It starts as a small square view with roundPercent set to 1.0 (so that it is also a circle) that hides behind a circle and then animates to a full screen square. It works great the very first time it animates but every other time just stays as a rectangle. You can see a video of the issue here: VIDEO I'm not sure if it's a bug on the ImageFilterView or MotionLayout or if I'm calling something incorrectly. It's worth

RecyclerView / DiffUtils animation when dataset change without full refresh

↘锁芯ラ 提交于 2020-04-10 05:23:34
问题 I would like two things : To not reload / refresh the adapter when i delete an item inside RecyclerView (no use of notifyDatasetChanged ). To do so i am using DiffUtils which works perfectly fine. But i also would like to keep the DefaultItemAnimator of the RecyclerView which has apparently no effect with DiffUtils. So my question is : How can i remove / update an item without refreshing all the dataset AND keep a similar animation to the DefaultItemAnimator ? I know many posts gives answers

RecyclerView / DiffUtils animation when dataset change without full refresh

人盡茶涼 提交于 2020-04-10 05:23:13
问题 I would like two things : To not reload / refresh the adapter when i delete an item inside RecyclerView (no use of notifyDatasetChanged ). To do so i am using DiffUtils which works perfectly fine. But i also would like to keep the DefaultItemAnimator of the RecyclerView which has apparently no effect with DiffUtils. So my question is : How can i remove / update an item without refreshing all the dataset AND keep a similar animation to the DefaultItemAnimator ? I know many posts gives answers