getLastSeenText

fun User.getLastSeenText(context: Context, @StringRes userOnlineResId: Int, @StringRes userLastSeenJustNowResId: Int, @StringRes userLastSeenResId: Int): String

Returns a string describing the elapsed time since the user was online (was watching the channel).

Depending on the elapsed time, the string can have one of the following formats:

  • Online

  • Last seen just now

  • Last seen 13 hours ago

Return

A string that represents the elapsed time since the user was online.

Parameters

context

The context to load string resources.

userOnlineResId

Resource id for the online text.

userLastSeenJustNowResId

Resource id for the just now text.

userLastSeenResId

Resource id for the last seen text.