Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RecyclerView
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Javernaut
December 11, 2014
Programming
96
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RecyclerView
Javernaut
December 11, 2014
More Decks by Javernaut
See All by Javernaut
What the Flutter?
javernaut
0
30
Other Decks in Programming
See All in Programming
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
140
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
250
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
AI Augmentation Techniques with Liberty
ivargrimstad
1
320
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
160
Crash Auto Pipelines
veronikapj
1
340
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
150
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
690
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
160
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
140
AmebaブログはKMPから卒業します
kmars0605
0
310
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
400
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
300
Paper Plane
katiecoart
PRO
5
54k
Crafting Experiences
bethany
1
420
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
360
The Language of Interfaces
destraynor
162
27k
HDC tutorial
michielstock
2
1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.4k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
920
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
350
Transcript
RecyclerView
Agenda • Example • Basics • Not so «Basics» •
More info and links
Example is there ->
Basics • Gradle dependency: com.android.support:recyclerview-v7:21.+ • RecyclerView LayoutManager Adapter
It’s over 8000 Lines in RecyclerView.java
RecyclerView • Extends ViewGroup (not AdapterView!) • Main job -
to recycle child views (Recycler)
RecyclerView • Delegates view constructing to Adapter • Delegates layout
logic to LayoutManager • Delegates item animations and decorations
Adapter • Constructs Views from model • With RecyclerView forces
ViewHolder pattern • Should attach click logic since there is no onItemClickListener
Adapter • onCreateViewHolder • onBindViewHolder • getItemCount Abstract methods
Adapter notifyDataSetChanged Data set changes method
Adapter • notifyItemChanged • notifyItemInserted • notifyItemRemoved • notifyItemMoved Data
set changes methods • notifyItemRangeChanged • notifyItemRangeInserted • notifyItemRangeRemoved
Adapter • Item types • Item ids • Observers for
data changes Other stuff
AdapterDataObserver • onChanged • onItemRangeChanged • onItemRangeInserted • onItemRangeMoved •
onItemRangeRemoved Class
LayoutManager • Item positioning • Scrolling handling • State persisting
LayoutManager Out of the box: Linear… StaggeredGrid… Grid… 2k 2k
+ 0.5k 2.5k
CustomLayoutManager • Headache • Consider subclassing existing one • Use
guides from Links section and existed LM sources
CustomLayoutManager • onLayoutChildren Item measuring and positioning • measureChild •
measureChildWithMargins • layoutDecorated
CustomLayoutManager • canScrollHorizontally • canScrollVertically • scrollHorizontallyBy • scrollVerticallyBy Scrolling
with finger • offsetChildrenHorizontal • offsetChildrenVertical
CustomLayoutManager • scrollToPosition • smoothScrollToPosition Scrolling by code
CustomLayoutManager Scrollbars • computeHorizontalScrollExtent • computeHorizontalScrollOffset • computeHorizontalScrollRange • computeVerticalScrollExtent
• computeVerticalScrollOffset • computeVerticalScrollRange
Visual effects • animateAdd • animateChange • animateMove • animateRemove
ItemAnimator ItemDecoration • getItemOffsets • onDraw • onDrawOver
Other stuff • SmoothScroller (LinearSmoothScroller) • RecycledViewPool • OrientationHelper •
OnItemTouchListener
Conclusion • Should we start using RV? - Yes •
Released • Out of box animations, ViewHolder, several LayoutManagers • Dividers absence solves with ItemDecoration
Conclusion • Should we use only RV? - No •
Doesn’t have ViewPager’s behavior • SwipeToDismiss, Adapter cycling and other 3rd party features should be implemented manually
Links • RecyclerView Samples • Dave Smith's blog • TwoWayView
Zbaziba for your attention