mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Permissions and AntiFeatures as Chip Grid
This commit is contained in:
parent
751014e5d1
commit
20c30eda36
@ -1,7 +1,11 @@
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.looker.droidify.ui.compose.pages.app_detail.components.AntiFeaturesGrid
|
||||
import com.looker.droidify.ui.compose.pages.app_detail.components.PermissionGrid
|
||||
import com.looker.droidify.ui.compose.pages.app_detail.components.ReleaseItem
|
||||
import com.looker.droidify.ui.compose.theme.AppTheme
|
||||
import com.looker.droidify.ui.compose.utils.CustomChip
|
||||
import com.looker.droidify.utility.SampleData
|
||||
|
||||
@Preview
|
||||
@ -12,4 +16,59 @@ fun ReleaseItemPreview() {
|
||||
release = SampleData.demoRelease
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun CustomChipPrev() {
|
||||
AppTheme(blackTheme = false) {
|
||||
CustomChip(text = "Test Chip")
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun ChipGridPreview() {
|
||||
AppTheme(blackTheme = false) {
|
||||
Column {
|
||||
PermissionGrid(
|
||||
permissions = listOf(
|
||||
"test",
|
||||
"test",
|
||||
"te12312st",
|
||||
"te123st",
|
||||
"te123123st",
|
||||
"test",
|
||||
"test",
|
||||
"test",
|
||||
"test",
|
||||
"test",
|
||||
"te12312st",
|
||||
"te123st",
|
||||
"te123123st",
|
||||
"test",
|
||||
"test"
|
||||
)
|
||||
)
|
||||
AntiFeaturesGrid(
|
||||
antiFeatures = listOf(
|
||||
"test",
|
||||
"test",
|
||||
"te12312st",
|
||||
"te123st",
|
||||
"te123123st",
|
||||
"test",
|
||||
"test",
|
||||
"test",
|
||||
"test",
|
||||
"test",
|
||||
"te12312st",
|
||||
"te123st",
|
||||
"te123123st",
|
||||
"test",
|
||||
"test"
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.looker.droidify.ui.compose.pages.app_detail.components
|
||||
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.looker.droidify.ui.compose.utils.CustomChip
|
||||
import com.looker.droidify.ui.compose.utils.StaggeredGrid
|
||||
|
||||
@Composable
|
||||
fun PermissionGrid(
|
||||
modifier: Modifier = Modifier,
|
||||
permissions: List<String>
|
||||
) {
|
||||
StaggeredGrid(
|
||||
modifier = modifier.horizontalScroll(rememberScrollState()),
|
||||
rows = 2
|
||||
) {
|
||||
permissions.forEach {
|
||||
CustomChip(modifier = Modifier.padding(horizontal = 2.dp), text = it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AntiFeaturesGrid(
|
||||
modifier: Modifier = Modifier,
|
||||
antiFeatures: List<String>
|
||||
) {
|
||||
StaggeredGrid(
|
||||
modifier = modifier.horizontalScroll(rememberScrollState()),
|
||||
rows = 2
|
||||
) {
|
||||
antiFeatures.forEach {
|
||||
CustomChip(
|
||||
modifier = Modifier.padding(horizontal = 2.dp),
|
||||
text = it,
|
||||
containerColor = MaterialTheme.colorScheme.errorContainer,
|
||||
borderColor = MaterialTheme.colorScheme.error
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user