-
public final class MessageOriginalTranslationsStoreA store for managing the visibility of original translations of messages.
This store keeps track of which messages have their original text translations shown or hidden. It provides methods to toggle, show, hide, and check the visibility of original text translations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMessageOriginalTranslationsStore.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<Set<String>>originalTextMessageIds
-
Method Summary
Modifier and Type Method Description final StateFlow<Set<String>>getOriginalTextMessageIds()final BooleanshouldShowOriginalText(String messageId)Checks if the original text translation for a given message ID should be shown. final UnitshowOriginalText(String messageId)Shows the original text for a given translated message ID. final UnithideOriginalText(String messageId)Hides the original text and shows the auto-translated text for a given message ID. final UnittoggleOriginalText(String messageId)Toggles the visibility of the original text translation for a given message ID. final Unitclear()Clears all stored original text message IDs, effectively hiding all original texts. -
-
Method Detail
-
getOriginalTextMessageIds
final StateFlow<Set<String>> getOriginalTextMessageIds()
-
shouldShowOriginalText
final Boolean shouldShowOriginalText(String messageId)
Checks if the original text translation for a given message ID should be shown.
- Parameters:
messageId- The ID of the message to check.
-
showOriginalText
final Unit showOriginalText(String messageId)
Shows the original text for a given translated message ID.
- Parameters:
messageId- The ID of the message for which to show the original text translation.
-
hideOriginalText
final Unit hideOriginalText(String messageId)
Hides the original text and shows the auto-translated text for a given message ID.
- Parameters:
messageId- The ID of the message for which to hide the original text translation.
-
toggleOriginalText
final Unit toggleOriginalText(String messageId)
Toggles the visibility of the original text translation for a given message ID. If the original text is currently shown, it will be hidden, and vice versa.
- Parameters:
messageId- The ID of the message for which to toggle the original text translation visibility.
-
-
-
-