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