move onOptionsItemSelected to BaseActivity (#2059)

* move onOptionsItemSelected to BaseActivity

* revert change in ComposeActivity
This commit is contained in:
Konrad Pozniak 2021-01-31 20:27:02 +01:00 committed by GitHub
commit 483beaa957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 13 additions and 195 deletions

View file

@ -20,7 +20,6 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.activity.viewModels
import androidx.appcompat.widget.SearchView
import com.google.android.material.tabs.TabLayoutMediator
@ -82,17 +81,7 @@ class SearchActivity : BottomSheetActivity(), HasAndroidInjector {
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
android.R.id.home -> {
onBackPressed()
return true
}
}
return super.onOptionsItemSelected(item)
}
private fun getPageTitle(position: Int): CharSequence? {
private fun getPageTitle(position: Int): CharSequence {
return when (position) {
0 -> getString(R.string.title_statuses)
1 -> getString(R.string.title_accounts)