You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am trying to define a customsuggestionadapter using the method MaterialSearchBar.setCustomSuggestionAdapter searchBar.setCustomSuggestionAdapter(suggestionsAdapter)
I am trying to implement my own callbacklisteners for the custom suggestion adapter which implements com.mancj.materialsearchbar.adapter.SuggestionsAdapter
I managed to get it working using the following code. Still not quite sure why, if anyone could explain that would be very helpful.
suggestionsAdapter = DefaultSuggestionsAdapter(LayoutInflater.from(context)) if (suggestionsAdapter is DefaultSuggestionsAdapter) (suggestionsAdapter as DefaultSuggestionsAdapter).setListener(object : SuggestionsAdapter.OnItemViewClickListener{})
Hello,
I am trying to define a customsuggestionadapter using the method MaterialSearchBar.setCustomSuggestionAdapter
searchBar.setCustomSuggestionAdapter(suggestionsAdapter)
I am trying to implement my own callbacklisteners for the custom suggestion adapter which implements com.mancj.materialsearchbar.adapter.SuggestionsAdapter
suggestionsAdapter = DefaultSuggestionsAdapter(LayoutInflater.from(context)) .setListener(object: SuggestionsAdapter.OnItemViewClickListener{ override fun OnItemClickListener(position: Int, v: View?) { TODO("Not yet implemented") } override fun OnItemDeleteListener(position: Int, v: View?) { TODO("Not yet implemented") } })
When I do this however I get an error saying Type mismatch: inferred type is Unit but SuggestionsAdapter<*, *>? was expected
I'm somewhat new to Android programming, so I suspect I'm missing something simple. What could be a good way to fix this?
The text was updated successfully, but these errors were encountered: