Skip to content

String annotations ignored #78

@Rares23

Description

@Rares23

Hello there! I want to mention an issue that I encounter when using strings with annotations in compose, for example:
<string name="string_name">Hello <annotation clickable="learnMore" color="primary" style="body">World</annotation></string>.

The phrase setup is done properly, and the theme is wrapped in Phrase composable.

MainClass:

Phrase.setup(
            this,
            BuildConfig.PHRASE_DISTRIBUTION_ID,
            BuildConfig.PHRASE_ENV_TOKEN,
            getPreferredLang(this).code
        )
        Phrase.updateTranslations()

the issue is here
val spannableString = context.getText(stringRes) as? SpannedString

If I disable Phrase this works fine. When enabled, this returns null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions