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
ConcatAdapterを深掘る
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Takahiro Shimokawa
August 12, 2021
Programming
490
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
2.9k
Android Studio 4.1推しポイント!
androhi
0
1.5k
一人開発でつまづいたときの処方箋
androhi
0
410
Androidの物理ベースアニメーション
androhi
1
680
ConstraintLayout再入門
androhi
2
3.6k
Firebase Analytics 使用感
androhi
0
930
Support Library v23.2 overview
androhi
0
770
Support Library 総復習
androhi
2
2.6k
(続)エンジニアのためのSketch3入門
androhi
1
3k
Other Decks in Programming
See All in Programming
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
200
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
170
The NotImplementedError Problem in Ruby
koic
1
1.1k
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
610
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
290
Webフレームワークの ベンチマークについて
yusukebe
0
190
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.6k
Vite+ Unified Toolchain for the Web
naokihaba
0
420
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
230
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
630
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
570
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
190
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
210
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
230
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
660
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Producing Creativity
orderedlist
PRO
348
40k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
Technical Leadership for Architectural Decision Making
baasie
3
430
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
340
GitHub's CSS Performance
jonrohan
1033
470k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
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
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠