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
TargetSdkVersion29で BottomNavigationが点滅する件
Search
yu mitsuhori
October 01, 2019
Programming
1.6k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TargetSdkVersion29で BottomNavigationが点滅する件
potatotips#65での発表資料です
yu mitsuhori
October 01, 2019
More Decks by yu mitsuhori
See All by yu mitsuhori
【DroidKaigi版】ReactNativeとKotlinで叶える夢のリアルタイム音声配信
youmitsu
1
3.2k
ReactNativeとKotlinで叶える夢のリアルタイム音声配信
youmitsu
1
920
stand.fm(Android)におけるreact-native-track-playerの改善
youmitsu
1
2.2k
リリース前のリグレッションテストをUIテストで自動化、1年間運用した話
youmitsu
2
430
New features in RemoteConfig, Analytics at Google I/O 2019
youmitsu
1
780
FirebaseNotification,RemoteConfigでユーザセグメントごとにプッシュ通知を実装する
youmitsu
8
1.6k
Report from Google I/O 2019
youmitsu
1
110
OSSにコントリビュートした話
youmitsu
1
110
初めて自作ViewのAARライブラリを公開した話
youmitsu
1
430
Other Decks in Programming
See All in Programming
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
120
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
300
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
220
Performance Engineering for Everyone
elenatanasoiu
0
270
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
260
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
840
えっ!!コードを読まずに開発を!?
hananouchi
0
180
1B+ /day規模のログを管理する技術
broadleaf
0
130
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
250
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.8k
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
270
ラッコキーワード サービス紹介資料
rakko
1
3.9M
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Utilizing Notion as your number one productivity tool
mfonobong
4
360
Music & Morning Musume
bryan
47
7.3k
Side Projects
sachag
455
43k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
460
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Accessibility Awareness
sabderemane
1
150
Code Reviewing Like a Champion
maltzj
528
40k
Navigating Team Friction
lara
192
16k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
Transcript
TargetSdkVersion29で BottomNavigationが点滅する件 養命酒(Yu Mitsuhori) potatotips #65
whoami - 三堀裕(みつほりゆう) - CCCグループ(株)Blabo 所属 - 共創マーケティングプラットフォーム 「Blabo!」のAndroid版を主に担当 -
@1013Youmeee - youmitsu - youmeee
Android 10 Released!!
Let’s migrate to API level 29(Android 10)!!
しかしBottomNavigationでissue発見... - そんなすんなり行くほど世の中甘くない。。 - 今日はそのissueについての紹介です
BottomNavigationとは - Androidにおけるいわゆる下タブ - https://material.io/components/bottom-navigation/
- コードはこちらに公開しています - https://github.com/youmitsu/BottomNavigationBugTestApp APILevel29でなぜか点滅する 選択されているMenuItemが 別タブに移る際に点滅する。。
再現条件を整理してみる - TargetSdkVersion, CompileSdkVersionは29 - material-component-android:1.1.0-alpha09を使用 - Android10の端末で再現 - Android
Pie(9)以下の端末では再現しない =>ライブラリが対応できていないことによるバグっぽい。。? - 一応他のバージョンでも試したところ1.0.0の時点から起きる
material-componentsにissueをあげてみる https://github.com/material-components/material-components-android/issues/628
すでに上がっていました。。
すでに上がっていた方を見てみる https://github.com/material-components/material-components-android/issues/530
原因判明 - どうやらBottomNavigationMenuViewのバグっぽい - プロパティで使われているTransitionSetが悪さしている? - ただ既存コードであるし、Android10にあげた途端に再現するようになるのは少し 謎。。(深追いはしません) https://github.com/material-components/material-components-android/issues/530#issu ecomment-533597823
None
対処法①~気長に待つ~ - Fixされるのを待つ - Android10はリリースされたばかりなのでご愛嬌
対処法②~リフレクションを使う~ https://github.com/material-components/material-components-android/issues/530#issu ecomment-534331153
対処法②~リフレクションを使う~ lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) ... binding = DataBindingUtil.setContentView(this, R.layout.activity_main) binding.bottomNav.fixBlinking() // 初期化時に下記の拡張関数を呼んであげれば OK } private fun BottomNavigationView.fixBlinking() { val menuView = getChildAt(0) as BottomNavigationMenuView with(menuView::class.java.getDeclaredField("set")) { isAccessible = true val transitionSet = (get(menuView) as androidx.transition.AutoTransition).apply { for (i in transitionCount downTo 0) { val transition = getTransitionAt(i) as? Fade ?: continue removeTransition(transition) } } set(menuView, transitionSet) } } リフレクションでmenuViewに アタッチされているFadeTransitionを removeする BottomNavigationMenuViewの transitionSetのプロパティを取得 TransitionSetをセットし 直す
対処法②~proguardの修正も必要~ - releaseビルド時に難読化されてしまうとリフレクション時にプロパティ名を正しく参 照できなくなる - BottomNavigationMenuViewをproguard-rulesでkeepするように記述 # 以下を追記 -keep class
com.google.android.material.bottomnavigation.BottomNavigationMenuView { *; } proguard-rules.pro
まとめ - issueを出す時はすでに起票されていないかちゃんとチェックしよう - compileSdkVersionが29では、現状material-components-androidの BottomNavigationが点滅してしまう - できれば修正されるのを待つ。 対応が待てなければリフレクションを使って、無理やり対応することになりそう (他に対処方法ご存知の方がいれば教えていただけると助かります。。)