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
Support Library v23.2 overview
Search
Takahiro Shimokawa
March 16, 2016
Programming
770
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Support Library v23.2 overview
shibuya.apk #6で発表した内容です
Takahiro Shimokawa
March 16, 2016
More Decks by Takahiro Shimokawa
See All by Takahiro Shimokawa
PlayStoreでの新しいユーザー訴求 -LiveOpsの活用とその成果-
androhi
0
2.9k
ConcatAdapterを深掘る
androhi
1
490
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 総復習
androhi
2
2.6k
(続)エンジニアのためのSketch3入門
androhi
1
3k
Other Decks in Programming
See All in Programming
自作OSでスライド発表する
uyuki234
1
3.7k
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
350
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
2.5k
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
200
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
250
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
650
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
180
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
430
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.8k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
340
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
450
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
370
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
890
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
How to build a perfect <img>
jonoalderson
1
5.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Unsuck your backbone
ammeep
672
58k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
410
Discover your Explorer Soul
emna__ayadi
2
1.2k
Producing Creativity
orderedlist
PRO
348
40k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
640
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Transcript
Support Library v23.2 overview @androhi 1
About me 4 Zaim Inc. 4 GitHub / Twitter /
Qiita 4 @androhi 4 DroidKaigi 2016 staff & speaker @androhi 2
Agenda 4 v23.2ͷτϐοΫ 4 RecyclerViewͷࣗಈαΠζௐػೳ @androhi 3
v23.2ͷτϐοΫ 1. VectorDrawableͷαϙʔτ 4 Ξχϝʔγϣϯ͖Ұ෦੍ݶ͋Γ 2. AppCompatͷDayNightςʔϚ 3. BottomSheetͷαϙʔτ 4.
ΧελϜλϒʹϘτϜόʔͷՃ 5. AndroidTVͷLeanbackڧԽ @androhi 4
VectorDrawable ͷαϙʔτ 4 VectorDrawableରԠ·ͱΊ @konifar 4 AppCompat v23.2 — Age of the
vectors @androhi 5
DayNight ςʔϚͷՃ <style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar"> ... </style> // ΞϓϦશମʹઃఆ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
// ActivityDialog୯ҐͰઃఆ AppCompatDelegate delegate = getDelegate(); delegate.setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO); @androhi 6
BottomSheet ͷαϙʔτ 4 αϙʔτϥΠϒϥϦ @yuichi_araki 4 BottomSheetBehaviorΛ͏ @napplecomputer @androhi 7
ΧελϜλϒͷϘ τϜόʔ ※ chrome v49 Ҏ্ @androhi 8
ΧελϜλϒͷϘτϜόʔ // VectorDrawableͰେৎʂ Bitmap icon1 = BitmapFactory.decodeResource(getResources(), R.drawable.ic_room_24dp); Bitmap icon2
= BitmapFactory.decodeResource(getResources(), R.drawable.ic_favorite_24dp); CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder() .setToolbarColor(getResources().getColor(R.color.colorPrimary)) .setSecondaryToolbarColor(getResources().getColor(R.color.colorPrimary)) // ՃͰ͖Δͷ4ݸ·ͰɻͦΕҎ্IllegalStateException .addToolbarItem(1, icon1, "description1", pendingIntent) .addToolbarItem(2, icon2, "description2", pendingIntent) .build(); customTabsIntent.launchUrl(this, Uri.parse("http://zaim.net")); @androhi 9
Leanback ڧԽ 4 GuidedStepFragment ͷେ෯ͳվળ 4 ࠓճࢼͤ·ͤΜͰͨ͠... @androhi 10
RecyclerViewͷ ࣗಈαΠζௐػೳ @androhi 11
WRAP_CONTENT ͷ༗ޮԽ RecyclerView ΛίϯςϯπͷαΠζʹԠͯ͡α ΠζมߋͰ͖ΔΑ͏ʹͳΓ·͢ɻͭ·ΓɺҎલ Ͱ͖ͳ͔ͬͨ RecyclerView ͷੇ๏ʹ WRAP_CONTENT Λ༻͢Δ͜ͱ͕Ͱ͖ΔΑ͏
ʹͳ͍ͬͯ·͢ɻ — Google Developers Japan @androhi 12
activity.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ff0000"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/recycler_view" android:background="#00ff00" android:text="Test"/> </RelativeLayout> @androhi 13
list_item.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/list_text"
android:layout_width="match_parent" android:layout_height="wrap_content"/> </RelativeLayout> @androhi 14
@androhi 15
@androhi 16
͜͠Μͳ list_item.xml ͩͬͨ Β... <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"> <TextView android:id="@+id/list_text" android:layout_width="match_parent" android:layout_height="wrap_content"/> </RelativeLayout> @androhi 17
@androhi 18
v23.1 -> v23.2 ͷΞοϓσʔτ RecyclerView ͷ༻Օॴཁҙ @androhi 19
LayoutManager ͷมߋ ϏϧτΠϯͷ LayoutManager ΛܧঝͤͣɺΧε λϜͷ LayoutManager Λ༻͍ͯ͠Δ߹ɺ͜ ΕΦϓτΠϯ API
ʹͳΓ·͢ɻ setAutoMeasureEnabled(true) Λݺͼग़͠ɺ ϝιουͷ Javadoc ʹৄ͘͠هࡌ͞Ε͍ͯΔͱ ͓Γɺࡉ͔ͳมߋΛՃ͑Δඞཁ͕͋Γ·͢ɻ — Google Developers Japan @androhi 20
LayoutManager#setAutoMeasureEn abled(boolean) ϨΠΞτͷଌఆ( onMeasure )Λɺ RecyclerView ͕ߦ͏( =true )ͷ͔ LayoutManager
͕ߦ͏( =false )ͷ͔Λఆٛ͢ Δϝιουɻ -> RecyclerView ͕ଌఆ͢Δ߹ɺࢠͷཁૉ͔ ΒαΠζΛࣗಈܭࢉ͢Δɻ @androhi 21
v23.1 ͷ LinearLayoutManager // Constructor public LinearLayoutManager(Context context, int orientation,
boolean reverseLayout) { setOrientation(orientation); setReverseLayout(reverseLayout); } @androhi 22
v23.2 ͷ LinearLayoutManager public LinearLayoutManager(Context context, int orientation, boolean reverseLayout)
{ setOrientation(orientation); setReverseLayout(reverseLayout); setAutoMeasureEnabled(true); } @androhi 23
LayoutManager ΛΧελϜͯ͠Δ ͳΒ onMeasure Λ override ͍ͯ͠Δ߹ɺΧε λϜ LayoutMnagerͷதͰ setAutoMeasureEnabled(false)
ΛݺͿɻ @androhi 24
·ͱΊ 4 VectorDrawable αϙʔτ࠷ߴ 4 RecyclerView ཁҙ @androhi 25