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
理論と実務のギャップを超える
eycjur
0
170
Webサーバーサイド言語としてのRustについて
kouyuume
1
4.2k
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
150
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
270
Six and a half ridiculous things to do with Quarkus
hollycummins
0
210
CSC305 Lecture 10
javiergs
PRO
0
220
チームの境界をブチ抜いていけ
tokai235
0
210
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.1k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
2
670
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
160
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
2
170
AkarengaLT vol.38
hashimoto_kei
1
110
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.7k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Git: the NoSQL Database
bkeepers
PRO
431
66k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Designing Experiences People Love
moore
142
24k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Mobile First: as difficult as doing things right
swwweet
225
10k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
930
KATA
mclloyd
PRO
32
15k
Building Applications with DynamoDB
mza
96
6.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