Skip to content

Commit

Permalink
WebcalFragment: remove unused menu item code
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc2822 committed Oct 17, 2023
1 parent 58d4a9f commit d79e737
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class WebcalFragment: CollectionsFragment() {
override val noCollectionsStringId = R.string.account_no_webcals

@Inject lateinit var webcalModelFactory: WebcalModel.Factory
val webcalModel by viewModels<WebcalModel>() {
private val webcalModel by viewModels<WebcalModel> {
object : ViewModelProvider.Factory {
@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel> create(modelClass: Class<T>) =
Expand All @@ -69,21 +69,6 @@ class WebcalFragment: CollectionsFragment() {
super.onPrepareMenu(menu)
menu.findItem(R.id.create_calendar).isVisible = false
}

override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
if (super.onMenuItemSelected(menuItem)) {
return true
}

if (menuItem.itemId == R.id.create_calendar) {
val intent = Intent(requireActivity(), CreateCalendarActivity::class.java)
intent.putExtra(CreateCalendarActivity.EXTRA_ACCOUNT, accountModel.account)
startActivity(intent)
return true
}

return false
}
}

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down

0 comments on commit d79e737

Please sign in to comment.