mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-02-19 13:00:37 +01:00
show Search on all tabs
This commit is contained in:
parent
d88ea06a35
commit
e500e02131
@ -101,8 +101,6 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu, menu)
|
||||
menu.findItem(R.id.search).isVisible = viewpager.currentItem == 0
|
||||
|
||||
setupSearch(menu)
|
||||
updateMenuItemColors(menu)
|
||||
return true
|
||||
|
@ -153,12 +153,12 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
|
||||
})
|
||||
}
|
||||
|
||||
fun onSearchClosed() {
|
||||
override fun onSearchClosed() {
|
||||
(fragment_list.adapter as? ContactsAdapter)?.updateItems(allContacts)
|
||||
setupLetterFastscroller(allContacts)
|
||||
}
|
||||
|
||||
fun onSearchQueryChanged(text: String) {
|
||||
override fun onSearchQueryChanged(text: String) {
|
||||
val contacts = allContacts.filter {
|
||||
it.name.contains(text, true) || it.doesContainPhoneNumber(text)
|
||||
}.toMutableList() as ArrayList<SimpleContact>
|
||||
|
@ -111,4 +111,12 @@ class FavoritesFragment(context: Context, attributeSet: AttributeSet) : MyViewPa
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onSearchClosed() {
|
||||
|
||||
}
|
||||
|
||||
override fun onSearchQueryChanged(text: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -34,4 +34,8 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
||||
abstract fun textColorChanged(color: Int)
|
||||
|
||||
abstract fun primaryColorChanged(color: Int)
|
||||
|
||||
abstract fun onSearchClosed()
|
||||
|
||||
abstract fun onSearchQueryChanged(text: String)
|
||||
}
|
||||
|
@ -109,4 +109,12 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSearchClosed() {
|
||||
|
||||
}
|
||||
|
||||
override fun onSearchQueryChanged(text: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user