mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
feat: add checkboxes to the downloaded apps page
This commit is contained in:
parent
64ec73d821
commit
e70c10adbd
1 changed files with 14 additions and 5 deletions
|
@ -8,6 +8,7 @@ import androidx.compose.foundation.rememberScrollState
|
|||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Delete
|
||||
import androidx.compose.material3.Checkbox
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
|
@ -66,12 +67,20 @@ fun DownloadsSettingsScreen(
|
|||
|
||||
GroupHeader(stringResource(R.string.downloaded_apps))
|
||||
|
||||
downloadedApps.forEach {
|
||||
downloadedApps.forEach { app ->
|
||||
val selected = app in viewModel.selection
|
||||
|
||||
ListItem(
|
||||
modifier = Modifier.clickable { viewModel.toggleItem(it) },
|
||||
headlineContent = { Text(it.packageName) },
|
||||
supportingContent = { Text(it.version) },
|
||||
tonalElevation = if (viewModel.selection.contains(it)) 8.dp else 0.dp
|
||||
modifier = Modifier.clickable { viewModel.toggleItem(app) },
|
||||
headlineContent = { Text(app.packageName) },
|
||||
leadingContent = (@Composable {
|
||||
Checkbox(
|
||||
checked = selected,
|
||||
onCheckedChange = { viewModel.toggleItem(app) }
|
||||
)
|
||||
}).takeIf { viewModel.selection.isNotEmpty() },
|
||||
supportingContent = { Text(app.version) },
|
||||
tonalElevation = if (selected) 8.dp else 0.dp
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue