🚀 Smaller icons for Placeholders
* Smaller icons for ErrorPlaceholder and EmptyPlaceholder * Renamed IsEmpty, Is Error → EmptyPlaceholder, ErrorPlaceholder
This commit is contained in:
parent
3f0e9a512c
commit
b1100d5923
2 changed files with 13 additions and 12 deletions
|
|
@ -1,4 +1,4 @@
|
|||
package ua.acclorite.book_story.presentation.core.components.is_messages
|
||||
package ua.acclorite.book_story.presentation.core.components.placeholder
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
|
|
@ -22,7 +22,7 @@ import androidx.compose.ui.unit.dp
|
|||
|
||||
|
||||
/**
|
||||
* Is Empty message. It usually placed when the list is empty.
|
||||
* Empty placeholder. It usually is placed when the list is empty.
|
||||
*
|
||||
* @param modifier Modifier to be applied.
|
||||
* @param message The message.
|
||||
|
|
@ -31,7 +31,7 @@ import androidx.compose.ui.unit.dp
|
|||
* @param action On click action.
|
||||
*/
|
||||
@Composable
|
||||
fun IsEmpty(
|
||||
fun EmptyPlaceholder(
|
||||
modifier: Modifier = Modifier,
|
||||
message: String,
|
||||
icon: Painter,
|
||||
|
|
@ -49,10 +49,10 @@ fun IsEmpty(
|
|||
Icon(
|
||||
painter = icon,
|
||||
contentDescription = message,
|
||||
modifier = Modifier.size(190.dp),
|
||||
modifier = Modifier.size(150.dp),
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = message,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
|
|
@ -60,7 +60,7 @@ fun IsEmpty(
|
|||
textAlign = TextAlign.Center
|
||||
)
|
||||
if (actionTitle != null) {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
TextButton(
|
||||
onClick = {
|
||||
action()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ua.acclorite.book_story.presentation.core.components.is_messages
|
||||
package ua.acclorite.book_story.presentation.core.components.placeholder
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
|
|
@ -21,7 +21,8 @@ import androidx.compose.ui.text.style.TextAlign
|
|||
import androidx.compose.ui.unit.dp
|
||||
|
||||
/**
|
||||
* Is Empty message. It usually placed when something went wrong and you need to display large error message.
|
||||
* Empty placeholder.
|
||||
* It usually placed when something went wrong and you need to display large error message.
|
||||
*
|
||||
* @param modifier Modifier to be applied.
|
||||
* @param errorMessage The error message.
|
||||
|
|
@ -30,7 +31,7 @@ import androidx.compose.ui.unit.dp
|
|||
* @param action On click action.
|
||||
*/
|
||||
@Composable
|
||||
fun IsError(
|
||||
fun ErrorPlaceholder(
|
||||
modifier: Modifier = Modifier,
|
||||
errorMessage: String,
|
||||
icon: Painter,
|
||||
|
|
@ -48,10 +49,10 @@ fun IsError(
|
|||
Icon(
|
||||
painter = icon,
|
||||
contentDescription = errorMessage,
|
||||
modifier = Modifier.size(140.dp),
|
||||
modifier = Modifier.size(150.dp),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = errorMessage,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
|
|
@ -59,7 +60,7 @@ fun IsError(
|
|||
textAlign = TextAlign.Center
|
||||
)
|
||||
if (actionTitle != null) {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
TextButton(
|
||||
onClick = {
|
||||
action()
|
||||
Loading…
Add table
Add a link
Reference in a new issue