Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fragments vs. CustomViews
Search
Jorge Garrido
January 30, 2018
Programming
2
120
Fragments vs. CustomViews
A quick talk showing the pros of use CustomViews instead Fragments to create our Android apps
Jorge Garrido
January 30, 2018
Tweet
Share
More Decks by Jorge Garrido
See All by Jorge Garrido
The Jetpack series: Pagination
firezenk
0
47
BADG: Kotlin DSL Workshop
firezenk
0
57
Creating Kotlin DSLs on Android
firezenk
3
160
Kotlin for dummies
firezenk
0
310
Clean Architecture at Mr.Milu
firezenk
0
150
KISS my SOLID
firezenk
0
56
Design patterns I
firezenk
0
59
Charla motivación Ing. Informática
firezenk
0
67
Other Decks in Programming
See All in Programming
Snowflakeで眠ったデータを起こそう!
estie
0
130
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
140
Netty Chicago Java User Group 2024-04-17
sullis
0
200
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.5k
Ruby Function Composition
bkuhlmann
1
340
Milestoner
bkuhlmann
1
410
雑に思考を整理する技術と効能
konifar
62
30k
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
860
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
1k
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
Polars入門
daikikatsuragawa
1
160
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
270
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Optimizing for Happiness
mojombo
370
69k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Atom: Resistance is Futile
akmur
260
25k
The Pragmatic Product Professional
lauravandoore
26
5.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
38
2.5k
Making the Leap to Tech Lead
cromwellryan
125
8.5k
Design by the Numbers
sachag
274
18k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
79
43k
Testing 201, or: Great Expectations
jmmastey
29
6.4k
Transcript
#BADGlightningTalks 2018 Fragments vs CustomViews yet an old but still
present war
#BADGlightningTalks 2018 Why Fragments instead of CustomViews?
#BADGlightningTalks 2018 Manual instantiation MyFragment fragment = MyFragment.newInstance(index); FragmentTransaction ft
= getFragmentManager().beginTransaction(); ft.replace(R.id.parent, fragment); ft.commit(); MyCustomView customView = new MyCustomView(context); parentView.removeAllViews(); parentView.add(customView);
#BADGlightningTalks 2018 Embedding in xml <fragment android:name="my.package.MyFragment" android:id="@+id/my_fragment" android:layout_width="match_parent" android:layout_height="match_parent"
/> <my.package.MyCustomView android:id="@+id/my_view" android:layout_width="match_parent" android:layout_height="match_parent" />
#BADGlightningTalks 2018 Lifecyrcle
#BADGlightningTalks 2018 Wait… what?
#BADGlightningTalks 2018 So you’re using fragments… because? It’s the Google’s
way
#BADGlightningTalks 2018 Really?
#BADGlightningTalks 2018 So you’re using fragments… because? The backStack
#BADGlightningTalks 2018 Create your own! Or use a router library
like: Kartographer, Cicerone, Naviganto, Mortar, there are many!
#BADGlightningTalks 2018 So you’re using fragments… because? The savedInstance
#BADGlightningTalks 2018 Use a State class (parcelable or not) and
save it using the repository pattern
#BADGlightningTalks 2018 DON’T
#BADGlightningTalks 2018 JUST Think by your own.
#BADGlightningTalks 2018 THANKS! & : @firezenk