-
-
Notifications
You must be signed in to change notification settings - Fork 778
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'compose-dev' into feat/haptic-compose
# Conflicts: # app/src/main/java/app/revanced/manager/domain/manager/base/BasePreferencesManager.kt # app/src/main/java/app/revanced/manager/ui/component/bundle/BaseBundleDialog.kt # app/src/main/java/app/revanced/manager/ui/screen/DashboardScreen.kt # app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt # app/src/main/java/app/revanced/manager/ui/screen/PatchesSelectorScreen.kt # app/src/main/java/app/revanced/manager/ui/screen/SelectedAppInfoScreen.kt # app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt # app/src/main/java/app/revanced/manager/ui/viewmodel/DashboardViewModel.kt
- Loading branch information
Showing
49 changed files
with
1,051 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
app/src/main/java/app/revanced/manager/ui/component/AvailableUpdateDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package app.revanced.manager.ui.component | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.Update | ||
import androidx.compose.material3.* | ||
import androidx.compose.runtime.* | ||
import androidx.compose.runtime.saveable.rememberSaveable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import app.revanced.manager.R | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun AvailableUpdateDialog( | ||
onDismiss: () -> Unit, | ||
onConfirm: () -> Unit, | ||
setShowManagerUpdateDialogOnLaunch: (Boolean) -> Unit, | ||
newVersion: String | ||
) { | ||
var dontShowAgain by rememberSaveable { mutableStateOf(false) } | ||
val dismissDialog = { | ||
setShowManagerUpdateDialogOnLaunch(!dontShowAgain) | ||
onDismiss() | ||
} | ||
|
||
AlertDialogExtended( | ||
onDismissRequest = dismissDialog, | ||
confirmButton = { | ||
TextButton( | ||
onClick = { | ||
dismissDialog() | ||
onConfirm() | ||
} | ||
) { | ||
Text(stringResource(R.string.show)) | ||
} | ||
}, | ||
dismissButton = { | ||
TextButton( | ||
onClick = dismissDialog | ||
) { | ||
Text(stringResource(R.string.dismiss)) | ||
} | ||
}, | ||
icon = { | ||
Icon(imageVector = Icons.Outlined.Update, contentDescription = null) | ||
}, | ||
title = { | ||
Text(stringResource(R.string.update_available)) | ||
}, | ||
text = { | ||
Column( | ||
modifier = Modifier.padding(horizontal = 8.dp), | ||
verticalArrangement = Arrangement.spacedBy(4.dp), | ||
) { | ||
Text( | ||
modifier = Modifier.padding(horizontal = 16.dp), | ||
text = stringResource(R.string.update_available_dialog_description, newVersion) | ||
) | ||
ListItem( | ||
modifier = Modifier.clickable { dontShowAgain = !dontShowAgain }, | ||
headlineContent = { | ||
Text(stringResource(R.string.never_show_again)) | ||
}, | ||
leadingContent = { | ||
CompositionLocalProvider(LocalMinimumInteractiveComponentEnforcement provides false) { | ||
Checkbox(checked = dontShowAgain, onCheckedChange = { dontShowAgain = it }) | ||
} | ||
} | ||
) | ||
} | ||
}, | ||
textHorizontalPadding = PaddingValues(0.dp) | ||
) | ||
} |
Oops, something went wrong.