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
140
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
65
BADG: Kotlin DSL Workshop
firezenk
0
72
Creating Kotlin DSLs on Android
firezenk
3
170
Kotlin for dummies
firezenk
0
330
Clean Architecture at Mr.Milu
firezenk
0
180
KISS my SOLID
firezenk
0
77
Design patterns I
firezenk
0
79
Charla motivación Ing. Informática
firezenk
0
84
Other Decks in Programming
See All in Programming
Benchmark
sysong
0
280
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
0
250
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
230
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
130
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
20
3.8k
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
1.5k
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
2
320
Create a website using Spatial Web
akkeylab
0
310
XP, Testing and ninja testing
m_seki
3
220
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
100
Featured
See All Featured
Balancing Empowerment & Direction
lara
1
390
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Building Applications with DynamoDB
mza
95
6.5k
Side Projects
sachag
455
42k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Bash Introduction
62gerente
614
210k
Typedesign – Prime Four
hannesfritz
42
2.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Thoughts on Productivity
jonyablonski
69
4.7k
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