making some views nullable

This commit is contained in:
tibbi 2018-02-26 17:17:04 +01:00
parent ff3de208b9
commit c33906a874

View File

@ -196,13 +196,13 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
MenuItemCompat.setOnActionExpandListener(searchMenuItem, object : MenuItemCompat.OnActionExpandListener { MenuItemCompat.setOnActionExpandListener(searchMenuItem, object : MenuItemCompat.OnActionExpandListener {
override fun onMenuItemActionExpand(item: MenuItem?): Boolean { override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
getCurrentFragment().onSearchOpened() getCurrentFragment()?.onSearchOpened()
isSearchOpen = true isSearchOpen = true
return true return true
} }
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean { override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
getCurrentFragment().onSearchClosed() getCurrentFragment()?.onSearchClosed()
isSearchOpen = false isSearchOpen = false
return true return true
} }
@ -291,15 +291,15 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
private fun showSortingDialog() { private fun showSortingDialog() {
ChangeSortingDialog(this) { ChangeSortingDialog(this) {
contacts_fragment.initContacts() contacts_fragment?.initContacts()
favorites_fragment.initContacts() favorites_fragment?.initContacts()
} }
} }
fun showFilterDialog() { fun showFilterDialog() {
FilterContactSourcesDialog(this) { FilterContactSourcesDialog(this) {
contacts_fragment.forceListRedraw = true contacts_fragment?.forceListRedraw = true
contacts_fragment.initContacts() contacts_fragment?.initContacts()
} }
} }