mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 21:15:30 +03:00
cleanup to new base controller logic
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
73e0b4e719
commit
ac986c61aa
3 changed files with 5 additions and 17 deletions
|
@ -137,12 +137,6 @@ class GeocodingController(args: Bundle) :
|
|||
searchView?.clearFocus()
|
||||
}
|
||||
|
||||
override fun onPrepareOptionsMenu(menu: Menu) {
|
||||
super.onPrepareOptionsMenu(menu)
|
||||
showToolbar()
|
||||
actionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent)))
|
||||
}
|
||||
|
||||
override fun onQueryTextSubmit(query: String?): Boolean {
|
||||
this.query = query
|
||||
searchLocation()
|
||||
|
|
|
@ -155,11 +155,14 @@ class LocationPickerController(args: Bundle) :
|
|||
|
||||
override fun onPrepareOptionsMenu(menu: Menu) {
|
||||
super.onPrepareOptionsMenu(menu)
|
||||
showToolbar()
|
||||
actionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent)))
|
||||
actionBar?.title = context!!.getString(R.string.nc_share_location)
|
||||
}
|
||||
|
||||
override val title: String
|
||||
get() =
|
||||
resources!!.getString(R.string.nc_share_location)
|
||||
|
||||
|
||||
override fun onViewBound(view: View) {
|
||||
setLocationDescription(false, receivedChosenGeocodingResult)
|
||||
binding.shareLocation.isClickable = false
|
||||
|
|
|
@ -172,15 +172,6 @@ abstract class NewBaseController(@LayoutRes var layoutRes: Int, args: Bundle? =
|
|||
binding.searchToolbar.layoutParams = layoutParams
|
||||
}
|
||||
|
||||
protected fun showToolbar() {
|
||||
if (isValidActivity(activity)) {
|
||||
val activity = activity as MainActivity
|
||||
showToolbar(activity.binding)
|
||||
colorizeStatusBar(false, activity, resources)
|
||||
colorizeNavigationBar(activity, resources)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showToolbar(binding: ActivityMainBinding) {
|
||||
val layoutParams = binding.searchToolbar.layoutParams as AppBarLayout.LayoutParams
|
||||
binding.searchToolbar.visibility = View.GONE
|
||||
|
|
Loading…
Reference in a new issue