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(
|
.combinedClickable(
|
||||||
onClick = { vm.openUserProfile(contributor.username) },
|
onClick = { vm.openUserProfile(contributor.username) },
|
||||||
onLongClick = {
|
onLongClick = {
|
||||||
Toast
|
Toast.makeText(context, contributor.username, Toast.LENGTH_SHORT).show()
|
||||||
.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 androidx.compose.ui.unit.dp
|
||||||
import app.revanced.manager.R
|
import app.revanced.manager.R
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ExpandableCard(
|
fun ExpandableCard(
|
||||||
content: @Composable (arrowButton: @Composable () -> Unit) -> Unit,
|
content: @Composable (arrowButton: @Composable () -> Unit) -> Unit,
|
||||||
|
@ -31,4 +31,4 @@ fun GroupHeader(
|
|||||||
fontWeight = FontWeight.SemiBold
|
fontWeight = FontWeight.SemiBold
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,6 +22,8 @@ fun HeadlineWithCard(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 12.dp)
|
.padding(top = 12.dp)
|
||||||
.fillMaxWidth(),
|
.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
|
@Composable
|
||||||
fun PatchCompatibilityDialog(
|
fun PatchCompatibilityDialog(
|
||||||
patchClass: PatchClass, patcherUtils: PatcherUtils = get(), onClose: () -> Unit
|
patchClass: PatchClass,
|
||||||
|
patcherUtils: PatcherUtils = get(),
|
||||||
|
onClose: () -> Unit
|
||||||
) {
|
) {
|
||||||
val patch = patchClass.patch
|
val patch = patchClass.patch
|
||||||
val packageName = patcherUtils.getSelectedPackageInfo()?.packageName
|
val packageName = patcherUtils.getSelectedPackageInfo()?.packageName
|
||||||
AlertDialog(onDismissRequest = onClose, shape = RoundedCornerShape(12.dp), title = {
|
AlertDialog(
|
||||||
Text(stringResource(id = R.string.unsupported), textAlign = TextAlign.Center)
|
onDismissRequest = onClose,
|
||||||
}, text = {
|
shape = RoundedCornerShape(12.dp),
|
||||||
(patch.compatiblePackages!!.forEach { p: Package ->
|
title = { Text(stringResource(R.string.unsupported), textAlign = TextAlign.Center) },
|
||||||
if (p.name == packageName) {
|
text = {
|
||||||
Text(
|
patch.compatiblePackages!!.forEach { p: Package ->
|
||||||
stringResource(id = R.string.only_compatible) + p.versions.reversed()
|
if (p.name == packageName) {
|
||||||
.joinToString(", ")
|
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)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun SocialItem(@StringRes label: Int, imageVector: ImageVector? = null, onClick: () -> Unit) {
|
fun SocialItem(
|
||||||
|
@StringRes label: Int,
|
||||||
|
imageVector: ImageVector? = null,
|
||||||
|
onClick: () -> Unit
|
||||||
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
modifier = Modifier.clickable { onClick() },
|
modifier = Modifier.clickable { onClick() },
|
||||||
leadingContent = {
|
leadingContent = {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package app.revanced.manager.ui.component
|
package app.revanced.manager.ui.component
|
||||||
|
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
@ -20,7 +19,6 @@ import androidx.compose.ui.unit.dp
|
|||||||
import app.revanced.manager.R
|
import app.revanced.manager.R
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SourceItem() {
|
fun SourceItem() {
|
||||||
Row(
|
Row(
|
||||||
|
@ -18,7 +18,7 @@ fun SplitAPKDialog(
|
|||||||
) {
|
) {
|
||||||
AlertDialog(onDismissRequest = onDismiss, shape = RoundedCornerShape(12.dp),
|
AlertDialog(onDismissRequest = onDismiss, shape = RoundedCornerShape(12.dp),
|
||||||
title = {
|
title = {
|
||||||
Text(stringResource(id = R.string.warning), textAlign = TextAlign.Center)
|
Text(stringResource(R.string.warning), textAlign = TextAlign.Center)
|
||||||
},
|
},
|
||||||
text = {
|
text = {
|
||||||
Text(stringResource(R.string.split_apk_warning))
|
Text(stringResource(R.string.split_apk_warning))
|
||||||
@ -30,12 +30,12 @@ fun SplitAPKDialog(
|
|||||||
onDismiss()
|
onDismiss()
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(text = "OK")
|
Text(stringResource(R.string.text_continue))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dismissButton = {
|
dismissButton = {
|
||||||
OutlinedButton(onClick = onDismiss) {
|
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)) {
|
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||||
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Patched Applications",
|
text = "Patched Applications",
|
||||||
style = MaterialTheme.typography.headlineSmall
|
style = MaterialTheme.typography.headlineSmall
|
||||||
|
@ -89,4 +89,4 @@ fun ContributorsSubscreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -50,7 +50,7 @@ fun LicensesSubscreen(
|
|||||||
contentColor = MaterialTheme.colorScheme.onBackground,
|
contentColor = MaterialTheme.colorScheme.onBackground,
|
||||||
badgeBackgroundColor = MaterialTheme.colorScheme.primary,
|
badgeBackgroundColor = MaterialTheme.colorScheme.primary,
|
||||||
badgeContentColor = MaterialTheme.colorScheme.onPrimary,
|
badgeContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,6 @@ fun SourceSelectorSubscreen(
|
|||||||
Toast.makeText(context, "Couldn't load local patch bundle.", Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, "Couldn't load local patch bundle.", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.nestedScroll(scrollBehavior.nestedScrollConnection),
|
.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||||
|
@ -36,4 +36,6 @@
|
|||||||
<string name="select_sources">Select sources</string>
|
<string name="select_sources">Select sources</string>
|
||||||
<string name="sentry">Sentry</string>
|
<string name="sentry">Sentry</string>
|
||||||
<string name="select_bundle_from_storage">Select a bundle from storage</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>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user