From 9d0401c0f6e70f250e81200e40571e1ce1453d0d Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Fri, 2 Aug 2024 17:05:48 +0200 Subject: [PATCH] add copy icon --- .../vastapp/activity/dashboard/screen/Instances.kt | 7 +++++++ .../vastapp/activity/termux/TermuxSshActivity.kt | 13 +++++++------ app/src/main/res/drawable/copy_regular.xml | 5 +++++ 3 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/copy_regular.xml diff --git a/app/src/main/java/eu/m724/vastapp/activity/dashboard/screen/Instances.kt b/app/src/main/java/eu/m724/vastapp/activity/dashboard/screen/Instances.kt index a111789..882734c 100644 --- a/app/src/main/java/eu/m724/vastapp/activity/dashboard/screen/Instances.kt +++ b/app/src/main/java/eu/m724/vastapp/activity/dashboard/screen/Instances.kt @@ -101,6 +101,13 @@ fun RentedInstanceCard( Text("ssh") Spacer(modifier = Modifier.size(4.dp)) // necessary because TODO the termux icon has padding } else { + Spacer(modifier = Modifier.size(1.dp)) // TODO make this not needed? + Icon( + modifier = Modifier.size(12.dp), + painter = painterResource(id = R.drawable.copy_regular), // TODO copy icon here + contentDescription = "Copy command" + ) + Spacer(modifier = Modifier.size(6.dp)) Text("ssh") } } diff --git a/app/src/main/java/eu/m724/vastapp/activity/termux/TermuxSshActivity.kt b/app/src/main/java/eu/m724/vastapp/activity/termux/TermuxSshActivity.kt index 5ba3e55..afea701 100644 --- a/app/src/main/java/eu/m724/vastapp/activity/termux/TermuxSshActivity.kt +++ b/app/src/main/java/eu/m724/vastapp/activity/termux/TermuxSshActivity.kt @@ -13,17 +13,17 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.outlined.Home import androidx.compose.material3.Card import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import eu.m724.vastapp.R @@ -114,12 +114,13 @@ fun SshNotInstalled(onCopyButtonClick: (String) -> Unit, onOpenTermuxButton: () Spacer(modifier = Modifier.width(8.dp)) IconButton( modifier = Modifier.size(24.dp), - onClick = { onCopyButtonClick("pkg install dropbear") } + onClick = { onCopyButtonClick("pkg install dropbear") }, ) { Icon( - modifier = Modifier.size(24.dp), - imageVector = Icons.Outlined.Home, // TODO copy icon here - contentDescription = "Copy command" + modifier = Modifier.size(20.dp), + painter = painterResource(id = R.drawable.copy_regular), + contentDescription = "Copy command", + tint = LocalTextStyle.current.color ) } } diff --git a/app/src/main/res/drawable/copy_regular.xml b/app/src/main/res/drawable/copy_regular.xml new file mode 100644 index 0000000..7a9e20d --- /dev/null +++ b/app/src/main/res/drawable/copy_regular.xml @@ -0,0 +1,5 @@ + + + + +