Guest User

Untitled

a guest
Jul 17th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. ...
  2.  
  3. sealed class Section
  4. object Home : Section()
  5. object Settings : Section()
  6.  
  7. ...
  8.  
  9. private fun changeSection(section: Section) {
  10. if (currentSection == section) {
  11. return // nothing to do
  12. }
  13. currentSection = section
  14. when (section) {
  15. is Home -> supportFragmentManager.switchFragmentTo("HOME") { HomeFragment() }
  16. is Settings -> supportFragmentManager.switchFragmentTo("SETTINGS") { SettingsFragment() }
  17. }
  18. }
  19.  
  20. ...
Add Comment
Please, Sign In to add comment