Merge branch 'SimpleMobileTools:master' into master
This commit is contained in:
commit
fb251dfe72
6 changed files with 56 additions and 22 deletions
|
@ -99,3 +99,12 @@ fun Context.fakeVersionCheck(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun ComponentActivity.appOnSdCardCheckCompose(
|
||||
showConfirmationDialog: () -> Unit
|
||||
) {
|
||||
if (!baseConfig.wasAppOnSDShown && isAppInstalledOnSDCard()) {
|
||||
baseConfig.wasAppOnSDShown = true
|
||||
showConfirmationDialog()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,3 +27,21 @@ fun FakeVersionCheck() {
|
|||
context.fakeVersionCheck(confirmationDialogAlertDialogState::show)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun CheckAppOnSdCard() {
|
||||
val context = LocalContext.current.getComponentActivity()
|
||||
val confirmationDialogAlertDialogState = rememberAlertDialogState().apply {
|
||||
DialogMember {
|
||||
ConfirmationAlertDialog(
|
||||
alertDialogState = this,
|
||||
positive = R.string.ok,
|
||||
negative = null,
|
||||
messageId = R.string.app_on_sd_card
|
||||
) {}
|
||||
}
|
||||
}
|
||||
LaunchedEffect(Unit) {
|
||||
context.appOnSdCardCheckCompose(confirmationDialogAlertDialogState::show)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ import com.simplemobiletools.commons.compose.theme.model.Theme
|
|||
import com.simplemobiletools.commons.compose.theme.model.Theme.Companion.systemDefaultMaterialYou
|
||||
|
||||
@Composable
|
||||
fun AppThemeSurface(
|
||||
modifier: Modifier = Modifier,
|
||||
fun AppTheme(
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
val view = LocalView.current
|
||||
|
@ -37,10 +36,20 @@ fun AppThemeSurface(
|
|||
}
|
||||
TransparentSystemBars()
|
||||
Theme(theme = currentTheme) {
|
||||
Surface(modifier = modifier.fillMaxSize()) {
|
||||
content()
|
||||
OnContentDisplayed()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AppThemeSurface(
|
||||
modifier: Modifier = Modifier,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
AppTheme {
|
||||
Surface(modifier = modifier.fillMaxSize()) {
|
||||
content()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class FeatureLockedDialog(val activity: Activity, val callback: () -> Unit) {
|
|||
fun FeatureLockedAlertDialog(
|
||||
alertDialogState: AlertDialogState,
|
||||
modifier: Modifier = Modifier,
|
||||
callback: () -> Unit
|
||||
cancelCallback: () -> Unit
|
||||
) {
|
||||
val localContext = LocalContext.current.getActivity()
|
||||
val donateIntent = {
|
||||
|
@ -80,12 +80,12 @@ fun FeatureLockedAlertDialog(
|
|||
modifier = modifier
|
||||
.dialogBorder,
|
||||
properties = DialogProperties(dismissOnClickOutside = false, dismissOnBackPress = false),
|
||||
onDismissRequest = {},
|
||||
onDismissRequest = cancelCallback,
|
||||
shape = dialogShape,
|
||||
tonalElevation = dialogElevation,
|
||||
dismissButton = {
|
||||
TextButton(onClick = {
|
||||
callback()
|
||||
cancelCallback()
|
||||
alertDialogState.hide()
|
||||
}) {
|
||||
Text(text = stringResource(id = R.string.later))
|
||||
|
@ -94,7 +94,6 @@ fun FeatureLockedAlertDialog(
|
|||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
donateIntent()
|
||||
alertDialogState.hide()
|
||||
}) {
|
||||
Text(text = stringResource(id = R.string.purchase))
|
||||
}
|
||||
|
@ -114,7 +113,6 @@ fun FeatureLockedAlertDialog(
|
|||
interactionSource = rememberMutableInteractionSource(),
|
||||
onClick = {
|
||||
donateIntent()
|
||||
alertDialogState.hide()
|
||||
}
|
||||
),
|
||||
colorFilter = ColorFilter.tint(dialogTextColor)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="ok">Approuver</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="cancel">Annuler</string>
|
||||
<string name="close">Fermer</string>
|
||||
<string name="back">Retour</string>
|
||||
|
@ -221,7 +221,7 @@
|
|||
<string name="filename_without_txt">Nom de fichier (sans .txt)</string>
|
||||
<string name="filename_without_json">Nom de fichier (sans .json)</string>
|
||||
<string name="filename_without_zip">Nom de fichier (sans .zip)</string>
|
||||
<string name="cannot_hide_files">À partir d\'Android 11, il n\'est plus possible de masquer les fichiers et dossiers de cette manière</string>
|
||||
<string name="cannot_hide_files">À partir d\'Android 11, il n\'est plus possible de cacher les fichiers et dossiers de cette manière</string>
|
||||
<!-- Copy / Move -->
|
||||
<string name="copy">Copier</string>
|
||||
<string name="move">Déplacer</string>
|
||||
|
@ -396,12 +396,12 @@
|
|||
<string name="resize">Redimensionner</string>
|
||||
<string name="select_all">Tout sélectionner</string>
|
||||
<string name="select_text">Sélectionner le texte</string>
|
||||
<string name="hide">Masquer</string>
|
||||
<string name="hide">Cacher</string>
|
||||
<string name="unhide">Afficher</string>
|
||||
<string name="hide_folder">Masquer le dossier</string>
|
||||
<string name="hide_folder">Cacher le dossier</string>
|
||||
<string name="unhide_folder">Afficher le dossier</string>
|
||||
<string name="temporarily_show_hidden">Afficher temporairement les fichiers cachés</string>
|
||||
<string name="stop_showing_hidden">Ne plus afficher les fichiers cachés</string>
|
||||
<string name="temporarily_show_hidden">Afficher les fichiers cachés</string>
|
||||
<string name="stop_showing_hidden">Cacher les fichiers cachés</string>
|
||||
<string name="allow_access_more_media">Autoriser l\'accès à plus de médias</string>
|
||||
<string name="maximum_share_reached">Vous ne pouvez pas partager autant de contenu à la fois</string>
|
||||
<string name="empty_and_disable_recycle_bin">Vider et désactiver la corbeille</string>
|
||||
|
@ -428,7 +428,7 @@
|
|||
<string name="add_contact">Ajouter un contact</string>
|
||||
<string name="wallpapers">Fonds d\'écran</string>
|
||||
<string name="show_line_numbers">Afficher les numéros de ligne</string>
|
||||
<string name="hide_line_numbers">Masquer les numéros de ligne</string>
|
||||
<string name="hide_line_numbers">Cacher les numéros de ligne</string>
|
||||
<string name="sleep_timer">Minuteur de veille</string>
|
||||
<string name="unblock">Débloquer</string>
|
||||
<!-- Sorting -->
|
||||
|
@ -514,7 +514,7 @@
|
|||
<string name="today">Aujourd\'hui</string>
|
||||
<string name="tomorrow">Demain</string>
|
||||
<string name="every_day">Tous les jours</string>
|
||||
<string name="hide_year">Masquer l\'année</string>
|
||||
<string name="hide_year">Cacher l\'année</string>
|
||||
<string name="seconds_raw">secondes</string>
|
||||
<string name="minutes_raw">minutes</string>
|
||||
<string name="hours_raw">heures</string>
|
||||
|
@ -757,8 +757,8 @@
|
|||
<string name="manage_excluded_folders">Gérer les dossiers exclus</string>
|
||||
<string name="remove_all">Tout enlever</string>
|
||||
<string name="remove_all_description">Voulez-vous vraiment enlever tous les dossiers de la liste d\'exclusions \? Ceci ne supprimera pas les dossiers, ni leur contenu.</string>
|
||||
<string name="temporarily_show_excluded">Afficher temporairement les dossiers exclus</string>
|
||||
<string name="stop_showing_excluded">Masquer les dossiers exclus</string>
|
||||
<string name="temporarily_show_excluded">Afficher les dossiers exclus</string>
|
||||
<string name="stop_showing_excluded">Cacher les dossiers exclus</string>
|
||||
<!-- Default tab to open -->
|
||||
<string name="manage_shown_tabs">Gérer les onglets affichés</string>
|
||||
<string name="default_tab_to_open">Onglet à ouvrir au démarrage de l\'application</string>
|
||||
|
@ -779,7 +779,7 @@
|
|||
<string name="recycle_bin_empty">La corbeille est vide</string>
|
||||
<string name="moving_recycle_bin_items_disabled">Le déplacement des éléments de la corbeille est désactivé. Veuillez utiliser la fonction de restauration</string>
|
||||
<string name="show_the_recycle_bin">Afficher la corbeille</string>
|
||||
<string name="hide_the_recycle_bin">Masquer la corbeille</string>
|
||||
<string name="hide_the_recycle_bin">Cacher la corbeille</string>
|
||||
<string name="open_the_recycle_bin">Ouvrir la corbeille</string>
|
||||
<string name="skip_the_recycle_bin">Ne pas utiliser la corbeille, supprimer directement les fichiers</string>
|
||||
<plurals name="moving_items_into_bin">
|
||||
|
@ -930,7 +930,7 @@
|
|||
<string name="email_label">Envoyez vos commentaires ou suggestions à</string>
|
||||
<string name="upgrade_to_pro">Passer à la version « Pro »</string>
|
||||
<string name="more_apps">Plus d\'applications</string>
|
||||
<string name="more_apps_from_us">Plus d\'applications du même développeur</string>
|
||||
<string name="more_apps_from_us">Plus d\'applications</string>
|
||||
<string name="invite_friends">Inviter des amis</string>
|
||||
<string name="share_text">Salut, viens voir %1$s sur %2$s</string>
|
||||
<string name="invite_via">Inviter via</string>
|
||||
|
|
|
@ -195,7 +195,7 @@ class TestDialogActivity : ComponentActivity() {
|
|||
@Composable
|
||||
private fun getFeatureLockedAlertDialogState() = rememberAlertDialogState().apply {
|
||||
DialogMember {
|
||||
FeatureLockedAlertDialog(alertDialogState = this, callback = {})
|
||||
FeatureLockedAlertDialog(alertDialogState = this, cancelCallback = {})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue