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