Last active
March 7, 2018 13:00
-
-
Save jakubkinst/bfe760a96104aa23021f05d449088991 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface MainView { | |
fun showSnackbar(message: String) | |
fun openSomeScreen() | |
} | |
class MainActivity : AppCompatActivity(), MainView { | |
val vmb by vmb<MainViewModel, ActivityMainBinding>(R.layout.activity_main) | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
// access viewModel | |
vmb.viewModel.doSomething() | |
// access layout via binding class | |
setupToolbar(vmb.binding.toolbar) | |
} | |
override fun showSnackbar(message: String) {...} | |
override fun openSomeScreen() {...} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment