mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Update: Show repository host instead of developer name on repository card
This commit is contained in:
parent
6f7195047d
commit
ce1cfeb79a
@ -42,7 +42,7 @@ fun AppInfoHeader(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
versionCode: String,
|
versionCode: String,
|
||||||
appSize: String,
|
appSize: String,
|
||||||
appDev: String,
|
repoHost: String,
|
||||||
mainAction: ActionState?,
|
mainAction: ActionState?,
|
||||||
possibleActions: Set<ActionState>,
|
possibleActions: Set<ActionState>,
|
||||||
onSource: () -> Unit = { },
|
onSource: () -> Unit = { },
|
||||||
@ -64,7 +64,7 @@ fun AppInfoHeader(
|
|||||||
HeaderExtra(
|
HeaderExtra(
|
||||||
versionCode = versionCode,
|
versionCode = versionCode,
|
||||||
appSize = appSize,
|
appSize = appSize,
|
||||||
appDev = appDev,
|
repoHost = repoHost,
|
||||||
onSource = onSource,
|
onSource = onSource,
|
||||||
onSourceLong = onSourceLong
|
onSourceLong = onSourceLong
|
||||||
)
|
)
|
||||||
@ -158,7 +158,7 @@ fun HeaderExtra(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
versionCode: String,
|
versionCode: String,
|
||||||
appSize: String,
|
appSize: String,
|
||||||
appDev: String,
|
repoHost: String,
|
||||||
onSource: () -> Unit,
|
onSource: () -> Unit,
|
||||||
onSourceLong: () -> Unit
|
onSourceLong: () -> Unit
|
||||||
) {
|
) {
|
||||||
@ -181,7 +181,7 @@ fun HeaderExtra(
|
|||||||
HeaderExtrasCard(
|
HeaderExtrasCard(
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
title = stringResource(id = R.string.source_code),
|
title = stringResource(id = R.string.source_code),
|
||||||
text = appDev,
|
text = repoHost,
|
||||||
onClick = onSource,
|
onClick = onSource,
|
||||||
onLongClick = onSourceLong
|
onLongClick = onSourceLong
|
||||||
)
|
)
|
||||||
|
@ -88,6 +88,8 @@ import kotlinx.coroutines.flow.launchIn
|
|||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
import java.net.URI
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
// TODO clean up and replace dropped functions from AppDetailFragment
|
// TODO clean up and replace dropped functions from AppDetailFragment
|
||||||
class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
||||||
@ -422,7 +424,10 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
|||||||
AppInfoHeader(
|
AppInfoHeader(
|
||||||
versionCode = product.versionCode.toString(),
|
versionCode = product.versionCode.toString(),
|
||||||
appSize = product.displayRelease?.size?.formatSize().orEmpty(),
|
appSize = product.displayRelease?.size?.formatSize().orEmpty(),
|
||||||
appDev = product.author.name.replaceFirstChar { it.titlecase() },
|
repoHost = "@${
|
||||||
|
URI(product.source).host.removePrefix("www.")
|
||||||
|
.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }
|
||||||
|
}",
|
||||||
mainAction = mainAction,
|
mainAction = mainAction,
|
||||||
possibleActions = actions?.filter { it != mainAction }?.toSet()
|
possibleActions = actions?.filter { it != mainAction }?.toSet()
|
||||||
?: emptySet(),
|
?: emptySet(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user