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
Youtube like BottomNavigation
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kobito-kaba
July 01, 2022
Technology
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Youtube like BottomNavigation
kobito-kaba
July 01, 2022
More Decks by kobito-kaba
See All by kobito-kaba
新規プロジェクトでやってよかったことまとめ
kobitokaba
1
910
Modularizing and Refactoring Android App with Clean Architecture
kobitokaba
0
300
Slice Your App
kobitokaba
2
1.3k
Inside Jetpack
kobitokaba
2
170
Generating and Transforming Kotlin code
kobitokaba
0
140
Conference Tourism
kobitokaba
0
290
Inside Jetpack Architecture Components
kobitokaba
0
250
Kotlinもう一歩
kobitokaba
8
17k
Inside LifecycleObserver
kobitokaba
0
140
Other Decks in Technology
See All in Technology
4人目のSREはAgent
tanimuyk
0
150
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
540
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
170
データレイクの「見えない問題」を可視化する
sansantech
PRO
1
200
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
1
1.8k
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
0
800
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
460
AI時代のコスト管理を考えよう〜明日から使える実践AWSノウハウ~
yoshimi0227
0
860
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
840
脱SaaS!FDEを支えるプロビジョニングと分離設計
knih
0
300
元銀行員がAIだけでアプリを量産!「バイブコーディング実演セミナー 」
tatsuya1970
0
110
徹底討論!ECS vs EKS!
daitak
3
1.7k
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
240
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Context Engineering - Making Every Token Count
addyosmani
9
980
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
260
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
180
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
210
The Curse of the Amulet
leimatthew05
2
13k
Statistics for Hackers
jakevdp
799
230k
Speed Design
sergeychernyshev
33
1.9k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
360
Transcript
Hiroyuki Mori @moridroid BottomNavigationView for humankind
↓This
making a new app
making a new app - multi-module project
making a new app - multi-module project - Jetpack Navigation
making a new app - multi-module project - Jetpack Navigation
- BottomNavigationView
making a new app - multi-module project - Jetpack Navigation
- BottomNavigationView →
making a new app - multi-module project - Jetpack Navigation
- BottomNavigationView →
No support for Multiple Backstack
https://bit.ly/3wXjGLy
Click
None
Click
None
Click QUIZ: When the Home menu is clicked, which screen
is displayed? 1. Welcome 2. About
None
disappear go down
No!
Behavior Changed support multiple backstack from Fragment 1.4.0-alpha01 NavigationUI 2.4.0-alpha01
Just update dependencies
This isn’t nice
Click
Click
Click
None
This isn’t nice
This isn’t nice
QUIZ: If you click the back key, which screen is
displayed? 1. Welcome 2. About Click
QUIZ: If you click the back key, which screen is
displayed? 1. Welcome 2. About Click ?
QUIZ: If you click the back key, which screen is
displayed? 1. Welcome 2. About Click ✕
None
Click
None
How Multiple backstack works
Backstack SavedState
Backstack SavedState Click
Backstack SavedState menu A Save Backstack SavedState Click
Backstack SavedState menu A Click
Backstack SavedState menu B menu A Restore Save Click
Backstack SavedState menu A menu B ← When the back
key is pressed ← Can’t decide which should be restored
Backstack SavedState menu A menu B ← New Instance Backstack
SavedState menu A menu B
Backstack SavedState menu A menu B menu A menu B
Click
menu B menu A Backstack SavedState menu B Backstack SavedState
graph A1 B1 C1 D1 B2 B3 C2 C3 D2
D3 C4 C5
graph A1 B1 C1 D1 B2 B3 C2 C3 D2
D3 C4 C5
graph A1 B1 C1 D1 B2 B3 C2 C3 D2
D3 C4 C5
graph A1 B1 C1 D1 B2 B3 C2 C3 D2
D3 C4 C5
graph A1 B1 C1 D1 B2 B3 C2 C3 D2
D3 C4 C5
graph A1 B1 C1 D1 B2 B3 C2 C3 D2
D3 C4 C5
What the ideal Bottom Navigation should be
None
None
C1
C1 C2
C1 C2 C3
C1 C2 C3 D1 Click menu D
C1 C2 C3 D1 D2 Click menu D
C1 C2 C3 D1 D2 Click menu D Click menu
C
C1 C2 C3 D1 D2 Click menu D Click menu
C Then, the back key will navigate… ① ② ③ ④ ⑤ ⑥ C3 C3 C2 D2 D1 C3 C2 C1 C1 D2 D1 ⑥ ⑤ ④ ③ ② ① ② ③ ① ⑤ ④
How to implement Backstack management
https://bit.ly/3zdDxrn
First of all: Reorderable Stack
class NavStack @Inject constructor(){ data class NavRecord(val screenId: Int, val
menuId: Int) private val selectedMenu = MutableStateFlow(R.id.none) fun push(screenId: Int, menuId: Int) { ... } fun pop(): NavRecord? { ... } fun peekAt(index: Int) : NavRecord? { ... } val size: Int get() { … } fun findByMenuId(menuId: Int): List<NavRecord> { ... } fun moveToTop(menuId: Int) { ... } fun removeAll(menuId: Int) { ... } }
• Navigate • Switch menu • Go Back
Navigate Switch menu Go Back if (currentMenuId == nextMenuId) {
stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments) } else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) }
Navigate case 1: within the same menu if (currentMenuId ==
nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments) } else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) }
if (currentMenuId == nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments)
} else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) } Navigate case 2: across menus
Navigate case 1: within the same menu if (currentMenuId ==
nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments) } else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) }
Navigate case 1: within the same menu if (currentMenuId ==
nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments) } else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) }
Navigate case 1: within the same menu if (currentMenuId ==
nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments) } else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) } fragmentManager.commit { setReorderingAllowed(true) replace(requireNotNull(containerId), clazz.newInstance().apply { arguments = args }) addToBackStack(menuId.toString()) }
Navigate case 1: within the same menu if (currentMenuId ==
nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments) } else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) } fragmentManager.commit { setReorderingAllowed(true) replace(requireNotNull(containerId), clazz.newInstance().apply { arguments = args }) addToBackStack(menuId.toString()) }
if (currentMenuId == nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments)
} else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) } Navigate case 2: across menus
if (currentMenuId == nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments)
} else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) } Navigate case 2: across menus
if (currentMenuId == nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments)
} else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) } Navigate case 2: across menus
if (currentMenuId == nextMenuId) { stack.push(screenId, currentMenuId) fragmentManager.replace(currentMenuId, nextScreen.clazz, arguments)
} else { stack.moveToTop(nextMenuId) stack.push(screenId, nextMenuId) fragmentManager.saveBackStack(currentMenuId.toString()) fragmentManager.restoreBackStack(nextMenuId.toString()) fragmentManager.replace(nextMenuId, nextScreen.clazz, arguments) } Navigate case 2: across menus
Navigate Switch menu Go Back when { currentMenu.menuId == nextMenu.menuId
-> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 1: re-select menu when { currentMenu.menuId ==
nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 2: has no records when { currentMenu.menuId
== nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 3: click the same menu when {
currentMenu.menuId == nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 1: re-select menu when { currentMenu.menuId ==
nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 1: re-select menu when { currentMenu.menuId ==
nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 1: re-select menu when { currentMenu.menuId ==
nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 2: has no records when { currentMenu.menuId
== nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 2: has no records when { currentMenu.menuId
== nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 2: has no records when { currentMenu.menuId
== nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 3: click the same menu when {
currentMenu.menuId == nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 3: click the same menu when {
currentMenu.menuId == nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Switch Menu case 3: click the same menu when {
currentMenu.menuId == nextMenu.menuId -> { stack.removeAll(currentMenu.menuId) stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.clearBackStack(nextMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } stack.findByMenuId(nextMenu.menuId).isEmpty() -> { stack.push(startScreen.screenId, nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.replace(nextMenu.menuId, startScreen.clazz) } else -> { stack.moveToTop(nextMenu.menuId) fragmentManager.saveBackStack(currentMenu.menuId.toString()) fragmentManager.restoreBackStack(nextMenu.menuId.toString()) } }
Navigate Switch menu Go Back when { destRecord == null
&& currentMenuId == graph.startMenuId -> { activity.finish() } destRecord == null -> { stack.push(startScreen.screenId, graph.startMenuId) fragmentManager.replace(graph.startMenuId, startScreen.clazz) } destRecord.menuId == currentMenuId -> { stack.pop() fragmentManager.popBackStack() } else -> { stack.pop() fragmentManager.popBackStack() fragmentManager.restoreBackStack(destRecord.menuId.toString()) } }
Go Back case 1: can’t back at default menu when
{ destRecord == null && currentMenuId == graph.startMenuId -> { activity.finish() } destRecord == null -> { stack.push(startScreen.screenId, graph.startMenuId) fragmentManager.replace(graph.startMenuId, startScreen.clazz) } destRecord.menuId == currentMenuId -> { stack.pop() fragmentManager.popBackStack() } else -> { stack.pop() fragmentManager.popBackStack() fragmentManager.restoreBackStack(destRecord.menuId.toString()) } }
Go Back case 2: can’t back at not default menu
when { destRecord == null && currentMenuId == graph.startMenuId -> { activity.finish() } destRecord == null -> { stack.push(startScreen.screenId, graph.startMenuId) fragmentManager.replace(graph.startMenuId, startScreen.clazz) } destRecord.menuId == currentMenuId -> { stack.pop() fragmentManager.popBackStack() } else -> { stack.pop() fragmentManager.popBackStack() fragmentManager.restoreBackStack(destRecord.menuId.toString()) } }
Go Back case 3: navigate back inside the same menu
when { destRecord == null && currentMenuId == graph.startMenuId -> { activity.finish() } destRecord == null -> { stack.push(startScreen.screenId, graph.startMenuId) fragmentManager.replace(graph.startMenuId, startScreen.clazz) } destRecord.menuId == currentMenuId -> { stack.pop() fragmentManager.popBackStack() } else -> { stack.pop() fragmentManager.popBackStack() fragmentManager.restoreBackStack(destRecord.menuId.toString()) } }
Go Back case 4: navigate back across menus when {
destRecord == null && currentMenuId == graph.startMenuId -> { activity.finish() } destRecord == null -> { stack.push(startScreen.screenId, graph.startMenuId) fragmentManager.replace(graph.startMenuId, startScreen.clazz) } destRecord.menuId == currentMenuId -> { stack.pop() fragmentManager.popBackStack() } else -> { stack.pop() fragmentManager.popBackStack() fragmentManager.restoreBackStack(destRecord.menuId.toString()) } }
in Summary: - Fragment supports Multiple Backstack - BottomNavigationView works
weirdly - You can make it by yourself - I don’t want to make it
in Summary: - Fragment supports Multiple Backstack - BottomNavigationView works
weirdly - You can make it by yourself - I don’t want to make it
in Summary: - Fragment supports Multiple Backstack - BottomNavigationView works
weirdly - You can make it by yourself - I don’t want to make it
in Summary: - Fragment supports Multiple Backstack - BottomNavigationView works
weirdly - You can make it by yourself - I don’t want to make it
in Summary: - Fragment supports Multiple Backstack - BottomNavigationView works
weirdly - You can make it by yourself - I don’t want to make it
Hiroyuki Mori @moridroid Thank you