installation option layout adjustments
This commit is contained in:
parent
896a32adde
commit
822778f7e9
|
@ -0,0 +1,27 @@
|
|||
package com.vanced.manager.ui.components.modifier
|
||||
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.ripple.rememberRipple
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.composed
|
||||
import androidx.compose.ui.draw.clip
|
||||
|
||||
fun Modifier.managerClickable(
|
||||
onClick: () -> Unit
|
||||
) = composed {
|
||||
val ripple = rememberRipple()
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
|
||||
return@composed then(
|
||||
clip(MaterialTheme.shapes.medium)
|
||||
).then(
|
||||
clickable(
|
||||
interactionSource = interactionSource,
|
||||
onClick = onClick,
|
||||
indication = ripple
|
||||
)
|
||||
)
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.vanced.manager.ui.components.placeholder
|
||||
package com.vanced.manager.ui.components.modifier
|
||||
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.composed
|
|
@ -10,6 +10,7 @@ import androidx.compose.runtime.CompositionLocalProvider
|
|||
import androidx.compose.ui.Modifier
|
||||
import com.vanced.manager.ui.components.color.managerAnimatedColor
|
||||
import com.vanced.manager.ui.components.list.ManagerListItem
|
||||
import com.vanced.manager.ui.components.modifier.managerClickable
|
||||
import com.vanced.manager.ui.components.text.ManagerText
|
||||
import com.vanced.manager.ui.utils.defaultContentPaddingHorizontal
|
||||
|
||||
|
@ -40,7 +41,7 @@ fun Preference(
|
|||
val color = managerAnimatedColor(color = MaterialTheme.colors.onSurface)
|
||||
ManagerListItem(
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onClick)
|
||||
.managerClickable(onClick = onClick)
|
||||
.padding(horizontal = defaultContentPaddingHorizontal),
|
||||
title = {
|
||||
CompositionLocalProvider(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.vanced.manager.ui.widgets.home.apps.card
|
||||
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.ExperimentalAnimationApi
|
||||
import androidx.compose.animation.*
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
|
@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.google.accompanist.glide.rememberGlidePainter
|
||||
import com.vanced.manager.domain.model.App
|
||||
import com.vanced.manager.ui.components.card.ManagerThemedCard
|
||||
|
@ -60,14 +61,24 @@ fun AppCard(
|
|||
if (hasInstallationOption) {
|
||||
AnimatedVisibility(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
visible = showInstallationOptions.value
|
||||
visible = showInstallationOptions.value,
|
||||
enter = expandVertically(
|
||||
animationSpec = tween(400)
|
||||
),
|
||||
exit = shrinkVertically(
|
||||
animationSpec = tween(400)
|
||||
)
|
||||
) {
|
||||
Column {
|
||||
Column(
|
||||
modifier = Modifier.padding(vertical = 4.dp)
|
||||
) {
|
||||
app.installationOptions?.forEach {
|
||||
it.item()
|
||||
}
|
||||
ManagerButtonColumn(
|
||||
modifier = Modifier.padding(horizontal = defaultContentPaddingHorizontal)
|
||||
modifier = Modifier
|
||||
.padding(horizontal = defaultContentPaddingHorizontal)
|
||||
.padding(top = defaultContentPaddingVertical)
|
||||
) {
|
||||
ManagerDownloadButton {
|
||||
showDownloadDialog.value = true
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.google.accompanist.imageloading.ImageLoadState
|
|||
import com.google.accompanist.imageloading.LoadPainter
|
||||
import com.vanced.manager.ui.components.card.ManagerCard
|
||||
import com.vanced.manager.ui.components.list.ManagerListItem
|
||||
import com.vanced.manager.ui.components.placeholder.managerPlaceholder
|
||||
import com.vanced.manager.ui.components.modifier.managerPlaceholder
|
||||
import com.vanced.manager.ui.components.text.ManagerText
|
||||
import com.vanced.manager.ui.utils.defaultContentPaddingHorizontal
|
||||
|
||||
|
|
Loading…
Reference in New Issue