android-motionlayout

Start motion scene programmatically

谁都会走 提交于 2020-08-01 09:29:06
问题 I have a motion layout with this layoutDescription: app:layoutDescription="@xml/scene" scene.xml <MotionScene xmlns:motion="http://schemas.android.com/apk/res-auto"> <Transition motion:constraintSetStart="@layout/view_home_card_start" motion:constraintSetEnd="@layout/view_home_card_end" motion:duration="1000"> <OnSwipe motion:touchAnchorId="@+id/button" motion:touchAnchorSide="left" motion:dragDirection="dragLeft" /> </Transition> </MotionScene> I think that the xml of view_home_card_start

How to smoothly change drawable resource during MotionLayout transition?

烈酒焚心 提交于 2020-07-07 12:26:06
问题 I want to change image in fab button during transition, but i haven't found how to do it with xml because CustomAttribute tag supports only drawable colors as values. My solution is to set TransitionAdapter to MotionLayout and change drawable in onTransitionChange function. motionLayout.setTransitionListener(object : TransitionAdapter() { var fromStart = true var wasChanged = false override fun onTransitionChange( motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float ) { if (

How to smoothly change drawable resource during MotionLayout transition?

纵饮孤独 提交于 2020-07-07 12:25:32
问题 I want to change image in fab button during transition, but i haven't found how to do it with xml because CustomAttribute tag supports only drawable colors as values. My solution is to set TransitionAdapter to MotionLayout and change drawable in onTransitionChange function. motionLayout.setTransitionListener(object : TransitionAdapter() { var fromStart = true var wasChanged = false override fun onTransitionChange( motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float ) { if (

How to smoothly change drawable resource during MotionLayout transition?

戏子无情 提交于 2020-07-07 12:24:19
问题 I want to change image in fab button during transition, but i haven't found how to do it with xml because CustomAttribute tag supports only drawable colors as values. My solution is to set TransitionAdapter to MotionLayout and change drawable in onTransitionChange function. motionLayout.setTransitionListener(object : TransitionAdapter() { var fromStart = true var wasChanged = false override fun onTransitionChange( motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float ) { if (

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

MotionLayout breaks the redrawing of (nested) subviews

僤鯓⒐⒋嵵緔 提交于 2020-04-18 05:48:04
问题 I'm having problems with views not refreshing in MotionLayout . Seems like at some point the refresh/redraw mechanism of MotionLayout becomes broken and the subviews (including the nested ones) are having random problems updating themselves on the screen. What I have experienced so far: RecyclerView is not refreshed sometimes. This happens when new data is available, I'm using Paging library to fill the data. I have fixed it with a workaround of scrolling 1 pixel when I got new data there -

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

How to resize TextView using MotionLayout

梦想的初衷 提交于 2020-03-19 06:56:50
问题 I'm trying to create a CollapsingToolbar animation using MotionLayout . I've successfully animated everything to behave just like a CollapsingToolbar with a high level of flexibility, which means I can easily create awesome animations without writing a large amount of code. My problem is no matter what I tried; I can't resize the title's TextView in a natural way. I'm currently using ConstraintLayout version 2.0.0-beta3 Trial #1 CustomAttribute of textSize <ConstraintSet android:id="@+id/dish

How to resize TextView using MotionLayout

烈酒焚心 提交于 2020-03-19 06:55:27
问题 I'm trying to create a CollapsingToolbar animation using MotionLayout . I've successfully animated everything to behave just like a CollapsingToolbar with a high level of flexibility, which means I can easily create awesome animations without writing a large amount of code. My problem is no matter what I tried; I can't resize the title's TextView in a natural way. I'm currently using ConstraintLayout version 2.0.0-beta3 Trial #1 CustomAttribute of textSize <ConstraintSet android:id="@+id/dish