feat: various ui improvements (#17)
This commit is contained in:
parent
13f1113b7f
commit
ac7182fdb0
9 changed files with 40 additions and 24 deletions
|
|
@ -19,14 +19,14 @@ class InstallService : Service() {
|
|||
startActivity(confirmationIntent)
|
||||
}
|
||||
PackageInstaller.STATUS_SUCCESS -> Toast.makeText(
|
||||
/* context = */ this,
|
||||
/* text = */ "Successfully installed Aliucord!",
|
||||
/* duration = */ Toast.LENGTH_LONG
|
||||
this,
|
||||
"Successfully installed Aliucord!",
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
PackageInstaller.STATUS_FAILURE_ABORTED -> Toast.makeText(
|
||||
/* context = */ this,
|
||||
/* text = */ "Aborted installation",
|
||||
/* duration = */ Toast.LENGTH_LONG
|
||||
this,
|
||||
"Aborted installation",
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
else -> {
|
||||
Log.i(BuildConfig.TAG, "Installation failed: error code $statusCode")
|
||||
|
|
|
|||
|
|
@ -105,28 +105,31 @@ fun PluginCard(
|
|||
Text(
|
||||
modifier = Modifier
|
||||
.heightIn(max = 150.dp, min = 40.dp)
|
||||
.padding(top = 10.dp),
|
||||
.padding(top = 10.dp, bottom = 20.dp),
|
||||
text = plugin.manifest.description,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
) {
|
||||
IconButton(
|
||||
modifier = Modifier.size(25.dp),
|
||||
onClick = {
|
||||
uriHandler.openUri(plugin.manifest.repositoryUrl)
|
||||
}
|
||||
},
|
||||
) {
|
||||
Icon(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
painter = painterResource(R.drawable.ic_account_github_white_24dp),
|
||||
contentDescription = stringResource(R.string.github)
|
||||
)
|
||||
}
|
||||
|
||||
if (plugin.manifest.changelog != null) {
|
||||
IconButton(onClick = onClickShowChangelog) {
|
||||
IconButton(modifier = Modifier.size(25.dp), onClick = onClickShowChangelog) {
|
||||
Icon(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
imageVector = Icons.Default.History,
|
||||
contentDescription = stringResource(R.string.view_plugin_changelog, plugin.manifest.name)
|
||||
)
|
||||
|
|
@ -135,8 +138,9 @@ fun PluginCard(
|
|||
|
||||
Spacer(Modifier.weight(1f, true))
|
||||
|
||||
IconButton(onClick = onClickDelete) {
|
||||
IconButton(modifier = Modifier.size(25.dp), onClick = onClickDelete) {
|
||||
Icon(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
imageVector = Icons.Default.Delete,
|
||||
contentDescription = stringResource(R.string.uninstall),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ fun AboutScreen(
|
|||
) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
MediumTopAppBar(
|
||||
TopAppBar(
|
||||
title = { Text(stringResource(R.string.about)) },
|
||||
navigationIcon = {
|
||||
IconButton(onClick = onClickBack) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.aliucord.manager.BuildConfig
|
||||
import com.aliucord.manager.R
|
||||
import com.aliucord.manager.ui.navigation.HomeDestination
|
||||
|
|
@ -28,8 +29,13 @@ fun MainRootScreen(
|
|||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
MediumTopAppBar(
|
||||
title = { Text(stringResource(mainRootNavigator.currentDestination.label)) },
|
||||
TopAppBar(
|
||||
title = {
|
||||
Text(
|
||||
stringResource(mainRootNavigator.currentDestination.label),
|
||||
modifier = Modifier.padding(horizontal = 4.dp)
|
||||
)
|
||||
},
|
||||
actions = {
|
||||
val localUriHandler = LocalUriHandler.current
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@ fun HomeScreen(
|
|||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier.padding(horizontal = 16.dp),
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 16.dp)
|
||||
.padding(top = 8.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
ElevatedCard {
|
||||
|
|
@ -187,7 +189,7 @@ fun HomeScreen(
|
|||
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalArrangement = Arrangement.spacedBy(14.dp)
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp)
|
||||
) {
|
||||
if (lazyPagingItems.loadState.refresh == LoadState.Loading) {
|
||||
item {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ fun InstallerScreen(
|
|||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
MediumTopAppBar(
|
||||
TopAppBar(
|
||||
title = { Text("Installer") },
|
||||
navigationIcon = {
|
||||
IconButton(onClick = onClickBack) {
|
||||
|
|
@ -61,18 +61,19 @@ fun InstallerScreen(
|
|||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(paddingValues)
|
||||
.padding(horizontal = 12.dp, vertical = 14.dp)
|
||||
) {
|
||||
stickyHeader {
|
||||
LinearProgressIndicator(
|
||||
modifier = Modifier.fillParentMaxWidth()
|
||||
modifier = Modifier
|
||||
.fillParentMaxWidth()
|
||||
.padding(bottom = 4.dp)
|
||||
)
|
||||
}
|
||||
|
||||
item {
|
||||
Text(
|
||||
text = viewModel.log,
|
||||
modifier = Modifier.padding(8.dp)
|
||||
modifier = Modifier.padding(horizontal = 20.dp, vertical = 6.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,8 @@ fun PluginsScreen(
|
|||
)
|
||||
|
||||
LazyColumn(
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
contentPadding = PaddingValues(bottom = 8.dp, top = 6.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
items(
|
||||
viewModel.plugins.filter { plugin ->
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ fun SettingsScreen(
|
|||
Scaffold(
|
||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||
topBar = {
|
||||
LargeTopAppBar(
|
||||
TopAppBar(
|
||||
title = { Text(stringResource(R.string.settings)) },
|
||||
navigationIcon = {
|
||||
IconButton(onClick = onClickBack) {
|
||||
|
|
@ -216,7 +216,9 @@ fun ThemeDialog(
|
|||
Column {
|
||||
Theme.values().forEach { theme ->
|
||||
Row(
|
||||
modifier = Modifier.clickable { selectedTheme = theme },
|
||||
modifier = Modifier
|
||||
.clickable { selectedTheme = theme }
|
||||
.padding(start = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<string name="clear">Clear</string>
|
||||
<string name="launch">Launch</string>
|
||||
<string name="uninstall">Uninstall</string>
|
||||
<string name="version">Version</string>
|
||||
<string name="version">Download Version</string>
|
||||
<string name="dynamic_color">Dynamic color</string>
|
||||
<string name="appearance">Appearance</string>
|
||||
<string name="advanced">Advanced</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue