Improve kotlin style

This commit is contained in:
ligi 2020-02-16 18:11:27 +01:00
parent 4e62614ef9
commit 0b4aad772b
No known key found for this signature in database
GPG key ID: 8E81894010ABF23D

View file

@ -63,7 +63,7 @@ class PassViewActivity : PassViewActivityBase() {
val fragment = PassViewFragment() val fragment = PassViewFragment()
fragment.arguments = Bundle().apply { fragment.arguments = Bundle().apply {
putString(PassViewActivityBase.EXTRA_KEY_UUID, getPass(i).id) putString(EXTRA_KEY_UUID, getPass(i).id)
} }
return fragment return fragment
} }
@ -91,8 +91,8 @@ class PassViewActivity : PassViewActivityBase() {
} }
override fun onPrepareOptionsMenu(menu: Menu): Boolean { override fun onPrepareOptionsMenu(menu: Menu): Boolean {
menu.findItem(R.id.menu_map).isVisible = !currentPass.locations.isEmpty() menu.findItem(R.id.menu_map).isVisible = currentPass.locations.isNotEmpty()
menu.findItem(R.id.menu_update).isVisible = PassViewActivityBase.mightPassBeAbleToUpdate(currentPass) menu.findItem(R.id.menu_update).isVisible = mightPassBeAbleToUpdate(currentPass)
menu.findItem(R.id.install_shortcut).isVisible = ShortcutManagerCompat.isRequestPinShortcutSupported(this) menu.findItem(R.id.install_shortcut).isVisible = ShortcutManagerCompat.isRequestPinShortcutSupported(this)
return super.onPrepareOptionsMenu(menu) return super.onPrepareOptionsMenu(menu)
} }