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
Layouts
Search
Fabiano França
August 16, 2016
Programming
85
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Layouts
Apresentação no Android Meetup BH #04
Fabiano França
August 16, 2016
Transcript
34 slides
O que são? Como funcionam? Qual usar? Veja hoje no
meetup #04 layouts
fabiano frança Capixaba residente em Belo Horizonte Android Developer há
1 ano na CI&T
UI no Android
View Hierarchy RelativeLayout LinearLayout ImageView Button TableLayout TableRow TableRow CheckBox
CheckBox CheckBox CheckBox
View Hierarchy ViewGroup ViewGroup View view ViewGroup ViewGroup ViewGroup View
View View View
Layout
Layout Um layout é uma subclasse de ViewGroup Nem sempre
uma subclasse de um ViewGroup é considerada um layout
ViewGroup É uma view que suporta a adição de outras
views
ViewGroup Determinar o tamanho de cada view (fase de “measure”)
e posicionar as views dentro do ViewGroup (fase de “Layout”) Principais responsabilidades
ViewGroup RecyclerView Toolbar ViewPager ... É subclasse de ViewGroup, mas
não é considerado layout
atributos layout_ <?xml version= "1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width= "match_parent"
android:layout_height= "match_parent" > <TextView android:background= "@color/colorAccent" android:layout_width= "200dp" android:layout_height= "wrap_content" android:text="Hello World!" android:layout_gravity= "right" android:gravity="right"/> </FrameLayout>
Layouts mais comuns
Organiza seu filhos como uma pilha
Overdraw
RASTERIZAÇÃO
RASTERIZAÇÃO
None
None
Organiza seus filhos em um único sentido, horizontal ou vertical.
Posiciona seus filhos em relação a outros filhos ou ao
próprio layout.
TableLayout ou GridLayout
TableLayout ou GridLayout
Posiciona seus filhos em uma grade. Cada view está em
uma linha e coluna.
Qual layout escolher?
None
Fases da construção do layout Measure Layout Draw
None
None
Hierarchy Viewer
None
Não preciso de ninguém. Eu crio meus layouts...
https://goo.gl/e9uijC Draw What You See! … and clip the #e11
out of the rest. Canvas.clipRect() API e quickReject() API
https://goo.gl/e9uijC Draw What You See! … and clip the #e11
out of the rest. Canvas.clipRect() API e quickReject() API
Até a próxima... Exemplo - https://github.com/fabianofranca/layoutsamples Speaker Deck - https://speakerdeck.com/ffranca/layouts
Twitter - https://twitter.com/fabiano_franca
More Decks by Fabiano França
See All by Fabiano França
Calabash - Testes de aceitação automatizados para mobile apps
ffranca
0
160
Other Decks in Programming
See All in Programming
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
2
510
将来の標準フォーマッター?ktfmtを深堀る
t45k
0
250
AIコーディングをセッションで終わらせない: PHPライブラリ開発におけるコンテキスト承継設計
ickx
0
110
Ruby から Emacs を操作したい
phigasui
0
390
AI Augmentation Techniques with Liberty
ivargrimstad
1
560
protojson における文字化けの扱い
kazuki1023
0
460
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
230
特急いなほ as a Workflow / 20261107jaws-festa-2026-akita-lt
kasacchiful
PRO
0
110
数行の変更でDockerビルドを最大91%高速化~GitLab CIの実行基盤を社内40リポジトリに展開するまで~
picopico
2
280
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
3
220
Getting Started with Vibe Coding
miccheng
0
250
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
2
560
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Amusing Abliteration
ianozsvald
1
400
Code Reviewing Like a Champion
maltzj
529
40k
We Are The Robots
honzajavorek
0
460
How GitHub (no longer) Works
holman
316
150k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
570
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.3k
Embracing the Ebb and Flow
colly
88
5.2k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k