refactor: clean up InstalledItemCard
This commit is contained in:
parent
0c43b3f0b6
commit
00ec8fadc9
2 changed files with 10 additions and 38 deletions
|
|
@ -13,7 +13,6 @@ import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.*
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.aliucord.manager.R
|
import com.aliucord.manager.R
|
||||||
|
|
@ -57,7 +56,11 @@ fun InstalledItemCard(
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Text(
|
Text(
|
||||||
text = "\"${data.name}\"",
|
text = if (data.name.contains(' ')) {
|
||||||
|
stringResource(R.string.installs_item_quoted_title, data.name)
|
||||||
|
} else {
|
||||||
|
data.name
|
||||||
|
},
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = .94f),
|
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = .94f),
|
||||||
)
|
)
|
||||||
|
|
@ -76,24 +79,13 @@ fun InstalledItemCard(
|
||||||
|
|
||||||
Spacer(Modifier.weight(1f, fill = true))
|
Spacer(Modifier.weight(1f, fill = true))
|
||||||
|
|
||||||
Column(
|
VersionDisplay(
|
||||||
verticalArrangement = Arrangement.spacedBy(2.dp),
|
version = data.version,
|
||||||
horizontalAlignment = Alignment.End,
|
prefix = { append("v") },
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.alpha(.6f)
|
.alpha(.6f)
|
||||||
.padding(end = 4.dp),
|
.padding(end = 4.dp),
|
||||||
) {
|
)
|
||||||
VersionDisplay(
|
|
||||||
version = data.version,
|
|
||||||
prefix = { append("v") },
|
|
||||||
)
|
|
||||||
|
|
||||||
// TODO: display install core commit version
|
|
||||||
// Text(
|
|
||||||
// text = data.commit,
|
|
||||||
// style = MaterialTheme.typography.labelLarge,
|
|
||||||
// )
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
|
|
@ -132,24 +124,3 @@ fun InstalledItemCard(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun LabelTextItem(
|
|
||||||
label: String,
|
|
||||||
value: String,
|
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = buildAnnotatedString {
|
|
||||||
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
|
|
||||||
append("• ")
|
|
||||||
append(label)
|
|
||||||
}
|
|
||||||
append(" ")
|
|
||||||
append(value)
|
|
||||||
},
|
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = .9f),
|
|
||||||
modifier = modifier,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
<string name="permissions_grant_body">In order for Aliucord Manager to function, file permissions are required. Since shared data is stored in ~/Aliucord, permissions are required in order to access it.</string>
|
<string name="permissions_grant_body">In order for Aliucord Manager to function, file permissions are required. Since shared data is stored in ~/Aliucord, permissions are required in order to access it.</string>
|
||||||
|
|
||||||
<string name="installs_no_installs">No installations found!</string>
|
<string name="installs_no_installs">No installations found!</string>
|
||||||
|
<string name="installs_item_quoted_title">\"%s\"</string>
|
||||||
<string name="launch_aliucord_fail">Failed to launch Aliucord</string>
|
<string name="launch_aliucord_fail">Failed to launch Aliucord</string>
|
||||||
|
|
||||||
<string name="settings_theme">Theme</string>
|
<string name="settings_theme">Theme</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue