Skip to content
Merged
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data class TemplatePack(
val templates: List<Template>,
val defaults: ExportDefaults = ExportDefaults(),
// Legacy field for backward compatibility - prefer defaults.defaultTemplateId
@Deprecated("Use defaults.defaultTemplateId instead")
@Deprecated("Use defaults.defaultTemplateId instead", ReplaceWith("defaults.defaultTemplateId"))
val defaultTemplateId: String? = null
) {
init {
Expand All @@ -66,6 +66,7 @@ data class TemplatePack(
* Get the effective default template ID, checking both new and legacy locations.
*/
fun getEffectiveDefaultTemplateId(): String? {
@Suppress("DEPRECATION")
return defaults.defaultTemplateId ?: defaultTemplateId
}

Expand Down Expand Up @@ -161,7 +162,7 @@ data class FullBackup(
val defaults: ExportDefaults = ExportDefaults(),
val settings: ExportedSettings? = null,
// Legacy field for backward compatibility - prefer defaults.defaultTemplateId
@Deprecated("Use defaults.defaultTemplateId instead")
@Deprecated("Use defaults.defaultTemplateId instead", ReplaceWith("defaults.defaultTemplateId"))
val defaultTemplateId: String? = null
) {
init {
Expand All @@ -173,7 +174,9 @@ data class FullBackup(
/**
* Get the effective default template ID, checking both new and legacy locations.
*/
@Suppress("DEPRECATION")
fun getEffectiveDefaultTemplateId(): String? {
@Suppress("DEPRECATION")
return defaults.defaultTemplateId ?: defaultTemplateId
Comment thread
H2OKing89 marked this conversation as resolved.
Resolved
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class GitHubAppUpdater(
"${appContext.packageName}.provider",
file
)
return Intent(Intent.ACTION_INSTALL_PACKAGE).apply {
return Intent(Intent.ACTION_VIEW).apply {
setDataAndType(uri, APK_MIME_TYPE)
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalClipboardManager
import kotlinx.coroutines.launch
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.platform.LocalClipboard
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.font.FontFamily
Expand All @@ -45,7 +47,8 @@ fun TemplateVariablesSheet(
onDismiss: () -> Unit
) {
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
val clipboardManager = LocalClipboardManager.current
val clipboardManager = LocalClipboard.current
val scope = rememberCoroutineScope()

ModalBottomSheet(
onDismissRequest = onDismiss,
Expand Down Expand Up @@ -93,7 +96,13 @@ fun TemplateVariablesSheet(
placeholder = key,
description = description,
onCopy = {
clipboardManager.setText(AnnotatedString(key))
scope.launch {
clipboardManager.setClipEntry(
androidx.compose.ui.platform.ClipEntry(
android.content.ClipData.newPlainText("Template Variable", key)
)
)
}
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalClipboardManager
import kotlinx.coroutines.launch
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.platform.LocalClipboard
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
Expand Down Expand Up @@ -83,7 +85,8 @@ fun ImportScreen(
val vm = LocalImportViewModel.current
val soundPlayer = LocalSoundPlayer.current
val context = LocalContext.current
val clipboardManager = LocalClipboardManager.current
val clipboardManager = LocalClipboard.current
val scope = rememberCoroutineScope()
val maxImportSizeLabel = remember { formatBytesAsMb(MAX_IMPORT_SIZE_BYTES.toLong()) }
val uiState by vm.uiState.collectAsStateWithLifecycle()

Expand Down Expand Up @@ -196,17 +199,19 @@ fun ImportScreen(
error = uiState.error,
onOpenFile = { vm.onOpenFileRequest() },
onPaste = {
scope.launch {
try {
clipboardManager.getText()?.let {
if (exceedsImportLimit(it.text, MAX_IMPORT_SIZE_BYTES)) {
clipboardManager.getClipEntry()?.let {
val text = it.clipData.getItemAt(0).text.toString()
if (exceedsImportLimit(text, MAX_IMPORT_SIZE_BYTES)) {
soundPlayer.playBeep()
Toast.makeText(
context,
context.getString(R.string.toast_import_too_large, maxImportSizeLabel),
Toast.LENGTH_LONG
).show()
} else {
vm.onPasteContent(it.text)
vm.onPasteContent(text)
}
} ?: Toast.makeText(context, R.string.toast_clipboard_empty, Toast.LENGTH_SHORT).show()
Comment thread
H2OKing89 marked this conversation as resolved.
Resolved
} catch (e: SecurityException) {
Expand All @@ -215,6 +220,7 @@ fun ImportScreen(
Toast.makeText(context, R.string.toast_cannot_access_clipboard, Toast.LENGTH_SHORT).show()
}
}
}
)
}
is ImportStep.Validated -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ private fun ContentEditorField(
Text(
text = stringResource(
R.string.error_template_missing_placeholders,
contentError ?: ""
contentError
),
color = MaterialTheme.colorScheme.error
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ fun TemplateListScreen(
if (uiState.showTemplateLimitWarning && !uiState.warningDismissed) {
item(key = "template_limit_warning") {
NeonWarningBanner(
text = stringResource(
R.string.warning_template_limit,
text = androidx.compose.ui.res.pluralStringResource(
R.plurals.warning_template_limit,
uiState.templates.size,
uiState.templates.size
),
onDismiss = { haptic(); vm.dismissTemplateLimitWarning() }
Expand Down
19 changes: 11 additions & 8 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@
<string name="text_template_actions_help">Tap to select. Actions: edit, duplicate, delete.</string>
<string name="text_no_templates_match">No templates match "%1$s"</string>
<string name="text_no_templates_for_filters">No templates match the selected filters.</string>
<string name="warning_template_limit">You have %1$d templates. Consider archiving unused ones for best performance.</string>
<plurals name="warning_template_limit">
<item quantity="one">You have %1$d template. Consider archiving unused ones for best performance.</item>
<item quantity="other">You have %1$d templates. Consider archiving unused ones for best performance.</item>
</plurals>
<string name="content_desc_builtin_template">Built-in (duplicate to customize)</string>
<string name="content_desc_duplicate_to_edit">Duplicate to edit</string>
<string name="content_desc_edit_template">Edit template</string>
Expand All @@ -113,7 +116,7 @@
<string name="title_import">Import</string>
<string name="title_import_intro">Import Templates or a Full Backup</string>
<string name="text_import_intro_description">You can import from a file or paste the backup text directly.</string>
<string name="status_decoding">Decoding...</string>
<string name="status_decoding">Decoding&#8230;</string>
<string name="content_desc_select_file_to_import">Select file to import</string>
<string name="action_select_file">Select File</string>
<string name="content_desc_paste_from_clipboard">Paste from clipboard</string>
Expand All @@ -130,7 +133,7 @@
<string name="error_invalid_import_data">Invalid import data</string>
<string name="error_import_failed">Failed to apply import: %1$s</string>
<string name="error_unexpected_import">An unexpected error occurred during import: %1$s</string>
<string name="status_importing">Importing...</string>
<string name="status_importing">Importing&#8230;</string>
<string name="content_desc_confirm_import">Confirm import</string>
<string name="content_desc_success">Success</string>
<string name="title_import_complete">Import Complete!</string>
Expand Down Expand Up @@ -230,20 +233,20 @@
<string name="title_update_available">Update Available</string>
<string name="text_update_download_confirm">Download v%1$s (%2$s)? This may use mobile data.</string>
<string name="action_download_update">Download Update</string>
<string name="status_download_queued">Download queued...</string>
<string name="status_downloading_unknown">Downloading update...</string>
<string name="status_download_queued">Download queued&#8230;</string>
<string name="status_downloading_unknown">Downloading update&#8230;</string>
<string name="status_downloading_progress">Downloading %1$s of %2$s (%3$d%%)</string>
<string name="status_verifying_update">Verifying update...</string>
<string name="status_verifying_update">Verifying update&#8230;</string>
<string name="status_ready_to_install">Update ready to install</string>
<string name="status_permission_required">Allow app installs for Q Welcome in system settings, then retry.</string>
<string name="status_installing">Launching Android installer...</string>
<string name="status_installing">Launching Android installer&#8230;</string>
<string name="action_install_update">Install Update</string>
<string name="action_open_install_settings">Allow Install</string>
<string name="action_retry_install">Retry Install</string>
<string name="content_desc_dismiss_update">Dismiss update</string>
<string name="status_check_failed">Check failed</string>
<string name="content_desc_check_updates">Check for updates</string>
<string name="status_checking_updates">Checking...</string>
<string name="status_checking_updates">Checking&#8230;</string>
<string name="action_check_updates">Check for Updates</string>
<string name="content_desc_view_github">View on GitHub</string>
<string name="action_view_github">View on GitHub</string>
Expand Down
20 changes: 10 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[versions]
agp = "9.1.0"
coreKtx = "1.17.0"
agp = "9.1.1"
coreKtx = "1.18.0"
appcompat = "1.7.1"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
# Lifecycle versions updated to 2.10.0 stable (Jan 2026)
# Includes collectAsStateWithLifecycle and other improvements
lifecycle = "2.10.0"
activityCompose = "1.12.2"
kotlin = "2.2.10"
composeBom = "2026.01.00"
datastorePreferences = "1.2.0"
activityCompose = "1.13.0"
kotlin = "2.3.20"
composeBom = "2026.03.01"
datastorePreferences = "1.2.1"
splashscreen = "1.2.0"
qrose = "1.1.0"
kotlinxSerializationJson = "1.10.0"
protobuf = "3.25.5"
kotlinxSerializationJson = "1.11.0"
protobuf = "4.34.1"
protobufPlugin = "0.9.5"
coroutinesTest = "1.10.2"
turbine = "1.2.1"
mockk = "1.14.7"
# Navigation Compose
navigationCompose = "2.9.0"
navigationCompose = "2.9.7"
# Firebase
firebaseBom = "34.8.0"
firebaseBom = "34.12.0"
googleServices = "4.4.4"
firebaseCrashlytics = "3.0.3"

Expand Down
3 changes: 2 additions & 1 deletion proto/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ dependencies {

protobuf {
protoc {
artifact = libs.protobuf.protoc.get().toString()
// The protobuf plugin requires standard artifact spec format to not trigger gradle deprecations
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}"
}
generateProtoTasks {
all().forEach {
Expand Down
Loading