Skip to content

Commit b87daf8

Browse files
feat: beta instructions
1 parent 05f538e commit b87daf8

File tree

11 files changed

+306
-1
lines changed

11 files changed

+306
-1
lines changed

android/src/main/kotlin/project/pipepipe/app/MainActivity.kt

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import androidx.compose.foundation.layout.*
1515
import androidx.compose.material3.*
1616
import androidx.compose.runtime.collectAsState
1717
import androidx.compose.runtime.getValue
18+
import androidx.compose.runtime.mutableStateOf
19+
import androidx.compose.runtime.remember
1820
import androidx.compose.runtime.rememberCoroutineScope
21+
import androidx.compose.runtime.setValue
22+
import androidx.compose.runtime.LaunchedEffect
1923
import androidx.compose.ui.Modifier
2024
import androidx.compose.ui.unit.dp
2125
import androidx.media3.common.util.UnstableApi
@@ -31,10 +35,15 @@ import project.pipepipe.app.global.PipHelper
3135
import project.pipepipe.app.helper.ExternalUrlPatternHelper
3236
import project.pipepipe.app.helper.ToastManager
3337
import project.pipepipe.app.service.PlaybackService
38+
import project.pipepipe.app.service.UpdateCheckWorker
3439
import project.pipepipe.app.service.setPlaybackMode
3540
import project.pipepipe.app.ui.component.BottomSheetMenu
41+
import project.pipepipe.app.ui.component.DataMigrationDialog
42+
import project.pipepipe.app.ui.component.ErrorHandlingDialog
43+
import project.pipepipe.app.ui.component.FirstRunDialog
3644
import project.pipepipe.app.ui.component.ImageViewer
3745
import project.pipepipe.app.ui.component.Toast
46+
import project.pipepipe.app.ui.component.WelcomeDialog
3847
import project.pipepipe.app.ui.navigation.NavGraph
3948
import project.pipepipe.app.ui.screens.PlayQueueScreen
4049
import project.pipepipe.app.ui.screens.Screen
@@ -74,6 +83,24 @@ class MainActivity : ComponentActivity() {
7483
navController = rememberNavController()
7584
SharedContext.navController = navController
7685
val toastMessage by ToastManager.message.collectAsState()
86+
87+
// Dialog state management
88+
// TODO: Update welcome dialog text after the official release
89+
var showWelcomeDialog by remember { mutableStateOf(false) }
90+
var showDataMigrationDialog by remember { mutableStateOf(false) }
91+
var showErrorHandlingDialog by remember { mutableStateOf(false) }
92+
var showFirstRunDialog by remember { mutableStateOf(false) }
93+
94+
// Check if this is the first run and show dialogs in sequence
95+
// Dialog order: Welcome -> Data Migration -> Error Handling -> Update Checker
96+
LaunchedEffect(Unit) {
97+
val isFirstRun = SharedContext.settingsManager.getBoolean("is_first_run", true)
98+
if (isFirstRun) {
99+
// Show welcome dialog first
100+
showWelcomeDialog = true
101+
}
102+
}
103+
77104
PipePipeTheme {
78105
Surface(
79106
modifier = Modifier.fillMaxSize(),
@@ -132,6 +159,56 @@ class MainActivity : ComponentActivity() {
132159
toastMessage?.let { message ->
133160
Toast(message = message)
134161
}
162+
163+
// Welcome dialog - shown first on first run
164+
if (showWelcomeDialog) {
165+
WelcomeDialog(
166+
onDismiss = {
167+
showWelcomeDialog = false
168+
// After welcome dialog, show data migration dialog
169+
showDataMigrationDialog = true
170+
}
171+
)
172+
}
173+
174+
// Data migration dialog - shown after welcome dialog
175+
if (showDataMigrationDialog) {
176+
DataMigrationDialog(
177+
onDismiss = {
178+
showDataMigrationDialog = false
179+
// After data migration dialog, show error handling dialog
180+
showErrorHandlingDialog = true
181+
}
182+
)
183+
}
184+
185+
// Error handling dialog - shown after data migration dialog
186+
if (showErrorHandlingDialog) {
187+
ErrorHandlingDialog(
188+
onDismiss = {
189+
showErrorHandlingDialog = false
190+
// After error handling dialog, show update checker dialog
191+
showFirstRunDialog = true
192+
}
193+
)
194+
}
195+
196+
// Update checker dialog - shown after error handling dialog
197+
if (showFirstRunDialog) {
198+
FirstRunDialog(
199+
onDismiss = {
200+
showFirstRunDialog = false
201+
SharedContext.settingsManager.putBoolean("is_first_run", false)
202+
},
203+
onEnableUpdateChecker = {
204+
SharedContext.settingsManager.putBoolean(UpdateCheckWorker.UPDATE_ENABLED_KEY, true)
205+
ToastManager.show(MR.strings.update_checking.desc().toString(context = this@MainActivity))
206+
UpdateCheckWorker.enqueueUpdateCheck(this@MainActivity, isManual = true)
207+
showFirstRunDialog = false
208+
SharedContext.settingsManager.putBoolean("is_first_run", false)
209+
}
210+
)
211+
}
135212
}
136213
}
137214
}
@@ -336,4 +413,3 @@ class MainActivity : ComponentActivity() {
336413
}
337414
}
338415
}
339-
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
package project.pipepipe.app.ui.component
2+
3+
import androidx.compose.material3.AlertDialog
4+
import androidx.compose.material3.Text
5+
import androidx.compose.material3.TextButton
6+
import androidx.compose.runtime.Composable
7+
import dev.icerock.moko.resources.compose.stringResource
8+
import project.pipepipe.app.MR
9+
10+
11+
/**
12+
* Welcome dialog shown on first app launch to introduce PipePipe 5 Beta.
13+
* TODO: Update dialog text after the official release.
14+
*/
15+
@Composable
16+
fun WelcomeDialog(
17+
onDismiss: () -> Unit
18+
) {
19+
AlertDialog(
20+
onDismissRequest = onDismiss,
21+
title = {
22+
Text(text = stringResource(MR.strings.welcome_dialog_title))
23+
},
24+
text = {
25+
Text(text = stringResource(MR.strings.welcome_dialog_message))
26+
},
27+
confirmButton = {
28+
TextButton(onClick = onDismiss) {
29+
Text(text = stringResource(MR.strings.welcome_dialog_button))
30+
}
31+
}
32+
)
33+
}
34+
35+
/**
36+
* Data migration dialog shown after welcome dialog to explain package name change
37+
* and guide users through the migration process.
38+
*/
39+
@Composable
40+
fun DataMigrationDialog(
41+
onDismiss: () -> Unit
42+
) {
43+
AlertDialog(
44+
onDismissRequest = onDismiss,
45+
title = {
46+
Text(text = stringResource(MR.strings.data_migration_dialog_title))
47+
},
48+
text = {
49+
Text(text = stringResource(MR.strings.data_migration_dialog_message))
50+
},
51+
confirmButton = {
52+
TextButton(onClick = onDismiss) {
53+
Text(text = stringResource(MR.strings.data_migration_dialog_button))
54+
}
55+
}
56+
)
57+
}
58+
59+
/**
60+
* Error handling dialog shown after data migration dialog to explain
61+
* the new error handling mechanism.
62+
*/
63+
@Composable
64+
fun ErrorHandlingDialog(
65+
onDismiss: () -> Unit
66+
) {
67+
AlertDialog(
68+
onDismissRequest = onDismiss,
69+
title = {
70+
Text(text = stringResource(MR.strings.error_handling_dialog_title))
71+
},
72+
text = {
73+
Text(text = stringResource(MR.strings.error_handling_dialog_message))
74+
},
75+
confirmButton = {
76+
TextButton(onClick = onDismiss) {
77+
Text(text = stringResource(MR.strings.error_handling_dialog_button))
78+
}
79+
}
80+
)
81+
}
82+
83+
/**
84+
* First run dialog shown after error handling dialog to prompt user to enable update checker.
85+
*/
86+
@Composable
87+
fun FirstRunDialog(
88+
onDismiss: () -> Unit,
89+
onEnableUpdateChecker: () -> Unit
90+
) {
91+
AlertDialog(
92+
onDismissRequest = onDismiss,
93+
title = {
94+
Text(text = stringResource(MR.strings.first_run_dialog_title))
95+
},
96+
text = {
97+
Text(text = stringResource(MR.strings.first_run_dialog_message))
98+
},
99+
confirmButton = {
100+
TextButton(onClick = onEnableUpdateChecker) {
101+
Text(text = stringResource(MR.strings.first_run_dialog_enable))
102+
}
103+
},
104+
dismissButton = {
105+
TextButton(onClick = onDismiss) {
106+
Text(text = stringResource(MR.strings.first_run_dialog_no_thanks))
107+
}
108+
}
109+
)
110+
}
111+

library/src/commonMain/moko-resources/base/strings.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,18 @@
450450
<string name="playback_skip_silence_title">Skip silence</string>
451451
<string name="playback_skip_silence_summary">Automatically skip silent parts during playback</string>
452452
<string name="playback_error">Playback error</string>
453+
<string name="first_run_dialog_title">Enable update checker?</string>
454+
<string name="first_run_dialog_message">Stay up to date with the latest features and bug fixes by enabling automatic update checks.</string>
455+
<string name="first_run_dialog_enable">Enable</string>
456+
<string name="first_run_dialog_no_thanks">No, thanks</string>
457+
<!-- TODO: Update these strings after the official release -->
458+
<string name="welcome_dialog_title">A Whole New PipePipe!</string>
459+
<string name="welcome_dialog_message">Welcome to the PipePipe 5 Beta! We\'re thrilled for you to be among the first to try it.\n\nWe\'ve rebuilt the app from the ground up to be faster, smoother, and more intuitive.\n\nThis is an early version, so things might not be perfect yet. That\'s where you come in! Help us improve PipePipe by sharing your feedback.</string>
460+
<string name="welcome_dialog_button">Explore the App</string>
461+
<string name="data_migration_dialog_title">Data Migration</string>
462+
<string name="data_migration_dialog_message">PipePipe 5 uses a new package name to avoid conflicts with older versions. This means:\n• Version 5 installs as a separate app\n• Your existing installation remains unchanged\n\nHow to migrate your data:\n1. Open your old PipePipe app (e.g., version 4.7.3)\n2. Export a backup in Settings\n3. Open the new PipePipe 5\n4. Import the backup in Settings\n\nNote for beta testers: If you\'re already using 5.0.0-beta1, please export and import your data again to apply the latest changes.</string>
463+
<string name="data_migration_dialog_button">Got it</string>
464+
<string name="error_handling_dialog_title">Improved Error Handling</string>
465+
<string name="error_handling_dialog_message">To keep your viewing experience smooth and interruption-free, we\'ve redesigned how errors are handled.\n\nErrors are now automatically captured and stored locally. You can view and report them anytime in Settings > Log.</string>
466+
<string name="error_handling_dialog_button">Got It</string>
453467
</resources>

library/src/commonMain/moko-resources/de/strings.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,17 @@
441441
<string name="playback_skip_silence_title">Stille überspringen</string>
442442
<string name="playback_error">Wiedergabefehler</string>
443443
<string name="no_comments_yet">Noch keine Kommentare</string>
444+
<string name="error_handling_dialog_message">Um Ihr Seherlebnis reibungslos und unterbrechungsfrei zu gestalten, haben wir die Fehlerbehandlung neu gestaltet.\n\nFehler werden jetzt automatisch erfasst und lokal gespeichert. Sie können sie jederzeit unter Einstellungen &gt; Protokoll anzeigen und melden.</string>
445+
<string name="error_handling_dialog_button">Verstanden</string>
446+
<string name="first_run_dialog_title">Update-Prüfung aktivieren?</string>
447+
<string name="data_migration_dialog_message">PipePipe 5 verwendet einen neuen Paketnamen, um Konflikte mit älteren Versionen zu vermeiden. Das bedeutet:\n• Version 5 wird als separate App installiert\n• Ihre bestehende Installation bleibt unverändert\n\nSo migrieren Sie Ihre Daten:\n1. Öffnen Sie Ihre alte PipePipe-App (z.B. Version 4.7.3)\n2. Exportieren Sie ein Backup in den Einstellungen\n3. Öffnen Sie das neue PipePipe 5\n4. Importieren Sie das Backup in den Einstellungen\n\nHinweis für Beta-Tester: Wenn Sie bereits 5.0.0-beta1 verwenden, exportieren und importieren Sie Ihre Daten bitte erneut, um die neuesten Änderungen zu übernehmen.</string>
448+
<string name="welcome_dialog_title">Ein brandneues PipePipe!</string>
449+
<string name="first_run_dialog_enable">Aktivieren</string>
450+
<string name="first_run_dialog_message">Bleiben Sie mit den neuesten Funktionen und Fehlerbehebungen auf dem Laufenden, indem Sie die automatische Update-Prüfung aktivieren.</string>
451+
<string name="error_handling_dialog_title">Verbesserte Fehlerbehandlung</string>
452+
<string name="data_migration_dialog_button">Verstanden</string>
453+
<string name="welcome_dialog_message">Willkommen zur PipePipe 5 Beta! Wir freuen uns, dass Sie zu den Ersten gehören, die sie ausprobieren.\n\nWir haben die App von Grund auf neu aufgebaut, um sie schneller, reibungsloser und intuitiver zu machen.\n\nDies ist eine frühe Version, daher ist vielleicht noch nicht alles perfekt. Hier kommen Sie ins Spiel! Helfen Sie uns, PipePipe zu verbessern, indem Sie Ihr Feedback teilen.</string>
454+
<string name="data_migration_dialog_title">Datenmigration</string>
455+
<string name="first_run_dialog_no_thanks">Nein, danke</string>
456+
<string name="welcome_dialog_button">App erkunden</string>
444457
</resources>

library/src/commonMain/moko-resources/es/strings.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,17 @@
441441
<string name="playback_skip_silence_title">Omitir silencio</string>
442442
<string name="playback_error">Error de reproducción</string>
443443
<string name="no_comments_yet">Aún no hay comentarios</string>
444+
<string name="error_handling_dialog_message">Para mantener tu experiencia de visualización fluida y sin interrupciones, hemos rediseñado cómo se manejan los errores.\n\nLos errores ahora se capturan y almacenan automáticamente de forma local. Puedes verlos y reportarlos en cualquier momento en Ajustes &gt; Registro.</string>
445+
<string name="error_handling_dialog_button">Entendido</string>
446+
<string name="first_run_dialog_title">¿Habilitar el verificador de actualizaciones?</string>
447+
<string name="data_migration_dialog_message">PipePipe 5 utiliza un nuevo nombre de paquete para evitar conflictos con versiones anteriores. Esto significa:\n• La versión 5 se instala como una aplicación separada\n• Tu instalación existente permanece sin cambios\n\nCómo migrar tus datos:\n1. Abre tu antigua aplicación PipePipe (por ejemplo, versión 4.7.3)\n2. Exporta una copia de seguridad en Ajustes\n3. Abre el nuevo PipePipe 5\n4. Importa la copia de seguridad en Ajustes\n\nNota para los probadores beta: Si ya estás usando 5.0.0-beta1, por favor exporta e importa tus datos de nuevo para aplicar los últimos cambios.</string>
448+
<string name="welcome_dialog_title">¡Un PipePipe Completamente Nuevo!</string>
449+
<string name="first_run_dialog_enable">Habilitar</string>
450+
<string name="first_run_dialog_message">Mantente al día con las últimas funciones y correcciones de errores habilitando las comprobaciones automáticas de actualizaciones.</string>
451+
<string name="error_handling_dialog_title">Manejo de Errores Mejorado</string>
452+
<string name="data_migration_dialog_button">Entendido</string>
453+
<string name="welcome_dialog_message">¡Bienvenido a la Beta de PipePipe 5! Estamos encantados de que seas uno de los primeros en probarla.\n\nHemos reconstruido la aplicación desde cero para que sea más rápida, fluida e intuitiva.\n\nEsta es una versión temprana, por lo que las cosas podrían no ser perfectas todavía. ¡Ahí es donde entras tú! Ayúdanos a mejorar PipePipe compartiendo tus comentarios.</string>
454+
<string name="data_migration_dialog_title">Migración de Datos</string>
455+
<string name="first_run_dialog_no_thanks">No, gracias</string>
456+
<string name="welcome_dialog_button">Explorar la Aplicación</string>
444457
</resources>

library/src/commonMain/moko-resources/fr/strings.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,17 @@
441441
<string name="playback_skip_silence_title">Ignorer les silences</string>
442442
<string name="playback_error">Erreur de lecture</string>
443443
<string name="no_comments_yet">Aucun commentaire pour l\'instant</string>
444+
<string name="error_handling_dialog_message">Pour que votre expérience de visionnage reste fluide et sans interruption, nous avons repensé la gestion des erreurs.\n\nLes erreurs sont désormais automatiquement capturées et stockées localement. Vous pouvez les consulter et les signaler à tout moment dans Paramètres &gt; Journal.</string>
445+
<string name="error_handling_dialog_button">Compris</string>
446+
<string name="first_run_dialog_title">Activer le vérificateur de mises à jour ?</string>
447+
<string name="data_migration_dialog_message">PipePipe 5 utilise un nouveau nom de paquet pour éviter les conflits avec les versions antérieures. Cela signifie :\n• La version 5 s\'installe comme une application distincte\n• Votre installation existante reste inchangée\n\nComment migrer vos données :\n1. Ouvrez votre ancienne application PipePipe (par exemple, version 4.7.3)\n2. Exportez une sauvegarde dans les Paramètres\n3. Ouvrez le nouveau PipePipe 5\n4. Importez la sauvegarde dans les Paramètres\n\nNote pour les testeurs bêta : Si vous utilisez déjà la version 5.0.0-beta1, veuillez exporter et importer vos données à nouveau pour appliquer les dernières modifications.</string>
448+
<string name="welcome_dialog_title">Un tout nouveau PipePipe !</string>
449+
<string name="first_run_dialog_enable">Activer</string>
450+
<string name="first_run_dialog_message">Restez à jour avec les dernières fonctionnalités et corrections de bugs en activant les vérifications automatiques des mises à jour.</string>
451+
<string name="error_handling_dialog_title">Gestion des erreurs améliorée</string>
452+
<string name="data_migration_dialog_button">Compris</string>
453+
<string name="welcome_dialog_message">Bienvenue dans la version bêta de PipePipe 5 ! Nous sommes ravis que vous soyez parmi les premiers à l\'essayer.\n\nNous avons entièrement reconstruit l\'application pour la rendre plus rapide, plus fluide et plus intuitive.\n\nCeci est une version préliminaire, donc les choses ne sont peut-être pas encore parfaites. C\'est là que vous intervenez ! Aidez-nous à améliorer PipePipe en partageant vos commentaires.</string>
454+
<string name="data_migration_dialog_title">Migration des données</string>
455+
<string name="first_run_dialog_no_thanks">Non, merci</string>
456+
<string name="welcome_dialog_button">Explorer l\'application</string>
444457
</resources>

0 commit comments

Comments
 (0)