Share
Embed
MotionLayout 무릎까지 담궈보기
DroidKnights 2019에서 발표한 "MotionLayout 무릎까지 담궈보기" 자료 입니다.
pluulove (노현석)
April 05, 2019
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
116 slides
-
Pluu Dev. Index. 01 Intro 02 03 04 What’s MotionLayout
MotionLayout Components MotionLayout Alpha 3 05 Future 06 Summary -
Pluu Dev. • MotionLayout җ ݅թ • MotionLayout ਵ۽ গפݫ࣌
ࢿೞӝ • MotionLayout ӝх Intro. ߊܳ ా೧ࢲ ৈ۞࠙ ਸ ࣻ ח Ѫ -
Pluu Dev. • ConstraintLayout ӝࠄ ࣗѐ • ConstraintLayout 2.0 ࣗѐ
Intro. ܖ ঋח ࠗ࠙ -
Pluu Dev. दೞӝী. motionlayout motionlayout medium motionlayout onclick motionlayout sample
motionlayout example motionlayout interpolator motionlayout customattribute motionlayout textsize MotionLayout -
Pluu Dev. MotionLayout. • ConstraintLayout 2.0 ࠗఠ ୶о • Google
I/O 2018ীࢲ ࣗѐ • ConstraintLayout ࢲ࠳ ېझ • গפݫ࣌ী ਸ ك ࢜۽ ViewGroup • XMLਸ ࢎਊೞৈ ࢶ ߑध (MotionScenes) • ICS (API 14) ഐജ API 18+ (JellyBean MR2) Pluu Dev. -
Pluu Dev. MotionLayout. Release Note Announce Google I/O ‘18 Alpha
01 June 26 2018 Alpha 02 August 9 2018 Alpha 03 December 21 2018 -
Pluu Dev. MotionLayout. Release Note Announce Google I/O ‘18 Alpha
01 June 26 2018 Alpha 02 August 9 2018 Alpha 03 December 21 2018 Alpha 04 a few weeks -
Pluu Dev. Basic Example Layout. <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.motion.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/motionLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:layoutDescription="@xml/motion_scene"> <View android:id="@+id/button" android:layout_width="64dp" android:layout_height="64dp" android:background="@color/colorAccent" /> </android.support.constraint.motion.MotionLayout> -
Pluu Dev. Basic Example Layout. <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.motion.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/motionLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:layoutDescription="@xml/motion_scene"> <View android:id="@+id/button" android:layout_width="64dp" android:layout_height="64dp" android:background="@color/colorAccent" /> </android.support.constraint.motion.MotionLayout> -
Pluu Dev. Basic Example MotionScene. <?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"> <Transition motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear"> <OnSwipe motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> <ConstraintSet android:id="@+id/start"> <Constraint -
Pluu Dev. xmlns:android="http://schemas.android.com/apk/res/android" xmlns:motion="http://schemas.android.com/apk/res-auto"> <Transition motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear"> <OnSwipe
motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp" Basic Example Pluu Dev. MotionScene. Pluu Dev. -
Pluu Dev. motion:touchAnchorSide="right" /> </Transition> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button" android:layout_width="64dp"
android:layout_height="64dp" android:layout_marginStart="8dp" motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintStart_toStartOf="parent" motion:layout_constraintTop_toTopOf="parent"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#D81B60" /> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> Basic Example 1 Pluu Dev. 2 MotionScene. -
Pluu Dev. motion:touchAnchorSide="right" /> </Transition> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button" android:layout_width="64dp"
android:layout_height="64dp" android:layout_marginStart="8dp" motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintStart_toStartOf="parent" motion:layout_constraintTop_toTopOf="parent"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#D81B60" /> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> Basic Example 1 Pluu Dev. 2 MotionScene. -
Pluu Dev. </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp"
android:layout_marginEnd="8dp" motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintEnd_toEndOf="parent" motion:layout_constraintTop_toTopOf="parent"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#9999FF" /> </Constraint> </ConstraintSet> </MotionScene> Basic Example Pluu Dev. 1 2 MotionScene. -
Pluu Dev. </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp"
android:layout_marginEnd="8dp" motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintEnd_toEndOf="parent" motion:layout_constraintTop_toTopOf="parent"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#9999FF" /> </Constraint> </ConstraintSet> </MotionScene> Basic Example Pluu Dev. 1 2 MotionScene. -
Pluu Dev. Basic Example Layout. <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.motion.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/motionLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:layoutDescription="@xml/motion_scene"> <View android:id="@+id/button" android:layout_width="64dp" android:layout_height="64dp" android:background="@color/colorAccent" /> </android.support.constraint.motion.MotionLayout> -
Pluu Dev. Basic Example Layout + Click. <View android:id="@+id/button" android:layout_width="64dp"
android:layout_height="64dp" android:background="@color/colorAccent" /> <Button android:id="@+id/run" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" android:text="Run" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> </android.support.constraint.motion.MotionLayout> -
Pluu Dev. Basic Example Layout + Click. class DemoActivity :
AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.motion) run.setOnClickListener { motionLayout.transitionToEnd() } } } -
Pluu Dev. Basic Example MotionScene + Click. xmlns:android="http://schemas.android.com/apk/res/android" xmlns:motion="http://schemas.android.com/apk/res-auto"> <Transition
motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear"> <OnSwipe motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp" Pluu Dev. -
Pluu Dev. Basic Example MotionScene + Click. xmlns:android="http://schemas.android.com/apk/res/android" xmlns:motion="http://schemas.android.com/apk/res-auto"> <Transition
motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear"> <OnClick motion:target="@id/run" /> <OnSwipe motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> <ConstraintSet android:id="@+id/start"> <Constraint Pluu Dev. -
Pluu Dev. MotionLayout Structure. MotionLayout <View> <View> <View> <View> <View>
<Helper> MotionScene StateSet State Variant ConstraintSet Constraint CustomAttribute Transition OnClick OnSwipe KeyFrameSet KeyPosition KeyAttributes CustomAttribute KeyCycle CustomAttribute KeyTimeCycle CustomAttribute KeyTrigger layout/motion.xml layout_description ="@xml/scene" xml/scene.xml -
Pluu Dev. MotionLayout MotionScene. • MotionLayout ӝמ ߹ب XML ੌ
(MotionScene)ী • ӝઓ layout ࠁ ࢶ ࣽਤܳ о MotionScene -
Pluu Dev. MotionLayout ConstraintSet. ۨইਓ ઁড ઑѤਸ ङച ConstraintSet Constraint
CustomAttribute MotionScene -
Pluu Dev. MotionLayout ConstraintSet. <MotionScene> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button" android:layout_width="64dp"
android:layout_height="64dp" android:layout_marginStart="8dp" motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintStart_toStartOf="parent" motion:layout_constraintTop_toTopOf="parent"> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp" android:layout_marginEnd="8dp" motion:layout_constraintBottom_toBottomOf="parent" -
Pluu Dev. <MotionScene> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp" android:layout_marginStart="8dp"
motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintStart_toStartOf="parent" motion:layout_constraintTop_toTopOf="parent"> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp" android:layout_marginEnd="8dp" motion:layout_constraintBottom_toBottomOf="parent" MotionLayout ConstraintSet. Pluu Dev. -
Pluu Dev. motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintStart_toStartOf="parent" motion:layout_constraintTop_toTopOf="parent"> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint
android:id="@id/button" android:layout_width="64dp" android:layout_height="64dp" android:layout_marginEnd="8dp" motion:layout_constraintBottom_toBottomOf="parent" motion:layout_constraintEnd_toEndOf="parent" motion:layout_constraintTop_toTopOf="parent"> </Constraint> </ConstraintSet> </MotionScene> MotionLayout ConstraintSet. Pluu Dev. -
Pluu Dev. ConstraintSets Interpolated Attributes. • Position, Dimensions • Visibility
& Alpha • Translation, Rotation, Scale, Elevation • Custom Attributes -
Pluu Dev. ConstraintSets Custom Attributes. • ConstraintSet ࠁܳ ܻ •
attributeী ч ਊ • Type / Setter string color integer float dimension boolean -
Pluu Dev. <MotionScene> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#D81B60"
/> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint android:id="@id/button"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#9999FF" /> </Constraint> </ConstraintSet> </MotionScene> ConstraintSets Custom Attributes. Start End -
Pluu Dev. <MotionScene> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#D81B60"
/> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint android:id="@id/button"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#9999FF" /> </Constraint> </ConstraintSet> </MotionScene> ConstraintSets Custom Attributes. Start End ConstraintSets Custom Attributes. -
Pluu Dev. MotionLayout Transitions. MotionScene • Scene Stateܳ •
constraintSetStart (ConstraintSet/layout) • constraintSetEnd • interpolator • duration • staggered (0f~1f) : ো بܳ Transition -
Pluu Dev. MotionLayout Transitions. <MotionScene> <Transition motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear">
<OnSwipe motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> </MotionScene> -
Pluu Dev. MotionLayout Transitions. <MotionScene> <Transition motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear">
<OnSwipe motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> </MotionScene> -
Pluu Dev. MotionLayout Transitions. <MotionScene> <Transition motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear">
<OnSwipe motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> </MotionScene> -
Pluu Dev. MotionLayout Transitions. <MotionScene> <Transition motion:constraintSetEnd="@+id/end" motion:constraintSetStart="@+id/start" motion:duration="1000" motion:interpolator="linear">
<OnSwipe motion:dragDirection="dragRight" motion:touchAnchorId="@id/button" motion:touchAnchorSide="right" /> </Transition> </MotionScene> MotionScene Transition OnSwipe OnClick -
Pluu Dev. MotionLayout KeyFrameSets. • ਤ ч ژח ࣘࢿ чী
ਊ • ജೞח दਸ • ࠂࣻ ConstraintSetsࠁ оߺ KeyFrameSet KeyPosition KeyAttributes CustomAttribute KeyCycle CustomAttribute KeyTimeCycle CustomAttribute KeyTrigger Transition MotionScene -
Pluu Dev. <MotionScene> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#D81B60"
/> </Constraint> </ConstraintSet> <ConstraintSet android:id="@+id/end"> <Constraint android:id="@id/button"> <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#9999FF" /> </Constraint> </ConstraintSet> </MotionScene> MotionLayout KeyPosition. -
Pluu Dev. <MotionScene> <Transition motion:constraintSetStart="@+id/start" motion:constraintSetEnd="@+id/end" motion:duration="1000" motion:interpolator="linear"> <KeyFrameSet> <KeyPosition
motion:keyPositionType="pathRelative" motion:percentY="-0.25" motion:framePosition="50" motion:target="@id/button"/> </KeyFrameSet> </Transition> <ConstraintSet android:id="@+id/start"> <Constraint android:id="@id/button"> <CustomAttribute MotionLayout KeyPosition. -
Pluu Dev. <MotionScene> <Transition> <KeyFrameSet> <KeyAttribute android:scaleX="2" android:scaleY="2" android:rotation="-45" motion:framePosition="50"
motion:target="@id/button" /> <KeyPosition motion:keyPositionType="pathRelative" motion:percentY="-0.3" motion:framePosition="50" motion:target="@id/button"/> </KeyFrameSet> </Transition> </MotionScene> MotionLayout KeyAttributes. -
Pluu Dev. • motion:transitionEasing • motion:curveFit • motion:transitionPathRotate • motion:framePosition
MotionLayout KeyAttributes. • android:visibility • android:alpha • android:elevation • android:rotation • android:rotationX • android:rotationY • android:scaleX • android:scaleY • android:translationX • android:translationY • android:translationZ -
Pluu Dev. + Custom Attributes <CustomAttribute motion:attributeName="BackgroundColor" motion:customColorValue="#9999FF" /> •
customColorValue • customColorDrawableValue • customIntegerValue • customFloatValue • customStringValue • customDimension • customBoolean MotionLayout KeyAttributes. -
Pluu Dev. MotionScene ConstraintSet Constraint CustomAttribute Transition OnClick OnSwipe KeyFrameSet
KeyPosition KeyAttributes CustomAttribute KeyCycle CustomAttribute KeyTimeCycle CustomAttribute KeyTrigger StateSet State Variant OnSwipe dragDirection touchAnchorId touchAnchorSide maxVelocity maxAcceleration moveWhenScrollAtTop CustomAttribute customColorValue customIntegerValue customFloatValue customStringValue customDimension customBoolean attributeName KeyAttribute framePosition target transitionEasing curveFit progress [view properties] Custom Attributes KeyPosition deltaRelative pathRelative parentRelative percentX percentY framePosition target transitionEasing curveFit drawPath sizePercent View KeyCycle framePosition target waveShape wavePeriod waveOffset transitionPathRotate progress [view properties] Custom Attributes -
Pluu Dev. MotionLayout. Alpha3 दрী ٮۄ ח ӝܳ percentWidth
/ percentHeight ਗ গפݫ࣌ ೯ ࢚ടী ٮۄ ߔਸ प೯ оמ Image Filter Button saturation, contr ast, warmth and crossfade. onTransitionStarted onTransitionTrigger Transition Listener KeyTime Cycle Key Position Key Trigger -
Pluu Dev. MotionLayout. Alpha3 ࢜܂ѱ XML ConstraintSet ࣻೡ ݅
• <Layout> : Layout ઁড ҙ۲ ࣘࢿ • <PropertySet> : visibility, alpha, progress • <Transform> : scale, translation, rotation, pivot, elevation • <Motion> : easing, arc motion, etc. -
Pluu Dev. MotionLayout. New XML Format for ConstraintSet <Constraint android:id="@+id/button"
android:layout_width="64dp" android:layout_height="64dp" android:layout_marginTop="100dp" motion:layout_constraintStart_toStartOf="parent" motion:layout_constraintEnd_toEndOf="parent" motion:layout_constraintTop_toTopOf="parent" android:rotation="45" /> <Constraint android:id="@+id/button"> <Transform motion:rotation="45" /> </Constraint> Before After -
Pluu Dev. KeyCycle Basic. PathRotate alpha elevation rotation rotationX rotationY
scaleX scaleY translationX translationY translationZ progress -
Pluu Dev. KeyCycles KeyCycle. <KeyCycle motion:framePosition="34" android:translationX="0dp" motion:target="@id/button" motion:waveOffset="0dp" motion:wavePeriod="2"
motion:waveShape="sin"> • Period : Wave ӝ • Offset : ࢚ ࠁч • Shape : Wave ഋ ഋక (sin, cos, …) -
Pluu Dev. Without percentWidth. <KeyFrameSet> <KeyAttribute android:alpha="0" motion:framePosition="75" motion:target="@id/recyclerview_front" />
<KeyAttribute android:alpha="0.10" motion:framePosition="90" motion:target="@id/image_clear" /> <KeyAttribute android:alpha="0.10" motion:framePosition="90" motion:target="@id/image_play" /> </KeyFrameSet> -
Pluu Dev. <KeyFrameSet> <KeyPosition motion:curveFit="linear" motion:framePosition="90" motion:percentWidth="0" motion:percentX="0" motion:target="@id/top_image" />
<KeyPosition motion:curveFit="linear" motion:framePosition="90" motion:percentWidth="0" motion:target="@id/top_image_container" /> <KeyPosition motion:curveFit="linear" motion:framePosition="90" motion:percentWidth="0" motion:target="@id/recyclerview_container" /> … </KeyFrameSet> With percentWidth. -
Pluu Dev. <KeyFrameSet> <KeyPosition motion:curveFit="linear" motion:framePosition="90" motion:percentWidth="0" motion:percentX="0" motion:target="@id/top_image" />
<KeyPosition motion:curveFit="linear" motion:framePosition="90" motion:percentWidth="0" motion:target="@id/top_image_container" /> <KeyPosition motion:curveFit="linear" motion:framePosition="90" motion:percentWidth="0" motion:target="@id/recyclerview_container" /> … </KeyFrameSet> With percentWidth. 90% ө ਤ / ևܳ ߸҃ਸ ߑ -
Pluu Dev. KeyTrigger Example. <KeyFrameSet> <KeyTrigger motion:framePosition="10" motion:onPositiveCross="show" motion:target="@id/fab"/> <KeyTrigger
motion:framePosition="20" motion:onNegativeCross="hide" motion:target="@id/fab"/> </KeyFrameSet> -
Pluu Dev. KeyTrigger Example. <KeyFrameSet> <KeyTrigger motion:framePosition="10" motion:onPositiveCross="show" motion:target="@id/fab"/> <KeyTrigger
motion:framePosition="20" motion:onNegativeCross="hide" motion:target="@id/fab"/> </KeyFrameSet> 10ࠁ ழ ҃ FloatingActionButton.show() ഐ -
Pluu Dev. KeyTrigger Example. <KeyFrameSet> <KeyTrigger motion:framePosition="10" motion:onPositiveCross="show" motion:target="@id/fab"/> <KeyTrigger
motion:framePosition="20" motion:onNegativeCross="hide" motion:target="@id/fab"/> </KeyFrameSet> 20ࠁ ই ҃ FloatingActionButton.hide() ഐ -
Pluu Dev. public class MotionLayout { ... HashMap<View, MotionController> mFrameArrayList
= new HashMap(); ... private void setupMotionViews() { if (!this.mSetup) { if (VERSION.SDK_INT < 18 || !this.isInLayout()) { ... int n = this.getChildCount(); this.mFrameArrayList.clear(); int layoutWidth; for(layoutWidth = 0; layoutWidth < n; ++layoutWidth) { View v = this.getChildAt(layoutWidth); Pluu Dev. Troubleshooting Layout Depth. -
Pluu Dev. 1. Resources ஂٙ 2. അ ఫझ ࢎૉ৬ ܲ
࠺Ү 3. TextView ղࠗ ٘ Null ܻ 4. requestLayout() ഐ 5. invalidate() ഐ Troubleshooting TextView#setTextSize(). https://android.googlesource.com/platform/frameworks/base/+/jb-mr0-release/core/java/android/widget/ TextView.java#2244 1. Resources ஂٙ 2. അ ఫझ ࢎૉ৬ ܲ ࠺Ү 3. TextView ղࠗ ٘ Null ܻ 4. requestLayout() ഐ 5. invalidate() ഐ -
Pluu Dev. Troubleshooting CollapsibleToolbar + NestedScrollView. زदী ࢎਊद, Viewо ח(?)
അ࢚ ??!! - Progressח 0~1 ࢎ۽ ஂٙ -
Pluu Dev. Troubleshooting btnChange.setOnClickListener { textView.text = buildString { for
(value in 0..Random.nextInt(10)) { append(value) } } } ۨইਓ јन ޙઁ. -
Pluu Dev. Troubleshooting ࡅܲ ۪؊݂ਸ ਤ೧ࢲ View৬ п Viewী ࢸػ
MotionControllerਸ द ೧ࢲ ࢎਊ ೧Ѿߨ) MotionLayout#setupMotionViews() ೣࣻܳ ഐ೧ MotionControllerо ୡӝചغب۾ ܻ Not Official ۨইਓ јन ޙઁ. -
Pluu Dev. MotionLayout Flow. Load Motion Scene onTouchEvent() Update Progress
Find Transition invalidate() Setup MotionViews Not Official -
Pluu Dev. MotionLayout setupMotionViews(). Cache Child Views + Controller Apply
ConstraintSet Setup Controller Controller ୡӝച ਃ android.support.constraint.motion.MotionController#setupMotionViews Not Official -
Pluu Dev. Fixed, ۨইਓ јन ޙઁ. btnChange.setOnClickListener { textView.text =
buildString { for (value in 0..Random.nextInt(10)) { append(value) } } motionLayout.setTransition(R.id.start, R.id.end) } Transition ୡӝച Not Official Troubleshooting -
Pluu Dev. Elevation ޙઁ. elevation Android 5.0ࠗఠ ୶о Samsung 4.x
ীࢲ 100% Crash ೧Ѿߨ) Samsung 4.xܳ ನӝೞח Ѫ MotionLayoutীࢲ API 21 ࠙ӝܻ X Issue Tracker > ConstraintLayout 2.0.0-alpha2 broke compatability java.lang.RuntimeException: Unable to start activity ComponentInfo{twitter.com.constraintlayoutrepro/ twitter.com.constraintlayoutrepro.MainActivity}: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x3 … Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x3 at android.content.res.TypedArray.getDimension(TypedArray.java: 399) at android.support.constraint.ConstraintSet.populateConstraint(Cons traintSet.java:2392) at android.support.constraint.ConstraintSet.fillFromAttributeList(Con straintSet.java:2191) at android.support.constraint.ConstraintSet.load(ConstraintSet.java: 2160) … Pluu Dev. Troubleshooting -
Pluu Dev. reddit We have paused the development of the
Motion Editor temporarily as we are focusing on Marble. That said, a lot of the work we put in for 3.5 will directly benefit the Motion Editor, as it shares a lot of code / infrastructure with the other design tools. https://www.reddit.com/r/androiddev/comments/av3lhx/were_on_the_engineering_team_for_android_studio/ at Feb 28 -
Pluu Dev. Future. Alpha4 • Resize handling • View visibility
• Attributes rename • RecyclerView + MotionLayout https://www.slideshare.net/hagikuratakeshi/deep-dive-into-motionlayout -
Pluu Dev. RecyclerView. • Handle Gesture • Provide a similar
view • Add view to Placeholder in MotionLayout • Recompute bounds • Run transition https://www.slideshare.net/hagikuratakeshi/deep-dive-into-motionlayout -
Pluu Dev. Handling. new PlaceholderGestureHandler( motionLayout, recyclerView, view, viewType )
gestureHandler.onTouchEvent(event) https://www.slideshare.net/hagikuratakeshi/deep-dive-into-motionlayout -
Pluu Dev. Pros. Cons. • ఠܳ ਊೠ Layout গפݫ࣌ ܻ
স դبо ծ (Start/End о ઓद) • গפݫ࣌ী ೠ ӝх!! • ই Alpha ߡ / ध ߡ ࠛైݺ • MotionLayout Editor ࠗ • Best Practices ࠗ • ࠗোझ۞ ز (CollapsibleToolbar) -
Pluu Dev. Showcase. https://twitter.com/chrisbanes/status/ 1029619278863945728 https:// proandroiddev.com/the- motion-knight- b8f84052dd17 https://github.com/faob-
dev/ MotionLayoutMenuA https://twitter.com/ riggaroo/status/ 1100360450435358721 -
Pluu Dev. • ViewGroupী ࣘೠ ध View গפݫ࣌ਸ ਊೞҊ
रਸ ٸ • ࢎਊ৬ ࢚ഐ ਊਸ ా೧ UI ਃࣗী গפݫ࣌ਸ ਊೞҊ रਸ ٸ ઁ ࢎਊೡө? -
Pluu Dev. Choice Animation. MotionLayout Complex coordinated layout? Gesture to
Animation? Physics Interruptible? Gesture to Animation? Transitions Shared element? window content? Animated Vector Drawable Vector graphic animation? View Animations Window Animation View Property Animator View Properties? Value Animator Custom animation? Object Animator General purpose property animation Get Animated (Android Dev Summit '18) -
Pluu Dev. ଵҊ. • droidcon SF 2018 - MotionLayout &
ConstraintLayout 2.0 • DroidKaigi 2019 - Deep dive into MotionLayout • Medium Articles • Introduction to MotionLayout part I • Introduction to MotionLayout part II • Introduction to MotionLayout part III • Introduction to MotionLayout part IV -
Pluu Dev. ଵҊ. • Youtube • AndroidDevSummit - Get Animated
• AndroidDevSummit - ConstraintLayout Deep Dive • droidcon SF 2018 - MotionLayout & ConstraintLayout 2.0 • droidcon NYC 2018 - Constraint-ly motion ~*~ making your app dance with With ConstraintLayout • GitHub • https://github.com/googlesamples/android-ConstraintLayoutExamples • https://github.com/Pluu/DroidKnights-2019-MotionLayout-Sample