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
ConcatAdapterを深掘る
Search
Takahiro Shimokawa
August 12, 2021
Programming
500
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ConcatAdapterを深掘る
Takahiro Shimokawa
August 12, 2021
More Decks by Takahiro Shimokawa
See All by Takahiro Shimokawa
PlayStoreでの新しいユーザー訴求 -LiveOpsの活用とその成果-
androhi
0
3k
Android Studio 4.1推しポイント!
androhi
0
1.5k
一人開発でつまづいたときの処方箋
androhi
0
430
Androidの物理ベースアニメーション
androhi
1
700
ConstraintLayout再入門
androhi
2
3.6k
Firebase Analytics 使用感
androhi
0
940
Support Library v23.2 overview
androhi
0
790
Support Library 総復習
androhi
2
2.6k
(続)エンジニアのためのSketch3入門
androhi
1
3k
Other Decks in Programming
See All in Programming
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
140
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
JRuby: Past, Present, and Future
headius
0
220
ジョジョの世界をXRで再現する
mofurune
0
140
APNsからLive Activityを開始する話
yumnumm
0
150
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
350
Domain-Driven Transformation
hschwentner
2
2.3k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5k
mrbgem 三角測量 開発
ogom
0
210
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
140
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
350
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Making the Leap to Tech Lead
cromwellryan
135
10k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
350
Discover your Explorer Soul
emna__ayadi
2
1.3k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
Optimizing for Happiness
mojombo
378
71k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
How to Ace a Technical Interview
jacobian
280
24k
Designing for humans not robots
tammielis
254
26k
The browser strikes back
jonoalderson
0
1.8k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
490
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
450
Transcript
Լܟ߂ !BOESPIJ $PODBU"EBQUFSΛਂ۷Δ QPUBUPUJQT
w Լܟ߂ w ᷂;0;0ςΫϊϩδʔζॴଐ w !BOESPIJ w ϙϦϓςϧεʢݹڕʣ ࣗݾհ
ΞδΣϯμ w $PODBU"EBQUFSͱʁ w $PODBU"EBQUFSͷϢʔεέʔε w $PODBU"EBQUFSͷׂ w 7JFX5ZQFͱ4UBCMF*%ʹ͍ͭͯ w
$PODBU"EBQUFS͕ߦ͍ͬͯΔ੍ޚ w ·ͱΊ
$PODBU"EBQUFSͱʁ l"O3FDZDMFS7JFX"EBQUFSJNQMFNFOUBUJPOUIBUQSFTFOUTUIFDPOUFOUTPGNVMUJQMFBEBQUFSTJOTFRVFODFz "OESPJE%FWFMPQFST3FGFSFODF ˞3FDZDMFS7JFXϥΠϒϥϦWFSҎ্͕ඞཁͰ͢ val headerAdapter = HeaderAdapter() val itemAdapter
= ItemAdapter() val concatAdapter = ConcatAdapter(headerAdapter, itemAdapter) binding.recyclerView.adapter = concatAdapter
$PODBU"EBQUFSͱʁ RecyclerView ConcatAdapter HeaderAdapter ItemAdapter γʔέϯγϟϧ
$PODBU"EBQUFSͱʁ RecyclerView ConcatAdapter HeaderAdapter ItemAdapter γʔέϯγϟϧ
$PODBU"EBQUFSͷϢʔεέʔε )FBEFS *UFN" *UFN# 'PPUFS *UFN# *UFN" *UFN" *UFN" *UFN#
୯Ұͷ"EBQUFS w ͍Ζ͍Ζͳ7JFX5ZQFΛఆٛ w ͍Ζ͍Ζͳ7JFX)PMEFSͷੜͱEBUBͷCJOEJOH w ෳࡶͳϦετΞΠςϜͷΧϯτ $PODBU"EBQUFS w ࢠ"EBQUFSͷ࣮࣍ୈͰ7JFX5ZQFͷఆٛෆཁ w ґଘ͢Δ7JFX)PMEFSछྨ w γϯϓϧͳϦετΞΠςϜͷΧϯτ
$PODBU"EBQUFSͷׂ w Ճ͞Εͨ"EBQUFSͰOPUJGZϝιου͕ݺΕͨΒɺ3FDZDMFS7JFXʹ͑Δ લʹP⒎TFUΛܭࢉͯ͠OPUJGZ*UFN3BOHF$IBOHFE ΛݺͿ w $PODBU"EBQUFS$POpHΫϥεΛ༻͍ͯɺ7JFX5ZQFͱ4UBCMF*%ʹؔ͢Δ "EBQUFSؒͷ੍ޚΛߦ͏
3FDZDMFS7JF͆ʹ͑ΔલʹPGGTFUΛܭࢉ͢Δ @Override public void onItemRangeChanged(@NonNull NestedAdapterWrapper nestedAdapterWrapper, int positionStart, int
itemCount) { final int offset = countItemsBefore(nestedAdapterWrapper); mConcatAdapter.notifyItemRangeChanged( positionStart + offset, itemCount ); }
7JFX5ZQFͷ੍ޚʹ͍ͭͯ w 5SVF$PODBU"EBQUFSͷ"EBQUFSؒͰ7JFX5ZQFΛڞ༗͠ͳ͍ w 'BMTFશͯͷ"EBQUFS͕ಉ͡7JFX5ZQFͳΒಉ͡7JFX)PMEFSΛࢀর͢Δ ʢ(MPCBM7JFX5ZQF1PPMΛڞ༗͢Δʣ public final boolean isolateViewTypes
4UBCMF*%ͷ੍ޚʹ͍ͭͯ w *40-"5&%@45"#-&@*%4 w શͯͷ"EBQUFS͕4UBCMF*%Λ࣋ͭ͜ͱΛڧ੍͠ɺ"EBQUFSؒͰ*%ϓʔϧΛ͢Δ w /0@45"#-&@*%4 w "EBQUFS͕4UBCMF*%ΛΒͤΔ͜ͱΛཁٻ͠ͳ͍ʢσϑΥϧτʣ w
4)"3&%@45"#-&@*%4 w શͯͷ"EBQUFS͕4UBCMF*%Λ࣋ͭ͜ͱΛڧ੍͠ɺ"EBQUFSؒͰ*%ϓʔϧΛڞ༗͢Δ public final ConcatAdapter.Config.StableIdMode stableIdMode
$PODBU"EBQUFS͕ߦ͍ͬͯΔ੍ޚ public ConcatAdapter( @NonNull Config config, @NonNull List<? extends Adapter<?
extends ViewHolder>> adapters) { mController = new ConcatAdapterController(this, config); for (Adapter<? extends ViewHolder> adapter : adapters) { addAdapter(adapter); } super.setHasStableIds(mController.hasStableIds()); } public boolean hasStableIds() { return mStableIdMode != NO_STABLE_IDS; }
$PODBU"EBQUFS͕ߦ͍ͬͯΔ੍ޚ ConcatAdapterController(ConcatAdapter concatAdapter, ConcatAdapter.Config config) { mConcatAdapter = concatAdapter; //
setup view type handling if (config.isolateViewTypes) { mViewTypeStorage = new ViewTypeStorage.IsolatedViewTypeStorage(); } else { mViewTypeStorage = new ViewTypeStorage.SharedIdRangeViewTypeStorage(); } // setup stable id handling mStableIdMode = config.stableIdMode; if (config.stableIdMode == NO_STABLE_IDS) { mStableIdStorage = new StableIdStorage.NoStableIdStorage(); } else if (config.stableIdMode == ISOLATED_STABLE_IDS) { mStableIdStorage = new StableIdStorage.IsolatedStableIdStorage(); } else if (config.stableIdMode == SHARED_STABLE_IDS) { mStableIdStorage = new StableIdStorage.SharedPoolStableIdStorage(); } else { throw new IllegalArgumentException("unknown stable id mode"); } }
͞Βʹਂງͬͨ༰ %SPJE,BJHJʹͯʁ
·ͱΊ w $PODBU"EBQUFSΛ͏͜ͱͰɺෳͷ"EBQUFSΛ3FDZDMFS7JFXʹηοτͰ ͖Δ w "EBQUFSؒͷ7JFX5ZQF4UBCMF*%ͷ੍ޚΛɺ$PODBU"EBQUFSͷ෦Ͱ͍͍ ײ͡ʹͬͯ͘ΕΔ w Ͳ͏͍͍ͬͯײ͡ʹͯ͠Δͷ͔ΛௐͯΈΔͱ໘നͦ͏
ࢀߟυΩϡϝϯτ w IUUQTNFEJVNDPNBOESPJEEFWFMPQFSTNFSHFBEBQUFSTTFRVFOUJBMMZ XJUINFSHFBEBQUFSEB w IUUQTEFWFMPQFSBOESPJEDPNSFGFSFODFBOESPJEYSFDZDMFSWJFX XJEHFU$PODBU"EBQUFS w IUUQTEFWFMPQFSBOESPJEDPNSFGFSFODFBOESPJEYSFDZDMFSWJFX XJEHFU$PODBU"EBQUFS$POpH
w IUUQTEFWFMPQFSBOESPJEDPNSFGFSFODFBOESPJEYSFDZDMFSWJFX XJEHFU$PODBU"EBQUFS$POpH4UBCMF*E.PEF
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠