add no instances notice

This commit is contained in:
Minecon724 2024-08-05 18:34:21 +02:00
parent 907f2cd629
commit 6dabc59fc5
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
2 changed files with 32 additions and 16 deletions

View file

@ -2,6 +2,7 @@ package eu.m724.vastapp.activity.dashboard.screen
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ContextualFlowRow import androidx.compose.foundation.layout.ContextualFlowRow
import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.ExperimentalLayoutApi
@ -30,6 +31,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import eu.m724.vastapp.R import eu.m724.vastapp.R
@ -47,6 +49,7 @@ fun InstancesScreen(dashboardViewModel: DashboardViewModel) {
// TODO actually get instances // TODO actually get instances
if (rentedInstances.size > 0) {
ContextualFlowRow( ContextualFlowRow(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
@ -65,6 +68,18 @@ fun InstancesScreen(dashboardViewModel: DashboardViewModel) {
}, },
) )
} }
} else {
Box(
modifier = Modifier
.fillMaxWidth()
.height(100.dp),
contentAlignment = Alignment.Center
) {
Text(
text = stringResource(id = R.string.no_instances)
)
}
}
} }
// TODO maybe move this? // TODO maybe move this?

View file

@ -31,4 +31,5 @@
<string name="termux_open_instructions">Open instructions on github.com</string> <string name="termux_open_instructions">Open instructions on github.com</string>
<string name="termux_error">An error occurred:</string> <string name="termux_error">An error occurred:</string>
<string name="webview_todo">(this will be a webview)</string> <string name="webview_todo">(this will be a webview)</string>
<string name="no_instances">You have no instances</string>
</resources> </resources>