Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class PebbleService: Service(), KoinComponent {

val notification = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setContentTitle("Pebble")
.setContentText("Keeping Pebble connection alive")
.setContentText(getString(R.string.foreground_notification_text))
.setOngoing(true)
.setSmallIcon(R.mipmap.ic_launcher)
.build()
Expand Down
4 changes: 4 additions & 0 deletions composeApp/src/androidMain/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<string name="intent_filter_notion_login">Vinculación de Notion</string>
<string name="foreground_notification_text">Manteniendo la conexión con Pebble</string>
</resources>
1 change: 1 addition & 0 deletions composeApp/src/androidMain/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<resources>
<string name="app_name">Pebble</string>
<string name="intent_filter_notion_login">Notion Linking</string>
<string name="foreground_notification_text">Keeping Pebble connection alive</string>
</resources>
40 changes: 40 additions & 0 deletions composeApp/src/commonMain/composeResources/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<string name="bug_report">Informe de error</string>
<string name="report_sent">¡Informe enviado!</string>
<string name="send_report">Enviar informe</string>
<string name="please_describe_bug">Describe el error</string>
<string name="this_is_a">Es un:</string>
<string name="index_bug">Error de Index</string>
<string name="watch_bug">Error del reloj</string>
<string name="must_sign_in_submit_report">Debes iniciar sesión para enviar un informe de error</string>
<string name="sign_in">Iniciar sesión</string>
<string name="take_watch_screenshot">Hacer captura del reloj</string>
<string name="capturing_screenshot">Capturando pantalla...</string>
<string name="remove_n_files">Eliminar %1$d archivo(s)</string>
<string name="add_images">Añadir imágenes</string>
<string name="my_bug_reports">Mis informes de error</string>
<string name="sign_in_with_google">Iniciar sesión con Google</string>
<string name="report_with_subject">Informe: %1$s</string>
<string name="attach_files">Adjuntar archivos</string>
<string name="attach_more_logs">Adjuntar más registros</string>
<string name="onboarding_signin_backup">Inicia sesión para hacer una copia de seguridad de tu cuenta Pebble: aplicaciones, ajustes, etc.</string>
<string name="default_notes_reminders">Notas y recordatorios predeterminados</string>
<string name="notification_shortcut">Atajo de notificación</string>
<string name="music_play_pause">Reproducir/Pausar música</string>
<string name="secondary_action">Acción secundaria</string>
<string name="not_working_report_bug">¿No funciona? Informa de un error</string>
<string name="no_action_taken">Sin acción</string>
<string name="thinking_ellipsis">Pensando...</string>
<string name="waiting_pebble_restart">Esperando a que tu Pebble se reinicie..</string>
<string name="waiting_pebble_connect">Esperando a que tu Pebble se conecte..</string>
<string name="checking_pebbleos_updates">Buscando actualizaciones de PebbleOS..</string>
<string name="updating_pebbleos">Actualizando tu reloj a la última versión de PebbleOS...</string>
<string name="once_pebble_connected">Cuando tu Pebble esté conectado, lo configuraremos</string>
<string name="install_language_pack">Instalar un paquete de idioma</string>
<string name="installing_language_pack">Instalando %1$s</string>
<string name="currently_installed_lang">Instalado actualmente: %1$s</string>
<string name="configure_your_watch">Configura tu reloj</string>
<string name="speech_recognition">Reconocimiento de voz</string>
<string name="configure_more_in_settings">Configura más en Ajustes</string>
</resources>
40 changes: 38 additions & 2 deletions composeApp/src/commonMain/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<resources>

</resources>
<string name="bug_report">Bug Report</string>
<string name="report_sent">Report Sent!</string>
<string name="send_report">Send Report</string>
<string name="please_describe_bug">Please describe the bug</string>
<string name="this_is_a">This is a:</string>
<string name="index_bug">Index bug</string>
<string name="watch_bug">Watch bug</string>
<string name="must_sign_in_submit_report">You must sign in to submit a bug report</string>
<string name="sign_in">Sign In</string>
<string name="take_watch_screenshot">Take Watch Screenshot</string>
<string name="capturing_screenshot">Capturing screenshot...</string>
<string name="remove_n_files">Remove %1$d file(s)</string>
<string name="add_images">Add Images</string>
<string name="my_bug_reports">My Bug Reports</string>
<string name="sign_in_with_google">Sign in with Google</string>
<string name="report_with_subject">Report: %1$s</string>
<string name="attach_files">Attach Files</string>
<string name="attach_more_logs">Attach More Logs</string>
<string name="onboarding_signin_backup">Sign in to backup your Pebble account to backup apps, settings, etc</string>
<string name="default_notes_reminders">Default Notes &amp; Reminders</string>
<string name="notification_shortcut">Notification Shortcut</string>
<string name="music_play_pause">Music Play/Pause</string>
<string name="secondary_action">Secondary action</string>
<string name="not_working_report_bug">Not working? Report a bug</string>
<string name="no_action_taken">No action taken</string>
<string name="thinking_ellipsis">Thinking...</string>
<string name="waiting_pebble_restart">Waiting for your Pebble to restart..</string>
<string name="waiting_pebble_connect">Waiting for your Pebble to connect..</string>
<string name="checking_pebbleos_updates">Checking for PebbleOS updates..</string>
<string name="updating_pebbleos">Updating your watch to the latest version of PebbleOS...</string>
<string name="once_pebble_connected">Once your Pebble is connected, we\'ll get it set up</string>
<string name="install_language_pack">Install a language pack</string>
<string name="installing_language_pack">Installing %1$s</string>
<string name="currently_installed_lang">Currently installed: %1$s</string>
<string name="configure_your_watch">Configure your watch</string>
<string name="speech_recognition">Speech Recognition</string>
<string name="configure_more_in_settings">Configure more in Settings</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import org.koin.core.module.dsl.singleOf
import org.koin.core.module.dsl.viewModelOf
import org.koin.dsl.bind
import org.koin.dsl.module
import locale.LocaleProvider
import locale.RealLocaleProvider
import theme.RealThemeProvider
import theme.ThemeProvider

Expand All @@ -63,6 +65,7 @@ val utilModule = module {
singleOf(::PushMessaging)
singleOf(::CoreDeepLinkHandler)
singleOf(::RealThemeProvider) bind ThemeProvider::class
singleOf(::RealLocaleProvider) bind LocaleProvider::class
single { Settings() }
viewModelOf(::OnboardingViewModel)
singleOf(::EnableExperimentalDevices)
Expand Down
17 changes: 10 additions & 7 deletions composeApp/src/commonMain/kotlin/coredevices/coreapp/ui/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.russhwolf.settings.Settings
import coredevices.coreapp.ui.navigation.AppNavHost
import coredevices.coreapp.ui.screens.SHOWN_ONBOARDING
import coredevices.pebble.ui.PebbleRoutes
import locale.LocalizedApp
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.koinInject
import theme.AppTheme
Expand All @@ -28,13 +29,15 @@ fun App() {
navHostController.removeOnDestinationChangedListener(listener)
}
}
AppTheme {
val settings: Settings = koinInject()
val startDestination = if (settings.getBoolean(SHOWN_ONBOARDING, false)) {
PebbleRoutes.WatchHomeRoute
} else {
CommonRoutes.OnboardingRoute
LocalizedApp {
AppTheme {
val settings: Settings = koinInject()
val startDestination = if (settings.getBoolean(SHOWN_ONBOARDING, false)) {
PebbleRoutes.WatchHomeRoute
} else {
CommonRoutes.OnboardingRoute
}
AppNavHost(navHostController, startDestination)
}
AppNavHost(navHostController, startDestination)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,21 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import co.touchlab.kermit.Logger
import coreapp.util.generated.resources.Res
import coreapp.composeapp.generated.resources.Res
import coreapp.composeapp.generated.resources.add_images
import coreapp.composeapp.generated.resources.bug_report
import coreapp.composeapp.generated.resources.capturing_screenshot
import coreapp.composeapp.generated.resources.index_bug
import coreapp.composeapp.generated.resources.must_sign_in_submit_report
import coreapp.composeapp.generated.resources.please_describe_bug
import coreapp.composeapp.generated.resources.remove_n_files
import coreapp.composeapp.generated.resources.report_sent
import coreapp.composeapp.generated.resources.send_report
import coreapp.composeapp.generated.resources.sign_in
import coreapp.composeapp.generated.resources.take_watch_screenshot
import coreapp.composeapp.generated.resources.this_is_a
import coreapp.composeapp.generated.resources.watch_bug
import coreapp.util.generated.resources.Res as UtilRes
import coreapp.util.generated.resources.back
import coredevices.pebble.rememberLibPebble
import coredevices.pebble.ui.TopBarIconButtonWithToolTip
Expand Down Expand Up @@ -305,13 +319,13 @@ fun BugReportScreen(
snackbarHost = { SnackbarHost(snackbarHostState) },
topBar = {
TopAppBar(
title = { Text("Bug Report") },
title = { Text(stringResource(Res.string.bug_report)) },
navigationIcon = {
IconButton(onClick = coreNav::goBack) {
Icon(
Icons.AutoMirrored.Default.ArrowBack,
contentDescription = stringResource(
Res.string.back
UtilRes.string.back
)
)
}
Expand Down Expand Up @@ -371,11 +385,11 @@ fun BugReportScreen(
tint = MaterialTheme.colorScheme.onPrimary
)
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Text("Report Sent!")
Text(stringResource(Res.string.report_sent))
}

else -> {
Text("Send Report")
Text(stringResource(Res.string.send_report))
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Icon(
Icons.Default.ChevronRight,
Expand All @@ -400,13 +414,13 @@ fun BugReportScreen(
modifier = Modifier.height(200.dp).fillMaxWidth().padding(16.dp),
value = userMessage,
onValueChange = setUserMessage,
label = { Text("Please describe the bug") },
label = { Text(stringResource(Res.string.please_describe_bug)) },
keyboardOptions = KeyboardOptions(
capitalization = KeyboardCapitalization.Sentences
)
)
if (coreConfig.enableIndex) {
Text("This is a:", modifier = Modifier.padding(top = 8.dp))
Text(stringResource(Res.string.this_is_a), modifier = Modifier.padding(top = 8.dp))
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.padding(horizontal = 16.dp)
Expand All @@ -417,18 +431,18 @@ fun BugReportScreen(
isWatch = false
watchScreenshot = null
},
label = { Text("Index bug") }
label = { Text(stringResource(Res.string.index_bug)) }
)
FilterChip(
selected = isWatch,
onClick = { isWatch = true },
label = { Text("Watch bug") }
label = { Text(stringResource(Res.string.watch_bug)) }
)
}
}
if (user == null) {
Text(
"You must sign in to submit a bug report",
stringResource(Res.string.must_sign_in_submit_report),
textAlign = TextAlign.Center,
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(4.dp),
Expand All @@ -437,7 +451,7 @@ fun BugReportScreen(
Button(
onClick = { showSignInDialog = true },
) {
Text("Sign In")
Text(stringResource(Res.string.sign_in))
}
Spacer(Modifier.height(8.dp))
}
Expand Down Expand Up @@ -481,15 +495,15 @@ fun BugReportScreen(
modifier = Modifier.size(ButtonDefaults.IconSize)
)
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Text("Take Watch Screenshot")
Text(stringResource(Res.string.take_watch_screenshot))
}
} else if (screenshotLoading) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
CircularProgressIndicator(modifier = Modifier.size(24.dp), strokeWidth = 2.dp)
Text("Capturing screenshot...", fontSize = 14.sp)
Text(stringResource(Res.string.capturing_screenshot), fontSize = 14.sp)
}
} else {
watchScreenshot?.let { screenshot ->
Expand Down Expand Up @@ -709,15 +723,15 @@ private fun AttachmentButtons(
modifier = Modifier.size(ButtonDefaults.IconSize)
)
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Text("Remove ${attachments.size} file(s)")
Text(stringResource(Res.string.remove_n_files, attachments.size))
} else {
Icon(
Icons.Default.AttachFile,
contentDescription = "Attach an image",
modifier = Modifier.size(ButtonDefaults.IconSize)
)
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Text("Add Images")
Text(stringResource(Res.string.add_images))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import co.touchlab.kermit.Logger
import coreapp.composeapp.generated.resources.Res
import coreapp.composeapp.generated.resources.my_bug_reports
import coreapp.composeapp.generated.resources.sign_in_with_google
import coredevices.coreapp.api.AtlasTicketDetails
import coredevices.coreapp.api.BugReports
import coredevices.util.auth.GoogleAuthUtil
Expand All @@ -48,6 +51,7 @@ import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.auth.auth
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import org.jetbrains.compose.resources.stringResource
import kotlinx.coroutines.launch
import org.koin.compose.koinInject

Expand Down Expand Up @@ -107,7 +111,7 @@ fun BugReportsListScreen(
Scaffold(
topBar = {
TopAppBar(
title = { Text("My Bug Reports") },
title = { Text(stringResource(Res.string.my_bug_reports)) },
navigationIcon = {
IconButton(onClick = coreNav::goBack) {
Icon(
Expand Down Expand Up @@ -158,7 +162,7 @@ fun BugReportsListScreen(
// Show sign in button if user is not authenticated
if (user == null) {
Button(onClick = { signIn() }) {
Text("Sign in with Google")
Text(stringResource(Res.string.sign_in_with_google))
}
} else {
// Show refresh button if user is authenticated but there was an error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import co.touchlab.kermit.Logger
import com.russhwolf.settings.Settings
import com.russhwolf.settings.set
import coreapp.composeapp.generated.resources.Res
import coreapp.composeapp.generated.resources.onboarding_signin_backup
import coreapp.composeapp.generated.resources.pebble_logo
import coredevices.pebble.ui.PebbleRoutes
import coredevices.pebble.ui.PreviewWrapper
Expand All @@ -64,6 +65,7 @@ import coredevices.util.requestIsFullScreen
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.koinInject
import org.koin.compose.viewmodel.koinViewModel
Expand Down Expand Up @@ -276,7 +278,7 @@ fun OnboardingScreen(
modifier = Modifier.padding(bottom = 25.dp),
)
Spacer(modifier = Modifier.height(10.dp))
Text("Sign in to backup your Pebble account to backup apps, settings, etc", textAlign = TextAlign.Center)
Text(stringResource(Res.string.onboarding_signin_backup), textAlign = TextAlign.Center)
SignInButtons(
onDismiss = { viewModel.stage.value = OnboardingStage.Done },
primaryColor = true,
Expand Down
Loading
Loading