Skip to content

Instantly share code, notes, and snippets.

@illuzor illuzor/WallpaperFragment.kt Secret
Last active Sep 29, 2018

Embed
What would you like to do?
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
inflater.inflate(R.menu.menu_wallpaper, menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (!loaded && item.itemId != android.R.id.home) {
toast(R.string.not_loaded_yet)
} else {
when (item.itemId) {
R.id.menu_item_set_wallpaper -> setWallpaper()
R.id.menu_item_share_image -> shareWallpaper()
R.id.menu_item_save_image -> checkPermissionForImageSave()
}
}
return super.onOptionsItemSelected(item)
}
private fun setWallpaper() {
}
private fun shareWallpaper() {
}
private fun checkPermissionForImageSave() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.