mirror of
https://github.com/revanced/revanced-manager-compose-old.git
synced 2025-04-29 22:14:28 +02:00
refactor: tiny cleanup
This commit is contained in:
parent
cc231367f4
commit
2eb37b81c8
@ -62,13 +62,7 @@ fun ContributorsCard(
|
||||
.combinedClickable(
|
||||
onClick = { vm.openUserProfile(contributor.username) },
|
||||
onLongClick = {
|
||||
Toast
|
||||
.makeText(
|
||||
context,
|
||||
contributor.username,
|
||||
Toast.LENGTH_SHORT
|
||||
)
|
||||
.show()
|
||||
Toast.makeText(context, contributor.username, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
)
|
||||
)
|
||||
|
@ -16,7 +16,6 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.revanced.manager.R
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ExpandableCard(
|
||||
content: @Composable (arrowButton: @Composable () -> Unit) -> Unit,
|
||||
|
@ -31,4 +31,4 @@ fun GroupHeader(
|
||||
fontWeight = FontWeight.SemiBold
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -22,6 +22,8 @@ fun HeadlineWithCard(
|
||||
modifier = Modifier
|
||||
.padding(top = 12.dp)
|
||||
.fillMaxWidth(),
|
||||
) { content() }
|
||||
) {
|
||||
content()
|
||||
}
|
||||
}
|
||||
}
|
@ -124,4 +124,4 @@ fun PatchCard(patchClass: PatchClass, isSelected: Boolean, onSelected: () -> Uni
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -17,24 +17,30 @@ import org.koin.androidx.compose.get
|
||||
|
||||
@Composable
|
||||
fun PatchCompatibilityDialog(
|
||||
patchClass: PatchClass, patcherUtils: PatcherUtils = get(), onClose: () -> Unit
|
||||
patchClass: PatchClass,
|
||||
patcherUtils: PatcherUtils = get(),
|
||||
onClose: () -> Unit
|
||||
) {
|
||||
val patch = patchClass.patch
|
||||
val packageName = patcherUtils.getSelectedPackageInfo()?.packageName
|
||||
AlertDialog(onDismissRequest = onClose, shape = RoundedCornerShape(12.dp), title = {
|
||||
Text(stringResource(id = R.string.unsupported), textAlign = TextAlign.Center)
|
||||
}, text = {
|
||||
(patch.compatiblePackages!!.forEach { p: Package ->
|
||||
if (p.name == packageName) {
|
||||
Text(
|
||||
stringResource(id = R.string.only_compatible) + p.versions.reversed()
|
||||
.joinToString(", ")
|
||||
)
|
||||
AlertDialog(
|
||||
onDismissRequest = onClose,
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
title = { Text(stringResource(R.string.unsupported), textAlign = TextAlign.Center) },
|
||||
text = {
|
||||
patch.compatiblePackages!!.forEach { p: Package ->
|
||||
if (p.name == packageName) {
|
||||
Text(
|
||||
stringResource(id = R.string.only_compatible) + p.versions.reversed()
|
||||
.joinToString(", ")
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = onClose) {
|
||||
Text(text = "Dismiss")
|
||||
}
|
||||
})
|
||||
}, confirmButton = {
|
||||
TextButton(onClick = onClose) {
|
||||
Text(text = "Dismiss")
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
@ -15,7 +15,11 @@ import androidx.compose.ui.res.stringResource
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun SocialItem(@StringRes label: Int, imageVector: ImageVector? = null, onClick: () -> Unit) {
|
||||
fun SocialItem(
|
||||
@StringRes label: Int,
|
||||
imageVector: ImageVector? = null,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
ListItem(
|
||||
modifier = Modifier.clickable { onClick() },
|
||||
leadingContent = {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package app.revanced.manager.ui.component
|
||||
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
@ -20,7 +19,6 @@ import androidx.compose.ui.unit.dp
|
||||
import app.revanced.manager.R
|
||||
import coil.compose.AsyncImage
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
fun SourceItem() {
|
||||
Row(
|
||||
|
@ -18,7 +18,7 @@ fun SplitAPKDialog(
|
||||
) {
|
||||
AlertDialog(onDismissRequest = onDismiss, shape = RoundedCornerShape(12.dp),
|
||||
title = {
|
||||
Text(stringResource(id = R.string.warning), textAlign = TextAlign.Center)
|
||||
Text(stringResource(R.string.warning), textAlign = TextAlign.Center)
|
||||
},
|
||||
text = {
|
||||
Text(stringResource(R.string.split_apk_warning))
|
||||
@ -30,12 +30,12 @@ fun SplitAPKDialog(
|
||||
onDismiss()
|
||||
}
|
||||
) {
|
||||
Text(text = "OK")
|
||||
Text(stringResource(R.string.text_continue))
|
||||
}
|
||||
},
|
||||
dismissButton = {
|
||||
OutlinedButton(onClick = onDismiss) {
|
||||
Text(text = "Cancel")
|
||||
Text(stringResource(R.string.cancel))
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -68,8 +68,6 @@ fun DashboardScreen(viewModel: DashboardViewModel = getViewModel()) {
|
||||
}
|
||||
}
|
||||
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||
|
||||
|
||||
Text(
|
||||
text = "Patched Applications",
|
||||
style = MaterialTheme.typography.headlineSmall
|
||||
|
@ -89,4 +89,4 @@ fun ContributorsSubscreen(
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -50,7 +50,7 @@ fun LicensesSubscreen(
|
||||
contentColor = MaterialTheme.colorScheme.onBackground,
|
||||
badgeBackgroundColor = MaterialTheme.colorScheme.primary,
|
||||
badgeContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||
),
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ fun SourceSelectorSubscreen(
|
||||
Toast.makeText(context, "Couldn't load local patch bundle.", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier
|
||||
.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||
|
@ -36,4 +36,6 @@
|
||||
<string name="select_sources">Select sources</string>
|
||||
<string name="sentry">Sentry</string>
|
||||
<string name="select_bundle_from_storage">Select a bundle from storage</string>
|
||||
<string name="text_continue">Continue</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user