use right context to be day/night theme aware

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-06-09 14:07:50 +02:00
parent 94e466598e
commit 43bf2ca7ae
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B

View File

@ -108,12 +108,10 @@ class GeocodingController(args: Bundle) : BaseController(args), SearchView.OnQue
Configuration.getInstance().load(context, PreferenceManager.getDefaultSharedPreferences(context))
query = args.getString(BundleKeys.KEY_GEOCODING_QUERY)
roomToken = args.getString(BundleKeys.KEY_ROOM_TOKEN)
initAdapter(geocodingResults)
}
private fun initAdapter(addresses: List<Address>) {
adapter = GeocodingAdapter(context!!, addresses)
adapter = GeocodingAdapter(geocodingResultListView?.context!!, addresses)
geocodingResultListView?.adapter = adapter
}
@ -123,6 +121,9 @@ class GeocodingController(args: Bundle) : BaseController(args), SearchView.OnQue
override fun onAttach(view: View) {
super.onAttach(view)
initAdapter(geocodingResults)
initGeocoder()
if (!query.isNullOrEmpty()) {
searchLocation()