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
130
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
55
BADG: Kotlin DSL Workshop
firezenk
0
63
Creating Kotlin DSLs on Android
firezenk
3
160
Kotlin for dummies
firezenk
0
330
Clean Architecture at Mr.Milu
firezenk
0
170
KISS my SOLID
firezenk
0
67
Design patterns I
firezenk
0
70
Charla motivación Ing. Informática
firezenk
0
75
Other Decks in Programming
See All in Programming
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
160
我々のデザインシステムは Chakra v3 にアップデートします
shunya078
2
900
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
140
Functional Event Sourcing using Sekiban
tomohisa
0
110
Reckoner における Datadog Browser Test の活用事例 / Datadog Browser Test at Reckoner
nomadblacky
0
110
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
490
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
最新TCAキャッチアップ
0si43
0
230
「天気予報があなたに届けられるまで」 - NIFTY Tech Talk #22
niftycorp
PRO
0
110
@nifty天気予報:フルリニューアルの挑戦 - NIFTY Tech Talk #22
niftycorp
PRO
0
110
受け取る人から提供する人になるということ
little_rubyist
0
260
Better Code Design in PHP
afilina
PRO
0
130
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
It's Worth the Effort
3n
183
27k
How GitHub (no longer) Works
holman
310
140k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Optimizing for Happiness
mojombo
376
70k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Gamification - CAS2011
davidbonilla
80
5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
GraphQLとの向き合い方2022年版
quramy
43
13k
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