android-motionlayout

Transition in MotionLayout causing TextInputLayout setError message not work in Android 9

ぃ、小莉子 提交于 2020-02-05 02:30:32
问题 I have created a sample project on github Please check it out to reproduce the problem I am facing. Project Structure: I have basic TabLayout and Viewpager in MainActivity . I also have FirstFragment and SecondFragment which are hosted by my TabLayout . Everything fairly simple and straightforward there. Look at the screenshots: Layout of MainActivity has MotionLayout as the root layout. When user moves from FirstFragment to SecondFragment , I increase the size of the CardView . My transition

How can I scale textView inside parent view with motion layout?

独自空忆成欢 提交于 2020-01-24 18:23:24
问题 I'm trying to scale a textView inside a container view. Activity uses a motion layout. I can scale the textView if I don't place it inside the container. Here is my activity layout and the motion layout description file. How can I make scaleX and scaleY work? Activity Layout <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.motion.MotionLayout xmlns:tools="http://schemas.android.com/tools" android:id="@+id/motionLayout" xmlns:android="http://schemas.android.com/apk/res

Motion Layout reset on navigating between activities

耗尽温柔 提交于 2020-01-11 14:16:12
问题 I am using motion layout in my mainactivity. It is working proplerly. However when I move to other activities and navigate back to my mainactivity sometimes the activity is reset and the layout is in its starting state.How do I keep this from happening ? Apart from this I also have another question about motion layout which I have asked here 回答1: You can add a transition listener to the motion layout & save a flag when the transition is completed. Afterwards, when the activity gets recreated,

Motion layout add constraint attribute to transition

好久不见. 提交于 2019-12-25 03:34:27
问题 I have a simple motion layout that changes from one layout to another. <?xml version="1.0" encoding="utf-8"?> <MotionScene xmlns:android="http://schemas.android.com/apk/res/android" xmlns:motion="http://schemas.android.com/apk/res-auto" xmlns:app="urn:oasis:names:tc:xliff:document:1.2"> <Transition motion:constraintSetStart="@layout/activity_new" motion:constraintSetEnd="@layout/activity_new_ii" motion:duration="1000"> </Transition> </MotionScene> Here I also want to animate a layouts aplha

MotionLayout: MotionScene OnClick overrides setOnClickListener

大憨熊 提交于 2019-12-22 18:17:41
问题 I'm just starting to play with MotionLayout . I have defined an activity layout using MotionLayout that uses a MotionScene to hide and show a view. The MotionScene transition looks like this: <Transition app:constraintSetStart="@id/collapsed" app:constraintSetEnd="@id/expanded"> <OnClick app:target="@id/nextButton" /> </Transition> Troublie is, nothing happens when I programmatically add a ClickListener to the button: nextButton.setOnClickListener { //do some stuff } This listener is

Is it possible to disable MotionLayout?

血红的双手。 提交于 2019-12-21 05:05:40
问题 I'v got a Fragment that hosts a RecyclerView within a MotionLayout . On top of the recycler view I've got a view that collapses and expands, all done in my motion scene. It is triggered by a click as well as responding to dragging the recycler view. So far this all works as intended. Now comes the crux: I'd like to hide the collapsing views completely for some states within my app. But if I set the views visibility or change its height, it still comes back into view when I drag the

How to refresh height of a Constrained View in ConstraintLayout

…衆ロ難τιáo~ 提交于 2019-12-10 21:53:41
问题 I have a ConstraintLayout in which i have a View(called Bar) and a RecyclerView Constrained to The Bottom of The Bar, The RecyclerView has it's height set to match Constraint(0dp), So if in The Android Layout Editor i move up The Bar for example, The RecyclerView height increase and is always "anchored" To The Bar, it's work, But This is Not the same behavior at runtime, when i move the Bar(with an onTouchListener), The RecyclerView height does not change at all and stay like if the Bar was

MotionLayout: MotionScene OnClick overrides setOnClickListener

我们两清 提交于 2019-12-06 13:25:52
I'm just starting to play with MotionLayout . I have defined an activity layout using MotionLayout that uses a MotionScene to hide and show a view. The MotionScene transition looks like this: <Transition app:constraintSetStart="@id/collapsed" app:constraintSetEnd="@id/expanded"> <OnClick app:target="@id/nextButton" /> </Transition> Troublie is, nothing happens when I programmatically add a ClickListener to the button: nextButton.setOnClickListener { //do some stuff } This listener is completely ignored but the transition (view expanding/collapsing) is triggered with every click. I have seen

Motion Layout reset on navigating between activities

南笙酒味 提交于 2019-12-02 07:36:22
I am using motion layout in my mainactivity. It is working proplerly. However when I move to other activities and navigate back to my mainactivity sometimes the activity is reset and the layout is in its starting state.How do I keep this from happening ? Apart from this I also have another question about motion layout which I have asked here You can add a transition listener to the motion layout & save a flag when the transition is completed. Afterwards, when the activity gets recreated, you can read that flag and use smth like: motionLayout.setState(R.id.end, ConstraintSet.WRAP_CONTENT,

Progress Bar Visibility reset after I start interacting with UI when using motion layout

大憨熊 提交于 2019-12-01 07:12:33
问题 ConstraintLayout version: 2.0.0-alpha3 So I am using MotionLayout I wanted to create something similar to this. https://blog.stylingandroid.com/motionlayout-collapsing-toolbar-part-2/ I want to achieve When the user enters activity there is ProgressBar spinning when I load data (takes some time) I want ProgressBar to hide. My problem is that when I start interacting with UI ProgressBar state is reset and is visible again What should I do to prevent progressBar to start showing after the user