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
160
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
82
BADG: Kotlin DSL Workshop
firezenk
0
91
Creating Kotlin DSLs on Android
firezenk
3
170
Kotlin for dummies
firezenk
0
350
Clean Architecture at Mr.Milu
firezenk
0
190
KISS my SOLID
firezenk
0
99
Design patterns I
firezenk
0
97
Charla motivación Ing. Informática
firezenk
0
110
Other Decks in Programming
See All in Programming
Fluid Templating in TYPO3 14
s2b
0
120
CSC307 Lecture 04
javiergs
PRO
0
650
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
570
Apache Iceberg V3 and migration to V3
tomtanaka
0
130
GISエンジニアから見たLINKSデータ
nokonoko1203
0
200
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
CSC307 Lecture 07
javiergs
PRO
0
530
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
530
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
200
ThorVG Viewer In VS Code
nors
0
760
MUSUBIXとは
nahisaho
0
120
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
The Cult of Friendly URLs
andyhume
79
6.8k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The Limits of Empathy - UXLibs8
cassininazir
1
210
HDC tutorial
michielstock
1
340
Mind Mapping
helmedeiros
PRO
0
71
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
100k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
240
A better future with KSS
kneath
240
18k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
130
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
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