mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Add: AppInfo Chips' group
This commit is contained in:
parent
d72cea8036
commit
9102d2845c
@ -1,14 +1,58 @@
|
|||||||
package com.machiav3lli.fdroid.ui.compose.components.appsheet
|
package com.machiav3lli.fdroid.ui.compose.components.appsheet
|
||||||
|
|
||||||
import androidx.compose.foundation.horizontalScroll
|
import androidx.compose.foundation.horizontalScroll
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.lazy.LazyRow
|
||||||
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.material3.MaterialTheme
|
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.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.machiav3lli.fdroid.R
|
||||||
|
import com.machiav3lli.fdroid.database.entity.Product
|
||||||
|
import com.machiav3lli.fdroid.database.entity.Release
|
||||||
|
import com.machiav3lli.fdroid.ui.compose.components.CategoryChip
|
||||||
import com.machiav3lli.fdroid.ui.compose.utils.CustomChip
|
import com.machiav3lli.fdroid.ui.compose.utils.CustomChip
|
||||||
import com.machiav3lli.fdroid.ui.compose.utils.StaggeredGrid
|
import com.machiav3lli.fdroid.ui.compose.utils.StaggeredGrid
|
||||||
|
import com.machiav3lli.fdroid.utility.extension.text.formatSize
|
||||||
|
import java.text.DateFormat
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun AppInfoChips(
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
product: Product,
|
||||||
|
latestRelease: Release?
|
||||||
|
) {
|
||||||
|
val list = listOfNotNull(
|
||||||
|
"v${product.version}",
|
||||||
|
product.displayRelease?.size?.formatSize().orEmpty(),
|
||||||
|
DateFormat.getDateInstance().format(Date(product.updated)),
|
||||||
|
if (latestRelease?.minSdkVersion != 0) "${stringResource(id = R.string.min_sdk)} ${latestRelease?.minSdkVersion}"
|
||||||
|
else null,
|
||||||
|
if (product.antiFeatures.isNotEmpty()) stringResource(id = R.string.anti_features)
|
||||||
|
else null,
|
||||||
|
*product.licenses.toTypedArray(),
|
||||||
|
)
|
||||||
|
|
||||||
|
LazyRow(
|
||||||
|
modifier = modifier.height(54.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
contentPadding = PaddingValues(8.dp)
|
||||||
|
) {
|
||||||
|
items(list) { text ->
|
||||||
|
CategoryChip(
|
||||||
|
category = text,
|
||||||
|
isSelected = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Convert Permissions and AntiFeatures to Custom Interface
|
// TODO: Convert Permissions and AntiFeatures to Custom Interface
|
||||||
|
|
||||||
|
@ -218,4 +218,5 @@
|
|||||||
<string name="prefs_sync">Synchronization</string>
|
<string name="prefs_sync">Synchronization</string>
|
||||||
<string name="group_telegram">Our Telegram group</string>
|
<string name="group_telegram">Our Telegram group</string>
|
||||||
<string name="group_matrix">Our Matrix group</string>
|
<string name="group_matrix">Our Matrix group</string>
|
||||||
|
<string name="min_sdk">minSDK</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user