Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- sealed class Section
- object Home : Section()
- object Settings : Section()
- ...
- private fun changeSection(section: Section) {
- if (currentSection == section) {
- return // nothing to do
- }
- currentSection = section
- when (section) {
- is Home -> supportFragmentManager.switchFragmentTo("HOME") { HomeFragment() }
- is Settings -> supportFragmentManager.switchFragmentTo("SETTINGS") { SettingsFragment() }
- }
- }
- ...
Add Comment
Please, Sign In to add comment