forked from omni/OmniCards
fix: fixed sync needed message vertical alignment
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package ru.omni_devel.cards.presentation
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
@@ -36,29 +37,30 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("UnusedBoxWithConstraintsScope")
|
||||
@Composable
|
||||
fun App(cards: List<CardInfo>) {
|
||||
BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
|
||||
val context = LocalContext.current
|
||||
val context = LocalContext.current
|
||||
|
||||
TransformingLazyColumn(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentPadding = PaddingValues(
|
||||
top = maxHeight * 0.4f,
|
||||
bottom = maxHeight * 0.4f
|
||||
),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
if (cards.isEmpty()) {
|
||||
item {
|
||||
Box(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text("Sync with mobile APP to get started")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
|
||||
val topBottomPadding = maxHeight * 0.4f
|
||||
|
||||
if (cards.isEmpty()) {
|
||||
Box(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text("Sync with mobile APP to get started")
|
||||
}
|
||||
} else {
|
||||
TransformingLazyColumn(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentPadding = PaddingValues(
|
||||
top = topBottomPadding,
|
||||
bottom = topBottomPadding
|
||||
),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
for (card in cards) {
|
||||
item {
|
||||
Button(
|
||||
|
||||
Reference in New Issue
Block a user