[Messages/Compose] Fix browsing Teacher category in dialog.

This commit is contained in:
Kuba Szczodrzyński 2020-01-02 19:28:51 +01:00
parent 2ddbc6bbac
commit f5b2c24ee3
2 changed files with 2 additions and 2 deletions

View File

@ -191,7 +191,7 @@ class MessagesComposeFragment : Fragment(), CoroutineScope {
b.recipients.chipTokenizer = SpanChipTokenizer<ChipSpan>(activity, object : ChipSpanChipCreator() { b.recipients.chipTokenizer = SpanChipTokenizer<ChipSpan>(activity, object : ChipSpanChipCreator() {
override fun createChip(context: Context, text: CharSequence, data: Any?): ChipSpan? { override fun createChip(context: Context, text: CharSequence, data: Any?): ChipSpan? {
val teacher = data as Teacher? val teacher = data as Teacher?
if (teacher!!.id in -24L..-1L) { if (teacher!!.id in -24L..0L) {
val type = (teacher.id * -1).toInt() val type = (teacher.id * -1).toInt()
val textColorPrimary = android.R.attr.textColorPrimary.resolveAttr(activity) val textColorPrimary = android.R.attr.textColorPrimary.resolveAttr(activity)

View File

@ -39,7 +39,7 @@ class MessagesComposeSuggestionAdapter(
if (teacher.image == null) if (teacher.image == null)
teacher.image = getProfileImage(48, 24, 16, 12, 1, teacher.fullName) teacher.image = getProfileImage(48, 24, 16, 12, 1, teacher.fullName)
if (teacher.id in -24L..-1L) { if (teacher.id in -24L..0L) {
name.text = Teacher.typeName(context, (teacher.id * -1).toInt()) name.text = Teacher.typeName(context, (teacher.id * -1).toInt())
type.setText(R.string.teachers_browse_category) type.setText(R.string.teachers_browse_category)
image.setImageBitmap(null) image.setImageBitmap(null)