All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.sceyt.chatuikit.formatters.defaults.DefaultDraftMessageBodyFormatter.kt Maven / Gradle / Ivy

There is a newer version: 1.7.2
Show newest version
package com.sceyt.chatuikit.formatters.defaults

import android.content.Context
import com.sceyt.chatuikit.formatters.Formatter
import com.sceyt.chatuikit.formatters.attributes.DraftMessageBodyFormatterAttributes
import com.sceyt.chatuikit.presentation.components.channel.input.mention.MessageBodyStyleHelper

object DefaultDraftMessageBodyFormatter : Formatter {
    override fun format(context: Context, from: DraftMessageBodyFormatterAttributes): CharSequence {
        val message = from.message
        return MessageBodyStyleHelper.buildWithAttributes(
            context = context,
            body = message.body.toString(),
            mentionUsers = message.mentionUsers,
            bodyAttributes = message.bodyAttributes,
            mentionTextStyle = from.mentionTextStyle,
            mentionUserNameFormatter = from.mentionUserNameFormatter,
            mentionClickListener = from.mentionClickListener,
        )
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy