mirror of
https://github.com/Steffo99/twom.git
synced 2024-11-25 09:34:25 +00:00
Allow customization of style
in ErrorText
and LoadingText
This commit is contained in:
parent
b7bfcb74a7
commit
6c6eaaf58e
2 changed files with 8 additions and 0 deletions
|
@ -1,10 +1,12 @@
|
||||||
package eu.steffo.twom.composables.errorhandling
|
package eu.steffo.twom.composables.errorhandling
|
||||||
|
|
||||||
|
import androidx.compose.material3.LocalTextStyle
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import eu.steffo.twom.R
|
import eu.steffo.twom.R
|
||||||
|
|
||||||
|
@ -14,10 +16,12 @@ import eu.steffo.twom.R
|
||||||
fun ErrorText(
|
fun ErrorText(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
|
style: TextStyle = LocalTextStyle.current
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
text = text ?: stringResource(R.string.error),
|
text = text ?: stringResource(R.string.error),
|
||||||
color = MaterialTheme.colorScheme.error,
|
color = MaterialTheme.colorScheme.error,
|
||||||
|
style = style,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package eu.steffo.twom.composables.errorhandling
|
package eu.steffo.twom.composables.errorhandling
|
||||||
|
|
||||||
import androidx.compose.material3.LocalContentColor
|
import androidx.compose.material3.LocalContentColor
|
||||||
|
import androidx.compose.material3.LocalTextStyle
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import eu.steffo.twom.R
|
import eu.steffo.twom.R
|
||||||
|
|
||||||
|
@ -14,10 +16,12 @@ import eu.steffo.twom.R
|
||||||
fun LoadingText(
|
fun LoadingText(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
|
style: TextStyle = LocalTextStyle.current,
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
text = text ?: stringResource(R.string.loading),
|
text = text ?: stringResource(R.string.loading),
|
||||||
color = LocalContentColor.current.copy(0.4f),
|
color = LocalContentColor.current.copy(0.4f),
|
||||||
|
style = style,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue