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
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
220
えっ!!コードを読まずに開発を!?
hananouchi
0
220
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
240
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.8k
1B+ /day規模のログを管理する技術
broadleaf
0
140
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.8k
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
110
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
650
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
860
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
190
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
Site-Speed That Sticks
csswizardry
13
1.3k
What's in a price? How to price your products and services
michaelherold
247
13k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.7k
Become a Pro
speakerdeck
PRO
31
6k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
A Modern Web Designer's Workflow
chriscoyier
698
190k
GitHub's CSS Performance
jonrohan
1033
470k
We Are The Robots
honzajavorek
0
280
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
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