Source code for the app and examples from Huyen's talk "Cool ConstraintLayout 2.0"
Each branch represents a completed step in the MotionLayout demos.
master: code before live coding demo.
01_new_features_barrier: addBarrierfor positioning image relative to title and description text.02_new_features_group: useGroupfor toggling visibility of previous barrier example code.03_new_features_percent_constraints: change view widths using percent constraints04_new_features_circular_constraints: position icons using circular constraints. Add a secondImageViewconstrained to the first using circular constraints as well.05_new_Features_placeholders: use placeholders to swap anImageViewbetween two positions. Add a secondImageViewand use placeholders to swap positions.06_motionlayout_layout_refs: switch from using a pair ofConstraintSetinstances toggled in code to using aMotionScenewhereapp:constraintSetStartandapp:constraintSetEndare the layouts we used with theConstraintSetin code.07_motionlayout_all_in_one_scene: switch to using aMotionScenewhere we define the start and end states asConstraintSettags inside of theMotionScene. Here we animate justicon_android.08_motionlayout_all_in_one_scene_complete: add<Constraint>tags that we did not animate in07_motionlayout_all_in_one_scene. Basically, we are recreating the transition from06_motionlayout_layout_refscompletely in aMotionScene.09_motionlayout_custom_attribute: use a<CustomAttribute>tag inside a<Constraint>to interpolate the color of anImageView.10_motionlayout_keyposition: add a keyframe to haveicon_cloud_02move to 100% across the parent's X-axis at key position 20.11_motionlayout_keyattribute: add a keyframe to haveicon_androidbecome red at key position 50.12_motionlayout_onclick: add transition toggle trigger for when user clicks onicon_cloud_01.13_motionlayout_imagefilterview: changeicon_androidto useImageFilterViewthat crossfades between two image drawables.14_motionlayout_seekbar: link the changes in aSeekBarto theMotionLayoutto drive the transition.
Huyen Tue Dao
Twitter | Android Dialogs | Randomly Typing