Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Google I/O '18 Extended In Daejeon Part1
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
pluulove (노현석)
August 04, 2018
Programming
1.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Google I/O '18 Extended In Daejeon Part1
pluulove (노현석)
August 04, 2018
More Decks by pluulove (노현석)
See All by pluulove (노현석)
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
320
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
620
N.E.X.T LEVEL
pluu
3
650
안드로이드 기술 이력서의 최소 조건
pluu
1
4.7k
I/O Extended Android in Korea 2024 ~ Whats new in Android development tools
pluu
0
820
Android Studio와 좀 더 친해지기
pluu
0
280
우리모두 삽질한다
pluu
0
1.5k
Re:Android Studio 설정 살펴보기 및 생산성 올리기
pluu
0
1.8k
What's new in Android development tools
pluu
1
990
Other Decks in Programming
See All in Programming
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
190
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
250
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
330
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
370
はじめてのPLATEAU
nokonoko1203
1
640
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
300
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
230
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
370
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
200
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.8k
Seven New Principles of Software Engineering
yegor256
0
470
Railsバージョンを4倍にした話
optim
0
1k
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
55
13k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
470
Site-Speed That Sticks
csswizardry
13
1.6k
How to train your dragon (web standard)
notwaldorf
96
6.9k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.4k
Designing for humans not robots
tammielis
254
26k
The Cost Of JavaScript in 2023
addyosmani
56
10k
How STYLIGHT went responsive
nonsquared
100
6.4k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
350
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Transcript
ConstraintLayout Sunflower Back to the Future Pluu Android Developer /
Yanolja
Simple Complex LinearLayout RelativeLayout FrameLayout GridLayout TableLayout
Android Layouts Simple ۨইਓ ਵ۽ ҳࢿ ਵ۽ ੋ೧ ࢿמ ޙઁо
ߊࢤ Complex ۨইਓ ࢎਊ ߂ ਬо য۰ ࣻ ӝઓ ۨইਓ ಞӝ۽ח ࠗ
Preview in I/O '16 1.0 in 2017 1.1 in 2018
2.0-alpha1 in I/O '18 ConstraintLayout
ConstraintLayout ӝ, ߣٜ۽ ޘ ঋ ۄ࠳۞ܻ API Level 9
ഐജ (99.99%) Ө ҅க ҳઑܳ ਤ೧ ࢸ҅ػ ۨইਓ Android Studio ীࢲ স оמ
Why not RelativeLayout? ConstraintLayout ؊ ъ۱ ؊ ݆ അ,
ۄ࠳۞ܻ ഋక۽ ઁҕ Android Studio UI بҳܳ ઁҕ
<RelativeLayout> <ImageView/> <ImageView/> <RelativeLayout> <TextView/> <LinearLayout> <TextView/> <RelativeLayout> <EditText/> </RelativeLayout>
</LinearLayout> <LinearLayout> <TextView/> <RelativeLayout> <EditText/> </RelativeLayout> </LinearLayout> <TextView/> </RelativeLayout> <LinearLayout> <Button/> <Button/> </LinearLayout> </RelativeLayout>
<android.suppo_.constraint.ConstraintLayout> <ImageView/> <ImageView/> <TextView/> <EditText/> <TextView/> <TextView/> <EditText/> <Bu`on/> <Bu`on/>
<TextView/> </android.suppo_.constraint.ConstraintLayout> ConstraintLayout
Feature
Connection
Button Right Left Bottom Top
Attributes Relative Positioning layout_constraintStart_toStartOf layout_constraintEnd_toEndOf layout_constraintTop_toTopOf layout_constraintBottom_toBottomOf layout_constraintBaseline_toBaselineOf layout_constraintStart_toEndOf layout_constraintEnd_toStartOf
layout_constraintTop_toBottomOf layout_constraintBottom_toTopOf
Center and Bias
Attributes Centering Positioning and Bias layout_constraintHorizontal_bias layout_constraintVertical_bias
Visibility
Visibility
Visibility (2)
Margins when Gone
android:layout_marginStart android:layout_marginEnd android:layout_marginLeft android:layout_marginTop android:layout_marginRight android:layout_marginBottom Attributes Margins layout_goneMarginStart layout_goneMarginEnd
layout_goneMarginLeft layout_goneMarginTop layout_goneMarginRight layout_goneMarginBottom Margins when Gone
<android.suppo_.constraint.ConstraintLayout> <Bu`on android:id="@+id/bu`on3" /> <TextView app:layout_constraintCircle="@id/bu`on3" app:layout_constraintCircleAngle="45" app:layout_constraintCircleRadius="140dp" /> <TextView
app:layout_constraintCircle="@id/bu`on3" app:layout_constraintCircleAngle="185" app:layout_constraintCircleRadius="80dp" /> </android.suppo_.constraint.ConstraintLayout> Circular positioning Added 1.1
Dimension A A A margin
Attributes Dimension layout_constrainedWidth="true|false" layout_constrainedHeight="true|false" layout_constraintWidth_min layout_constraintHeight_min layout_constraintWidth_max layout_constraintHeight_max Added 1.1
Attributes Percent Dimension layout_constraintWidth_default="spread|percent" layout_constraintHeight_default="spread|percent" wrap is Deprecated (WRAP_CONTENT and
layout_constrainedWidth=true) layout_constraintWidth_percent="0~1" layout_constraintHeight_percent="0~1"
<android.suppo_.constraint.ConstraintLayout> <ImageView android:layout_width="0dp" android:layout_height="0dp" android:background=“@color/colorAccent" app:layout_constraintDimensionRatio="3:2" /> </android.suppo_.constraint.ConstraintLayout> Ratio Dimension
Attributes Ratio Dimension layout_constraintDimensionRatio="width:height"
Chains
Chains HEAD
Spread Spread Inside Weighted Spread Packed A B C A
B C A B C A B C A B C Packed Chain with Bias Chain Style
Attributes Chains layout_constraintHorizontal_chainStyle ="spread|spread_inside|packed" layout_constraintVertical_chainStyle ="spread|spread_inside|packed" layout_constraintHorizontal_weight layout_constraintVertical_weight Weighted Chains
Helper Objects
Guidelines
Guideline Attributes android:orientation="vertical|horizontal" layout_constraintGuide_start="dimension" layout_constraintGuide_end="dimension" layout_constraintGuide_percent=“float"
Added 1.1 Barrier References multiple widgets as input, and creates
a virtual guideline based on the most extreme widget on the specified side
<android.suppo_.constraint.Barrier android:id="@+id/barrier" android:layout_width="wrap_content" android:layout_height="wrap_content" app:barrierDirection="end" app:constraint_referenced_ids="tv1,tv2" /> Barrier Added 1.1
Barrier Attributes barrierDirection="start|top|end|bottom" barrierAllowsGoneWidgets="true|false" constraint_referenced_ids="View IDs" Added 1.1
Added 1.1 Group
Group Attributes android:visibility="visible|invisible|gone" constraint_referenced_ids="View Ids" Added 1.1
Attribute Priority Group Visibility Ignore reference views visibility Added 1.1
Added 1.1 Placeholder A Placeholder provides a virtual object which
can position an existing object.
Placeholder Added 1.1 class MainActivity : Activity() { override fun
onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main_sta_) } fun select(v: View) { TransitionManager.beginDelayedTransition(root) placeholder.setContentId(v.id) } }
ConstraintSet
View ৬ যڌѱ Layout ೞחоܳ ܻ࠙ ConstraintLayout оח ઁডਸ ёച
ӝઓ ConstraintLayoutী ConstraintSetਸ ਊ оמ ࠂࣻ ConstraintSetਵ۽ ജ оמ Layoutਸ Үೞח Ѫ ইפ۽, Viewח Reload ೞ ঋ ConstraintSet
private val mConstraintSetNormal = ConstraintSet() private val mConstraintSetExpand by lazy(LazyThreadSafetyMode.NONE)
{ ConstraintSet().apply { load(this@MainActivity, R.layout.constraintset_expand) } } private var mShowExpandImage = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main_sta_) mConstraintSetNormal.clone(rootLayout) } fun toggleMode(v: View) { TransitionManager.beginDelayedTransition(rootLayout) mShowExpandImage = !mShowExpandImage applyConug()
super.onCreate(savedInstanceState) setContentView(R.layout.activity_main_sta_) mConstraintSetNormal.clone(rootLayout) } fun toggleMode(v: View) { TransitionManager.beginDelayedTransition(rootLayout) mShowExpandImage
= !mShowExpandImage applyConug() } private fun applyConug() { if (mShowExpandImage) { mConstraintSetExpand.applyTo(rootLayout) } else { mConstraintSetNormal.applyTo(rootLayout) } }
ConstraintSet (load or clone) TransitionManager.beginDelayedTransition (layout) ConstraintSet#applyTo(layout) Simple Flow
ConstraintSet Support ConstraintLayout and ConstraintSet support API 9 TransitionManager support
API 14
Trouble Shooting
Case 1 Title Sub Title View Required Title Sub Title
Required View ConstraintLayout ConstraintLayout
<android.suppo_.constraint.ConstraintLayout> <TextView android:id="@+id/lew" /> <TextView android:id="@+id/lew2" /> <View app:layout_constraintSta__toEndOf="@+id/barrier" />
<android.suppo_.constraint.Barrier android:id="@+id/barrier" app:barrierDirection="end" app:constraint_referenced_ids="lew,lew2" /> </android.suppo_.constraint.ConstraintLayout> Case 1
<android.suppo_.constraint.ConstraintLayout> <TextView android:id="@+id/lew" /> <TextView android:id="@+id/lew2" /> <View app:layout_constraintSta__toEndOf="@+id/barrier" />
<android.suppo_.constraint.Barrier android:id="@+id/barrier" app:barrierDirection="end" app:constraint_referenced_ids="lew,lew2" /> </android.suppo_.constraint.ConstraintLayout> Case 1
Case 2 Title Short Text ConstraintLayout Required Title Required Long
Text ConstraintLayout
Case 2 <android.suppo_.constraint.ConstraintLayout> <TextView android:id="@+id/lew" /> <TextView android:layout_width="wrap_content" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1" app:layout_constraintSta__toEndOf="@id/lew" /> </android.suppo_.constraint.ConstraintLayout>
Case 2 <android.suppo_.constraint.ConstraintLayout> <TextView android:id="@+id/lew" /> <TextView android:layout_width="wrap_content" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1" app:layout_constraintSta__toEndOf="@id/lew" /> </android.suppo_.constraint.ConstraintLayout>
Case 3 View View Required Button > View Required Button
> View ConstraintLayout ConstraintLayout
Case 3 <android.suppo_.constraint.ConstraintLayout> <TextView android:id="@+id/lew" android:layout_width="wrap_content" app:layout_constrainedWidth="true" app:layout_constraintEnd_toSta_Of="@id/barrier" app:layout_constraintSta__toSta_Of="parent" />
<ImageView android:id="@+id/lew2" android:layout_width="wrap_content" app:layout_constraintEnd_toSta_Of="@+id/right" app:layout_constraintHorizontal_bias="0" app:layout_constraintSta__toEndOf="@+id/lew" /> <Bu`on android:id="@+id/right" app:layout_constraintEnd_toEndOf="parent" /> <android.suppo_.constraint.Barrier android:id="@+id/barrier" app:barrierDirection="sta_" app:constraint_referenced_ids="lew2,right" /> </android.suppo_.constraint.ConstraintLayout>
Case 3 <android.suppo_.constraint.ConstraintLayout> <TextView android:id="@+id/lew" android:layout_width="wrap_content" app:layout_constrainedWidth="true" app:layout_constraintEnd_toSta_Of="@id/barrier" app:layout_constraintSta__toSta_Of="parent" />
<ImageView android:id="@+id/lew2" android:layout_width="wrap_content" app:layout_constraintEnd_toSta_Of="@+id/right" app:layout_constraintHorizontal_bias="0" app:layout_constraintSta__toEndOf="@+id/lew" /> <Bu`on android:id="@+id/right" app:layout_constraintEnd_toEndOf="parent" /> <android.suppo_.constraint.Barrier android:id="@+id/barrier" app:barrierDirection="sta_" app:constraint_referenced_ids="lew2,right" /> </android.suppo_.constraint.ConstraintLayout>
ConstraintLayout 2.0
MotionLayout A subclass of ConstraintLayout
MotionLayout <View>
MotionLayout <View>
MotionLayout <View> MotionScene <ConstraintSet> <ConstraintSet>
MotionLayout <View> MotionScene <ConstraintSet> <ConstraintSet> CustomAttribute CustomAttribute
MotionLayout <View> MotionScene <ConstraintSet> <ConstraintSet> CustomAttribute CustomAttribute <OnTouch>
MotionLayout <View> MotionScene <ConstraintSet> <ConstraintSet> CustomAttribute CustomAttribute <OnTouch> <Helper>
MotionLayout <View> MotionScene <ConstraintSet> <ConstraintSet> CustomAttribute CustomAttribute <OnTouch> <Helper>
begin end Keyframe
Keyframe begin end
MotionLayout <View> MotionScene <ConstraintSet> <ConstraintSet> CustomAttribute CustomAttribute <OnTouch> <KeyFrameSet> KeyAttribute
KeyPosition <Helper>
ConstraintLayout Easily create User Interface Flexible layout Flat hierarchies UI
Builder Back compatible starting from API 9 (99.99% of devices) Support library : ~160Kb
Pluu Help
[email protected]
Thank you! @pluulove / Yanolja