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

main.com.sceyt.chatuikit.providers.defaults.DefaultUserAvatarProvider.kt Maven / Gradle / Ivy

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

import android.content.Context
import com.sceyt.chat.models.user.UserState
import com.sceyt.chatuikit.R
import com.sceyt.chatuikit.data.models.messages.SceytUser
import com.sceyt.chatuikit.presentation.custom_views.AvatarView
import com.sceyt.chatuikit.presentation.custom_views.toDefaultAvatar
import com.sceyt.chatuikit.providers.VisualProvider

data object DefaultUserAvatarProvider : VisualProvider {
    override fun provide(context: Context, from: SceytUser): AvatarView.DefaultAvatar {
        return (when (from.state) {
            UserState.Active -> R.drawable.sceyt_ic_default_avatar
            UserState.Inactive -> R.drawable.sceyt_ic_default_avatar
            UserState.Deleted -> R.drawable.sceyt_ic_deleted_user
        }).toDefaultAvatar()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy