Anyone can help me with the correct way to change TextView's text in MotionLayout... this is what I doing.
I'm testing the MotionLayout on a Simple App...
I reach the part on the Motion tutorials about CustomAttributes
With them you can change the BackgroundColor of a View, also the textColor using customColorValue
In this case you can see it works very well changing this values in the start and end scene:
<CustomAttribute
motion:attributeName="backgroundColor"
motion:customColorValue="#004A6D" />
<CustomAttribute
motion:attributeName="textColor"
motion:customColorValue="#000000" />
Also I note that there is a customStringValue so I think I can change the TextView text to "BEFORE" -> "AFTER". But when I try to set this with CustomAttribute the app crash.
In the start scene:
<CustomAttribute
motion:attributeName="Text"
motion:customStringValue="BEFORE" />
And in the final scene:
<CustomAttribute
motion:attributeName="Text"
motion:customStringValue="AFTER" />
Outside MotionScene the textView text is TEST:
- When I set the
CustomAttributeonly for the end scene... the text change from initial value TEST to the end AFTER value... so it partially works but never return to the initial state. - This happend also when there is not initial text setted on the
TextView. It works partially.
So... anyone can help me with the correct way to change TextView's text in MotionLayout.


I test and like this