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
150
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
76
BADG: Kotlin DSL Workshop
firezenk
0
83
Creating Kotlin DSLs on Android
firezenk
3
170
Kotlin for dummies
firezenk
0
340
Clean Architecture at Mr.Milu
firezenk
0
180
KISS my SOLID
firezenk
0
88
Design patterns I
firezenk
0
88
Charla motivación Ing. Informática
firezenk
0
95
Other Decks in Programming
See All in Programming
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
1
470
Flutterで分数(Fraction)を表示する方法
koukimiura
0
130
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
220
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
280
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
0
120
CSC509 Lecture 04
javiergs
PRO
0
300
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
190
Le côté obscur des IA génératives
pascallemerrer
0
150
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
230
Go Conference 2025: Goで体感するMultipath TCP ― Go 1.24 時代の MPTCP Listener を理解する
takehaya
9
1.7k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
2
510
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
910
BBQ
matthewcrist
89
9.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
600
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Done Done
chrislema
185
16k
How to Ace a Technical Interview
jacobian
280
24k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
910
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Become a Pro
speakerdeck
PRO
29
5.6k
RailsConf 2023
tenderlove
30
1.3k
Agile that works and the tools we love
rasmusluckow
331
21k
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