Fixed list header when only suggestions

This commit is contained in:
Sylvain Berfini 2023-10-06 11:45:40 +02:00
parent 797418ce1a
commit a481b5c6cd

View file

@ -52,7 +52,11 @@ class ContactsAndSuggestionsListAdapter(
override fun getHeaderViewForPosition(context: Context, position: Int): View {
val binding = StartCallSuggestionListDecorationBinding.inflate(LayoutInflater.from(context))
binding.header.text = if (position == 0) {
AppUtils.getString(R.string.history_call_start_contacts_list_title)
if (getItemViewType(0) == SUGGESTION_TYPE) {
AppUtils.getString(R.string.history_call_start_suggestions_list_title)
} else {
AppUtils.getString(R.string.history_call_start_contacts_list_title)
}
} else {
AppUtils.getString(R.string.history_call_start_suggestions_list_title)
}