mirror of
https://github.com/YTVanced/VancedManager
synced 2024-12-03 16:27:25 +00:00
improve installation preferences UI
This commit is contained in:
parent
4717c8da4a
commit
ea8b359e9e
4 changed files with 20 additions and 10 deletions
|
@ -1,5 +1,6 @@
|
||||||
package com.vanced.manager.ui.component.layout
|
package com.vanced.manager.ui.component.layout
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.LazyListScope
|
import androidx.compose.foundation.lazy.LazyListScope
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
@ -8,10 +9,12 @@ import androidx.compose.ui.Modifier
|
||||||
@Composable
|
@Composable
|
||||||
fun ManagerLazyColumn(
|
fun ManagerLazyColumn(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
contentPadding: PaddingValues = PaddingValues(),
|
||||||
content: LazyListScope.() -> Unit
|
content: LazyListScope.() -> Unit
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
|
contentPadding = contentPadding,
|
||||||
content = content
|
content = content
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
import com.vanced.manager.R
|
import com.vanced.manager.R
|
||||||
import com.vanced.manager.domain.model.InstallationOption
|
import com.vanced.manager.domain.model.InstallationOption
|
||||||
import com.vanced.manager.ui.component.card.ManagerTonalCard
|
import com.vanced.manager.ui.component.card.ManagerTonalCard
|
||||||
|
@ -102,7 +103,13 @@ fun InstallPreferencesScreen(
|
||||||
text = managerString(installationOption.itemTitleId),
|
text = managerString(installationOption.itemTitleId),
|
||||||
textStyle = MaterialTheme.typography.titleLarge,
|
textStyle = MaterialTheme.typography.titleLarge,
|
||||||
)
|
)
|
||||||
ManagerLazyColumn {
|
ManagerLazyColumn(
|
||||||
|
contentPadding = PaddingValues(
|
||||||
|
start = 4.dp,
|
||||||
|
end = 4.dp,
|
||||||
|
bottom = DefaultContentPaddingVertical
|
||||||
|
)
|
||||||
|
) {
|
||||||
when (installationOption) {
|
when (installationOption) {
|
||||||
is InstallationOption.MultiSelect -> {
|
is InstallationOption.MultiSelect -> {
|
||||||
items(installationOption.items) { item ->
|
items(installationOption.items) { item ->
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package com.vanced.manager.ui.widget.list
|
package com.vanced.manager.ui.widget.list
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import com.vanced.manager.ui.component.color.managerTextColor
|
import com.vanced.manager.ui.component.color.managerTextColor
|
||||||
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
||||||
import com.vanced.manager.ui.component.modifier.managerClickable
|
import com.vanced.manager.ui.component.modifier.managerClickable
|
||||||
|
import com.vanced.manager.ui.component.text.ManagerText
|
||||||
import com.vanced.manager.ui.widget.checkbox.ManagerAnimatedCheckbox
|
import com.vanced.manager.ui.widget.checkbox.ManagerAnimatedCheckbox
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -24,10 +24,10 @@ fun CheckboxItem(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.managerClickable(onClick = toggle),
|
.managerClickable(onClick = toggle),
|
||||||
title = {
|
title = {
|
||||||
Text(
|
ManagerText(
|
||||||
text = text,
|
text = text,
|
||||||
color = managerTextColor(),
|
color = managerTextColor(),
|
||||||
fontSize = 18.sp
|
textStyle = MaterialTheme.typography.titleSmall
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
trailing = {
|
trailing = {
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package com.vanced.manager.ui.widget.list
|
package com.vanced.manager.ui.widget.list
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import com.vanced.manager.ui.component.color.managerTextColor
|
import com.vanced.manager.ui.component.color.managerTextColor
|
||||||
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
import com.vanced.manager.ui.component.list.ManagerSelectableListItem
|
||||||
import com.vanced.manager.ui.component.modifier.managerClickable
|
import com.vanced.manager.ui.component.modifier.managerClickable
|
||||||
|
import com.vanced.manager.ui.component.text.ManagerText
|
||||||
import com.vanced.manager.ui.widget.radiobutton.ManagerAnimatedRadiobutton
|
import com.vanced.manager.ui.widget.radiobutton.ManagerAnimatedRadiobutton
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -21,13 +21,13 @@ fun <T> RadiobuttonItem(
|
||||||
) {
|
) {
|
||||||
val onClick = { onSelect(tag) }
|
val onClick = { onSelect(tag) }
|
||||||
ManagerSelectableListItem(
|
ManagerSelectableListItem(
|
||||||
modifier = Modifier
|
modifier = modifier
|
||||||
.managerClickable(onClick = onClick),
|
.managerClickable(onClick = onClick),
|
||||||
title = {
|
title = {
|
||||||
Text(
|
ManagerText(
|
||||||
text = text,
|
text = text,
|
||||||
color = managerTextColor(),
|
color = managerTextColor(),
|
||||||
fontSize = 18.sp
|
textStyle = MaterialTheme.typography.titleSmall
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
trailing = {
|
trailing = {
|
||||||
|
|
Loading…
Reference in a new issue