Updated on 2026-08-14

This commit is contained in:
Tangem 2024-06-06 15:26:51 +04:00
parent 0e29df4ce9
commit 199b7d3743
27 changed files with 774 additions and 135 deletions

View file

@ -0,0 +1,13 @@
package com.tangem.core.ui
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.ui.Modifier
@Stable
fun interface ComposableContentProvider {
@Composable
@Suppress("TopLevelComposableFunctions") // TODO: Remove this check
fun Content(modifier: Modifier)
}

View file

@ -11,6 +11,8 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.buildAnnotatedString
import org.intellij.markdown.MarkdownElementTypes
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
/**
* Utility class for creating text as [String] or [StringRes].
@ -197,6 +199,16 @@ operator fun TextReference.plus(ref: TextReference): TextReference {
}
}
@Suppress("NOTHING_TO_INLINE")
@OptIn(ExperimentalContracts::class)
inline fun TextReference?.isNullOrEmpty(): Boolean {
contract {
returns(false) implies (this@isNullOrEmpty != null)
}
return this == null || this == TextReference.EMPTY
}
@Composable
private fun formatAnnotated(rawString: String): AnnotatedString {
val markdownDescriptor = rememberMarkdownParser()