diff --git a/CHANGELOG.md b/CHANGELOG.md
index a668a06..68b7f8e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,24 @@
What changed in each release of LLeMbas for Android. Versions follow SemVer; until 1.0.0 the app
is in alpha and releases come off `main`.
+## [Unreleased]
+
+### Added
+
+- **Share to LLeMbas, with a say in it.** *Ask LLeMbas* in any app's share menu now opens a
+ sheet over that app: what came in (the text or link, the files by name), a line for what to do
+ with it (optional), and where it goes -- a **new chat** or the **last assistant chat**. Files
+ are uploaded and go with the message; the chat then opens in the app.
+- **A home-screen widget**: *Ask anything* opens the assistant, the microphone opens it
+ listening, and the clock opens the last assistant chat. It shows nothing from your account.
+- **Launcher shortcuts** (long-press the icon): Ask LLeMbas, Speak, Last chat.
+- **A headset's voice button** opens the assistant listening, when LLeMbas answers it; over the
+ lock screen it asks to unlock first.
+
+### Changed
+
+- The Quick Settings tile always shows as ready, never greyed out.
+
## [1.0.0-beta.6] — 2026-11-10
For LLeMbas server 2.0 (2.0.0-beta.9 or later for schedules on a computer, the update check through the instance, pinning, folders, memory and search).
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index cd87e0f..6efbcdf 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -38,11 +38,11 @@
-
-
+
+
+
+
+
+
+
+
+
+
+ android:taskAffinity=""
+ android:theme="@style/Theme.Lembas.Sheet"
+ android:windowSoftInputMode="adjustResize">
@@ -78,6 +89,17 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/eu/llembas/android/LembasApp.kt b/app/src/main/java/eu/llembas/android/LembasApp.kt
index 326e9d4..c8184bc 100644
--- a/app/src/main/java/eu/llembas/android/LembasApp.kt
+++ b/app/src/main/java/eu/llembas/android/LembasApp.kt
@@ -27,6 +27,8 @@ class LembasApp : Application() {
// LLeMbas 2.0 has no reports, so 0.1's channel for them goes rather than sit empty in
// the system's settings.
manager.deleteNotificationChannel("reports")
+ // The launcher's long-press shortcuts, in the app's language as it is now.
+ eu.llembas.android.widget.Shortcuts.publish(this)
}
companion object {
diff --git a/app/src/main/java/eu/llembas/android/assist/AskTileService.kt b/app/src/main/java/eu/llembas/android/assist/AskTileService.kt
index b301bf4..bdf63d0 100644
--- a/app/src/main/java/eu/llembas/android/assist/AskTileService.kt
+++ b/app/src/main/java/eu/llembas/android/assist/AskTileService.kt
@@ -3,17 +3,36 @@ package eu.llembas.android.assist
import android.app.PendingIntent
import android.content.Intent
import android.os.Build
+import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
+import eu.llembas.android.R
-/** A Quick Settings tile that opens the assistant's sheet: one more way in besides the power button. */
+/**
+ * A Quick Settings tile that opens the assistant's sheet: one more way in besides the power
+ * button. It is a button, not a switch -- always shown as ready (`STATE_INACTIVE`), never as
+ * "on", and the system's default (`STATE_UNAVAILABLE` on some phones until the first update)
+ * would grey it out. Over the lock screen the sheet opens there and asks to unlock before it
+ * sends anything, as from any other way in.
+ */
class AskTileService : TileService() {
+ override fun onStartListening() {
+ super.onStartListening()
+ qsTile?.apply {
+ state = Tile.STATE_INACTIVE
+ label = getString(R.string.tile_ask)
+ updateTile()
+ }
+ }
+
@android.annotation.SuppressLint("StartActivityAndCollapseDeprecated")
override fun onClick() {
super.onClick()
val intent = Intent(this, AssistActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
if (Build.VERSION.SDK_INT >= 34) {
// Android 14 refuses the Intent overload; the PendingIntent one is the way now.
- startActivityAndCollapse(PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE))
+ startActivityAndCollapse(
+ PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT),
+ )
} else {
@Suppress("DEPRECATION")
startActivityAndCollapse(intent)
diff --git a/app/src/main/java/eu/llembas/android/assist/AssistActivity.kt b/app/src/main/java/eu/llembas/android/assist/AssistActivity.kt
index 8f3f363..77b262a 100644
--- a/app/src/main/java/eu/llembas/android/assist/AssistActivity.kt
+++ b/app/src/main/java/eu/llembas/android/assist/AssistActivity.kt
@@ -3,6 +3,7 @@ package eu.llembas.android.assist
import android.Manifest
import android.app.KeyguardManager
import android.content.Context
+import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
@@ -17,6 +18,33 @@ import eu.llembas.android.auth.Prefs
import eu.llembas.android.lembas
import eu.llembas.android.ui.theme.LembasTheme
+/** What a way into the sheet asks for. */
+enum class Opening {
+ Sheet,
+ Listen,
+ Continue,
+ ;
+
+ companion object {
+ /**
+ * A headset's voice button sends `VOICE_COMMAND` (or, locked, `VOICE_SEARCH_HANDS_FREE`):
+ * the person means to speak, so the sheet opens listening whatever Settings says.
+ */
+ fun of(intent: Intent): Opening = when {
+ intent.getBooleanExtra(AssistActivity.EXTRA_LISTEN, false) -> Listen
+ intent.action == AssistActivity.ACTION_CONTINUE -> Continue
+ intent.action in LISTENING -> Listen
+ else -> Sheet
+ }
+
+ private val LISTENING = setOf(
+ AssistActivity.ACTION_LISTEN,
+ Intent.ACTION_VOICE_COMMAND,
+ "android.speech.action.VOICE_SEARCH_HANDS_FREE",
+ )
+ }
+}
+
/**
* The assistant as an activity: what the Quick Settings tile, the "Ask" shortcut and a plain
* `ACTION_ASSIST` open, and where the voice-interaction session hands over what needs an
@@ -27,6 +55,7 @@ import eu.llembas.android.ui.theme.LembasTheme
*/
class AssistActivity : ComponentActivity() {
private lateinit var controller: AssistController
+ private lateinit var keyguard: KeyguardManager
/** Whether the phone is locked: the sheet shows nothing from the account until it is not. */
private val locked = mutableStateOf(false)
@@ -41,31 +70,9 @@ class AssistActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
setShowWhenLocked(true)
controller = AssistController(this, lifecycleScope)
- val keyguard = getSystemService(KeyguardManager::class.java)
+ keyguard = getSystemService(KeyguardManager::class.java)
locked.value = keyguard.isKeyguardLocked
- val waiting = intent.getStringExtra(EXTRA_QUESTION).orEmpty()
- val wantsMic = intent.getBooleanExtra(EXTRA_LISTEN, false)
- if (keyguard.isKeyguardLocked) {
- keyguard.requestDismissKeyguard(
- this,
- object : KeyguardManager.KeyguardDismissCallback() {
- override fun onDismissSucceeded() {
- locked.value = false
- if (waiting.isNotBlank()) controller.ask(waiting) else controller.opened(locked = false)
- }
-
- override fun onDismissCancelled() = finish()
-
- override fun onDismissError() = finish()
- },
- )
- } else if (waiting.isNotBlank()) {
- controller.ask(waiting)
- } else if (wantsMic && !controller.micAllowed()) {
- mic.launch(Manifest.permission.RECORD_AUDIO)
- } else {
- controller.opened(locked = false)
- }
+ take(intent)
setContent {
val prefs by lembas.instances.prefs.collectAsState(initial = Prefs())
LembasTheme(prefs.theme) {
@@ -94,6 +101,50 @@ class AssistActivity : ComponentActivity() {
}
}
+ /** Opened again while it is up -- the headset's button pressed twice, the tile again. */
+ override fun onNewIntent(intent: Intent) {
+ super.onNewIntent(intent)
+ setIntent(intent)
+ take(intent)
+ }
+
+ /**
+ * What the way in asked for: a question handed over by the session, listening (the headset's
+ * voice button, the widget's microphone, the Speak shortcut), the last assistant chat (the
+ * widget, the shortcut), or just the sheet. Over the lock screen each waits for Android to
+ * unlock first.
+ */
+ private fun take(intent: Intent) {
+ val opening = Opening.of(intent)
+ val waiting = intent.getStringExtra(EXTRA_QUESTION).orEmpty()
+ val go = {
+ when {
+ waiting.isNotBlank() -> controller.ask(waiting)
+ opening == Opening.Continue -> controller.continueWhenReady()
+ opening == Opening.Listen && !controller.micAllowed() -> mic.launch(Manifest.permission.RECORD_AUDIO)
+ opening == Opening.Listen -> controller.opened(locked = false, listen = true)
+ else -> controller.opened(locked = false)
+ }
+ }
+ if (keyguard.isKeyguardLocked) {
+ keyguard.requestDismissKeyguard(
+ this,
+ object : KeyguardManager.KeyguardDismissCallback() {
+ override fun onDismissSucceeded() {
+ locked.value = false
+ go()
+ }
+
+ override fun onDismissCancelled() = finish()
+
+ override fun onDismissError() = finish()
+ },
+ )
+ } else {
+ go()
+ }
+ }
+
override fun onDestroy() {
controller.close()
super.onDestroy()
@@ -104,5 +155,17 @@ class AssistActivity : ComponentActivity() {
/** Handed over by the session: ask for the microphone, then listen. */
const val EXTRA_LISTEN = "eu.llembas.android.LISTEN"
+
+ /** Open listening: the widget's microphone and the Speak shortcut. */
+ const val ACTION_LISTEN = "eu.llembas.android.action.LISTEN"
+
+ /** Open at the last chat the assistant made: the widget and the shortcut. */
+ const val ACTION_CONTINUE = "eu.llembas.android.action.CONTINUE"
+
+ /** The sheet, listening. */
+ fun listening(context: Context): Intent = Intent(context, AssistActivity::class.java).setAction(ACTION_LISTEN)
+
+ /** The sheet, at the last assistant chat. */
+ fun continuing(context: Context): Intent = Intent(context, AssistActivity::class.java).setAction(ACTION_CONTINUE)
}
}
diff --git a/app/src/main/java/eu/llembas/android/assist/AssistController.kt b/app/src/main/java/eu/llembas/android/assist/AssistController.kt
index 707f5b3..6de559b 100644
--- a/app/src/main/java/eu/llembas/android/assist/AssistController.kt
+++ b/app/src/main/java/eu/llembas/android/assist/AssistController.kt
@@ -168,14 +168,25 @@ class AssistController(private val context: Context, private val scope: Coroutin
/**
* The sheet came up. It starts listening at once -- the microphone first, as an assistant
* opens -- unless Settings says not to, the phone is locked (nothing is sent from the lock
- * screen), or the microphone is not allowed yet (that needs an activity to ask).
+ * screen), or the microphone is not allowed yet (that needs an activity to ask). [listen]
+ * is a way in that means to speak -- a headset's voice button -- and listens regardless.
*/
- fun opened(locked: Boolean) {
+ fun opened(locked: Boolean, listen: Boolean = false) {
scope.launch {
ready.join()
val prefs = context.lembas.instances.prefs.first()
val s = _state.value
- if (s.signedIn && !locked && prefs.assistantListens && s.canListen && s.empty && !s.listening && micAllowed()) listen()
+ if (s.signedIn && !locked && (listen || prefs.assistantListens) && s.canListen && !s.listening && micAllowed()) {
+ if (listen || s.empty) listen()
+ }
+ }
+ }
+
+ /** Open at the last assistant chat, once it is known which that is. */
+ fun continueWhenReady() {
+ scope.launch {
+ ready.join()
+ if (_state.value.last != null) continueLast() else opened(locked = false)
}
}
diff --git a/app/src/main/java/eu/llembas/android/share/ShareActivity.kt b/app/src/main/java/eu/llembas/android/share/ShareActivity.kt
index 4f97004..6796524 100644
--- a/app/src/main/java/eu/llembas/android/share/ShareActivity.kt
+++ b/app/src/main/java/eu/llembas/android/share/ShareActivity.kt
@@ -7,108 +7,131 @@ import android.os.Bundle
import android.provider.OpenableColumns
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
-import androidx.compose.material3.CircularProgressIndicator
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.Surface
-import androidx.compose.material3.Text
-import androidx.compose.material3.TextButton
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.unit.dp
+import androidx.activity.enableEdgeToEdge
+import androidx.compose.runtime.collectAsState
+import androidx.compose.runtime.getValue
import androidx.core.content.IntentCompat
import androidx.lifecycle.lifecycleScope
import eu.llembas.android.AppLanguage
import eu.llembas.android.MainActivity
import eu.llembas.android.R
+import eu.llembas.android.api.ApiException
+import eu.llembas.android.assist.AssistSheetFrame
+import eu.llembas.android.assist.LastAssist
+import eu.llembas.android.auth.Prefs
import eu.llembas.android.lembas
import eu.llembas.android.push.Notifications
import eu.llembas.android.ui.explain
import eu.llembas.android.ui.theme.LembasTheme
import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
/**
- * "Share to LLeMbas": text, a link, a picture or a file from any app starts a new chat with it.
- * Files are uploaded first and bound to the first message, as the composer's are.
+ * "Ask LLeMbas" in any app's share menu: text, a link, a picture or files. A sheet over the app
+ * it came from says what came in, takes a line of what to do with it, and sends it to a new chat
+ * or to the last chat the assistant made; files are uploaded first and bound to that message, as
+ * the composer's are. The chat then opens in the app. A new chat made here becomes the
+ * assistant's last chat, so the next share can follow it.
*/
-class ShareActivity : ComponentActivity() {
- private val failure = mutableStateOf(null)
+class ShareActivity :
+ ComponentActivity(),
+ ShareActions {
+ private val state = MutableStateFlow(ShareState())
+ private var uris: List = emptyList()
override fun attachBaseContext(newBase: Context) = super.attachBaseContext(AppLanguage.wrap(newBase))
override fun onCreate(savedInstanceState: Bundle?) {
+ enableEdgeToEdge()
super.onCreate(savedInstanceState)
+ uris = when (intent.action) {
+ Intent.ACTION_SEND -> listOfNotNull(IntentCompat.getParcelableExtra(intent, Intent.EXTRA_STREAM, Uri::class.java))
+ Intent.ACTION_SEND_MULTIPLE -> IntentCompat.getParcelableArrayListExtra(intent, Intent.EXTRA_STREAM, Uri::class.java).orEmpty()
+ else -> emptyList()
+ }
+ val text = listOfNotNull(intent.getStringExtra(Intent.EXTRA_SUBJECT), intent.getCharSequenceExtra(Intent.EXTRA_TEXT)?.toString())
+ .filter { it.isNotBlank() }
+ .distinct()
+ .joinToString("\n\n")
+ .trim()
+ state.update { it.copy(text = text, files = uris.map { uri -> SharedFile(nameOf(uri), (contentResolver.getType(uri) ?: "").startsWith("image/")) }) }
+ lifecycleScope.launch {
+ val store = lembas.instances
+ val prefs = store.prefs.first()
+ state.update {
+ it.copy(
+ signedIn = store.current() != null,
+ last = prefs.lastAssistChat.takeIf { id -> id.isNotBlank() && !prefs.assistantTemporary }
+ ?.let { id -> LastAssist(id, prefs.lastAssistTitle, prefs.lastAssistAt) },
+ )
+ }
+ }
setContent {
- LembasTheme {
- Surface(Modifier.fillMaxSize()) {
- Column(
- Modifier.fillMaxSize().padding(24.dp),
- verticalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterVertically),
- horizontalAlignment = Alignment.CenterHorizontally,
- ) {
- val error = failure.value
- if (error == null) {
- CircularProgressIndicator()
- Text(stringResource(R.string.share_sending))
- } else {
- Text(error, color = MaterialTheme.colorScheme.error)
- TextButton(onClick = { finish() }) { Text(stringResource(R.string.close)) }
- }
+ val prefs by lembas.instances.prefs.collectAsState(initial = Prefs())
+ val shown by state.collectAsState()
+ LembasTheme(prefs.theme) {
+ AssistSheetFrame(onDismiss = ::cancel) { handle, _ -> ShareSheetContent(shown, this@ShareActivity, handle) }
+ }
+ }
+ }
+
+ override fun cancel() = finish()
+
+ override fun send(ask: String, toLast: Boolean) {
+ if (state.value.sending) return
+ state.update { it.copy(sending = true, error = null) }
+ lifecycleScope.launch {
+ try {
+ val store = lembas.instances
+ val api = store.client() ?: run {
+ startActivity(Intent(this@ShareActivity, MainActivity::class.java))
+ finish()
+ return@launch
+ }
+ val now = state.value
+ val into = if (toLast) now.last?.chatId else null
+ val files = uris.map { uri ->
+ val bytes = withContext(Dispatchers.IO) { contentResolver.openInputStream(uri)?.use { it.readBytes() } ?: ByteArray(0) }
+ api.upload(nameOf(uri), contentResolver.getType(uri) ?: "application/octet-stream", bytes, into).id
+ }
+ val message = shareMessage(ask, now.text, getString(R.string.share_default_prompt))
+ val chatId = if (into != null) {
+ api.sendMessage(into, message, files)
+ into
+ } else {
+ val prefs = store.prefs.first()
+ val made = api.createChat(message, files, model = prefs.assistantModel.ifBlank { null })
+ store.savePrefs {
+ it.copy(
+ lastAssistChat = made.chat.id,
+ lastAssistTitle = ask.ifBlank { now.text.ifBlank { now.files.firstOrNull()?.name.orEmpty() } }.take(120),
+ lastAssistAt = System.currentTimeMillis(),
+ )
}
+ made.chat.id
}
+ startActivity(
+ Intent(this@ShareActivity, MainActivity::class.java)
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
+ .putExtra(Notifications.EXTRA_CHAT, chatId),
+ )
+ finish()
+ } catch (e: Exception) {
+ // The last chat deleted since: it is not offered again.
+ if (e is ApiException && e.status == 404 && toLast) {
+ lembas.instances.savePrefs { it.copy(lastAssistChat = "", lastAssistTitle = "", lastAssistAt = 0) }
+ state.update { it.copy(last = null) }
+ }
+ state.update { it.copy(sending = false, error = explain(e)) }
}
}
- lifecycleScope.launch { share(intent) }
}
- private suspend fun share(intent: Intent) {
- try {
- val api = lembas.instances.client() ?: run {
- startActivity(Intent(this, MainActivity::class.java))
- finish()
- return
- }
- val text = listOfNotNull(
- intent.getStringExtra(Intent.EXTRA_SUBJECT),
- intent.getStringExtra(Intent.EXTRA_TEXT),
- ).joinToString("\n\n").trim()
- val uris = when (intent.action) {
- Intent.ACTION_SEND -> listOfNotNull(IntentCompat.getParcelableExtra(intent, Intent.EXTRA_STREAM, Uri::class.java))
-
- Intent.ACTION_SEND_MULTIPLE ->
- IntentCompat.getParcelableArrayListExtra(intent, Intent.EXTRA_STREAM, Uri::class.java).orEmpty()
-
- else -> emptyList()
- }
- val files = uris.map { uri ->
- val (name, bytes) = withContext(Dispatchers.IO) {
- val name = contentResolver.query(uri, arrayOf(OpenableColumns.DISPLAY_NAME), null, null, null)?.use { c ->
- if (c.moveToFirst()) c.getString(0) else null
- } ?: "shared"
- name to (contentResolver.openInputStream(uri)?.use { it.readBytes() } ?: ByteArray(0))
- }
- api.upload(name, contentResolver.getType(uri) ?: "application/octet-stream", bytes).id
- }
- if (text.isBlank() && files.isEmpty()) {
- finish()
- return
- }
- val made = api.createChat(text.ifBlank { getString(R.string.share_default_prompt) }, files)
- startActivity(
- Intent(this, MainActivity::class.java)
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
- .putExtra(Notifications.EXTRA_CHAT, made.chat.id),
- )
- finish()
- } catch (e: Exception) {
- failure.value = explain(e)
- }
- }
+ private fun nameOf(uri: Uri): String = runCatching {
+ contentResolver.query(uri, arrayOf(OpenableColumns.DISPLAY_NAME), null, null, null)?.use { c -> if (c.moveToFirst()) c.getString(0) else null }
+ }.getOrNull() ?: uri.lastPathSegment ?: "shared"
}
diff --git a/app/src/main/java/eu/llembas/android/share/ShareSheet.kt b/app/src/main/java/eu/llembas/android/share/ShareSheet.kt
new file mode 100644
index 0000000..b86f1be
--- /dev/null
+++ b/app/src/main/java/eu/llembas/android/share/ShareSheet.kt
@@ -0,0 +1,230 @@
+package eu.llembas.android.share
+
+import androidx.compose.foundation.BorderStroke
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ColumnScope
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.heightIn
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.selection.selectable
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.automirrored.filled.InsertDriveFile
+import androidx.compose.material.icons.filled.EditNote
+import androidx.compose.material.icons.filled.History
+import androidx.compose.material.icons.filled.Image
+import androidx.compose.material3.Button
+import androidx.compose.material3.ButtonDefaults
+import androidx.compose.material3.Icon
+import androidx.compose.material3.LinearProgressIndicator
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.RadioButton
+import androidx.compose.material3.Surface
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
+import androidx.compose.material3.TextField
+import androidx.compose.material3.TextFieldDefaults
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.platform.LocalInspectionMode
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.semantics.Role
+import androidx.compose.ui.text.style.TextOverflow
+import androidx.compose.ui.unit.dp
+import eu.llembas.android.R
+import eu.llembas.android.assist.LastAssist
+import eu.llembas.android.ui.theme.LocalPalette
+
+/** One shared file, as the sheet names it. */
+data class SharedFile(val name: String, val image: Boolean)
+
+/** What was shared, where it may go, and how sending it went. */
+data class ShareState(
+ val signedIn: Boolean = true,
+ val text: String = "",
+ val files: List = emptyList(),
+ /** The last chat the assistant made, offered as the other place to send it. */
+ val last: LastAssist? = null,
+ val sending: Boolean = false,
+ val error: String? = null,
+)
+
+/** What the share sheet can do; nothing by default, for the screenshot tests. */
+interface ShareActions {
+ /** Send it with [ask] (empty: the default request) to a new chat, or [toLast] to the last assistant chat. */
+ fun send(ask: String, toLast: Boolean) {}
+
+ fun cancel() {}
+}
+
+/**
+ * The share sheet's contents, from [state] alone: what came in (the text, the files by name),
+ * what to do with it (a line of the person's own, optional), where it goes -- a new chat, or the
+ * last chat the assistant made -- and Send. Rows of unknown height stack; the two choices are
+ * whole-row tap targets of at least 56 dp.
+ */
+@Composable
+fun ColumnScope.ShareSheetContent(state: ShareState, actions: ShareActions, handle: Modifier = Modifier) {
+ val palette = LocalPalette.current
+ var ask by remember { mutableStateOf("") }
+ var toLast by remember { mutableStateOf(false) }
+
+ Column(handle.fillMaxWidth()) {
+ Box(Modifier.fillMaxWidth().padding(top = 10.dp, bottom = 6.dp), contentAlignment = Alignment.Center) {
+ Box(Modifier.size(width = 36.dp, height = 4.dp).background(palette.inkFaint, RoundedCornerShape(2.dp)))
+ }
+ Text(
+ stringResource(R.string.share_label),
+ style = MaterialTheme.typography.titleMedium,
+ modifier = Modifier.padding(horizontal = 20.dp, vertical = 8.dp),
+ )
+ if (state.sending) {
+ val bar = Modifier.fillMaxWidth().padding(horizontal = 16.dp).height(2.dp)
+ if (LocalInspectionMode.current) LinearProgressIndicator(progress = { 0.4f }, modifier = bar) else LinearProgressIndicator(bar)
+ }
+ }
+
+ if (!state.signedIn) {
+ Column(Modifier.weight(1f).fillMaxWidth().padding(24.dp), verticalArrangement = Arrangement.Center) {
+ Text(stringResource(R.string.assist_signed_out), style = MaterialTheme.typography.bodyLarge)
+ }
+ return
+ }
+
+ Column(
+ Modifier.weight(1f).fillMaxWidth().verticalScroll(rememberScrollState()).padding(horizontal = 16.dp, vertical = 8.dp),
+ verticalArrangement = Arrangement.spacedBy(12.dp),
+ ) {
+ // What came in.
+ if (state.text.isNotBlank()) {
+ Surface(
+ shape = RoundedCornerShape(16.dp),
+ color = palette.surfaceRaised,
+ border = BorderStroke(1.dp, palette.border),
+ modifier = Modifier.fillMaxWidth(),
+ ) {
+ Text(
+ state.text,
+ style = MaterialTheme.typography.bodyMedium,
+ color = palette.inkMuted,
+ maxLines = 6,
+ overflow = TextOverflow.Ellipsis,
+ modifier = Modifier.padding(horizontal = 14.dp, vertical = 10.dp),
+ )
+ }
+ }
+ state.files.forEach { file ->
+ Row(Modifier.fillMaxWidth().heightIn(min = 40.dp), verticalAlignment = Alignment.CenterVertically) {
+ Icon(
+ if (file.image) Icons.Filled.Image else Icons.AutoMirrored.Filled.InsertDriveFile,
+ contentDescription = null,
+ tint = palette.accent,
+ modifier = Modifier.size(24.dp),
+ )
+ Spacer(Modifier.width(12.dp))
+ Text(file.name, style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f))
+ }
+ }
+
+ // What to do with it.
+ TextField(
+ value = ask,
+ onValueChange = { ask = it },
+ placeholder = { Text(stringResource(R.string.share_ask_hint)) },
+ shape = RoundedCornerShape(20.dp),
+ colors = TextFieldDefaults.colors(
+ focusedContainerColor = palette.surfaceRaised,
+ unfocusedContainerColor = palette.surfaceRaised,
+ focusedIndicatorColor = Color.Transparent,
+ unfocusedIndicatorColor = Color.Transparent,
+ ),
+ maxLines = 4,
+ enabled = !state.sending,
+ modifier = Modifier.fillMaxWidth().heightIn(min = 52.dp),
+ )
+
+ // Where it goes.
+ val last = state.last
+ if (last != null) {
+ Surface(
+ shape = RoundedCornerShape(20.dp),
+ color = palette.surfaceRaised,
+ border = BorderStroke(1.dp, palette.border),
+ modifier = Modifier.fillMaxWidth(),
+ ) {
+ Column {
+ Destination(Icons.Filled.EditNote, stringResource(R.string.new_chat), null, selected = !toLast, enabled = !state.sending) { toLast = false }
+ Destination(Icons.Filled.History, stringResource(R.string.assist_continue), last.title, selected = toLast, enabled = !state.sending) {
+ toLast =
+ true
+ }
+ }
+ }
+ }
+ state.error?.let { Text(it, style = MaterialTheme.typography.bodyMedium, color = palette.danger) }
+ }
+
+ Row(
+ Modifier.fillMaxWidth().padding(start = 12.dp, end = 16.dp, top = 4.dp, bottom = 12.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ horizontalArrangement = Arrangement.End,
+ ) {
+ TextButton(onClick = actions::cancel, modifier = Modifier.heightIn(min = 48.dp)) { Text(stringResource(R.string.cancel)) }
+ Spacer(Modifier.width(8.dp))
+ Button(
+ onClick = { actions.send(ask, toLast && last != null) },
+ enabled = !state.sending && (state.text.isNotBlank() || state.files.isNotEmpty()),
+ colors = ButtonDefaults.buttonColors(containerColor = palette.accent, contentColor = palette.accentInk),
+ modifier = Modifier.heightIn(min = 48.dp),
+ ) { Text(stringResource(if (state.sending) R.string.share_sending else R.string.send)) }
+ }
+}
+
+@Composable
+private fun Destination(icon: ImageVector, title: String, detail: String?, selected: Boolean, enabled: Boolean, onClick: () -> Unit) {
+ val palette = LocalPalette.current
+ Row(
+ Modifier
+ .fillMaxWidth()
+ .selectable(selected = selected, enabled = enabled, role = Role.RadioButton, onClick = onClick)
+ .heightIn(min = 56.dp)
+ .padding(horizontal = 16.dp, vertical = 8.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Icon(icon, contentDescription = null, tint = palette.inkMuted, modifier = Modifier.size(24.dp))
+ Spacer(Modifier.width(16.dp))
+ Column(Modifier.weight(1f)) {
+ Text(title, style = MaterialTheme.typography.bodyLarge)
+ detail?.takeIf { it.isNotBlank() }?.let {
+ Text(it, style = MaterialTheme.typography.bodyMedium, color = palette.inkMuted, maxLines = 2, overflow = TextOverflow.Ellipsis)
+ }
+ }
+ RadioButton(selected = selected, onClick = null, enabled = enabled)
+ }
+}
+
+/**
+ * The message a share sends: the person's own words (or the default request) first, then what was
+ * shared, so the model reads the request before the material.
+ */
+fun shareMessage(ask: String, shared: String, fallback: String): String {
+ val request = ask.trim().ifBlank { fallback }
+ return if (shared.isBlank()) request else "$request\n\n---\n\n${shared.trim()}"
+}
diff --git a/app/src/main/java/eu/llembas/android/widget/AskWidget.kt b/app/src/main/java/eu/llembas/android/widget/AskWidget.kt
new file mode 100644
index 0000000..7ae4075
--- /dev/null
+++ b/app/src/main/java/eu/llembas/android/widget/AskWidget.kt
@@ -0,0 +1,73 @@
+package eu.llembas.android.widget
+
+import android.app.PendingIntent
+import android.appwidget.AppWidgetManager
+import android.appwidget.AppWidgetProvider
+import android.content.Context
+import android.content.Intent
+import android.content.pm.ShortcutInfo
+import android.content.pm.ShortcutManager
+import android.graphics.drawable.Icon
+import android.widget.RemoteViews
+import eu.llembas.android.R
+import eu.llembas.android.assist.AssistActivity
+
+/**
+ * The home-screen widget: a bar that opens the assistant's sheet (Ask), the sheet listening (the
+ * microphone), or the sheet at the last chat the assistant made. Nothing on it comes from the
+ * account, so it never needs updating and shows nothing private wherever it is placed.
+ */
+class AskWidget : AppWidgetProvider() {
+ override fun onUpdate(context: Context, manager: AppWidgetManager, ids: IntArray) {
+ val views = RemoteViews(context.packageName, R.layout.widget_ask).apply {
+ setOnClickPendingIntent(R.id.widget_ask, open(context, REQUEST_ASK, Intent(context, AssistActivity::class.java).setAction(Intent.ACTION_ASSIST)))
+ setOnClickPendingIntent(R.id.widget_mic, open(context, REQUEST_LISTEN, AssistActivity.listening(context)))
+ setOnClickPendingIntent(R.id.widget_last, open(context, REQUEST_CONTINUE, AssistActivity.continuing(context)))
+ }
+ ids.forEach { manager.updateAppWidget(it, views) }
+ }
+
+ private fun open(context: Context, request: Int, intent: Intent): PendingIntent = PendingIntent.getActivity(
+ context,
+ request,
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
+ PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT,
+ )
+
+ private companion object {
+ const val REQUEST_ASK = 1
+ const val REQUEST_LISTEN = 2
+ const val REQUEST_CONTINUE = 3
+ }
+}
+
+/**
+ * The launcher icon's long-press shortcuts: Ask, Speak and the last assistant chat. Published from
+ * code rather than `shortcuts.xml`, because a static shortcut names the package, and the test
+ * build's is `….debug`; and so their labels follow the app's language.
+ */
+object Shortcuts {
+ fun publish(context: Context) {
+ val manager = context.getSystemService(ShortcutManager::class.java) ?: return
+ val shortcuts = listOf(
+ shortcut(
+ context,
+ "ask",
+ R.string.tile_ask,
+ R.string.tile_ask,
+ R.drawable.ic_shortcut_ask,
+ Intent(context, AssistActivity::class.java).setAction(Intent.ACTION_ASSIST),
+ ),
+ shortcut(context, "speak", R.string.widget_speak, R.string.widget_speak, R.drawable.ic_shortcut_mic, AssistActivity.listening(context)),
+ shortcut(context, "continue", R.string.shortcut_last, R.string.assist_continue, R.drawable.ic_shortcut_history, AssistActivity.continuing(context)),
+ )
+ runCatching { manager.dynamicShortcuts = shortcuts }
+ }
+
+ private fun shortcut(context: Context, id: String, short: Int, long: Int, icon: Int, intent: Intent): ShortcutInfo = ShortcutInfo.Builder(context, id)
+ .setShortLabel(context.getString(short))
+ .setLongLabel(context.getString(long))
+ .setIcon(Icon.createWithResource(context, icon))
+ .setIntent(intent)
+ .build()
+}
diff --git a/app/src/main/res/drawable/ic_shortcut_ask.xml b/app/src/main/res/drawable/ic_shortcut_ask.xml
new file mode 100644
index 0000000..57fadcc
--- /dev/null
+++ b/app/src/main/res/drawable/ic_shortcut_ask.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_shortcut_history.xml b/app/src/main/res/drawable/ic_shortcut_history.xml
new file mode 100644
index 0000000..0d4c762
--- /dev/null
+++ b/app/src/main/res/drawable/ic_shortcut_history.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_shortcut_mic.xml b/app/src/main/res/drawable/ic_shortcut_mic.xml
new file mode 100644
index 0000000..544ce85
--- /dev/null
+++ b/app/src/main/res/drawable/ic_shortcut_mic.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_widget_ask.xml b/app/src/main/res/drawable/ic_widget_ask.xml
new file mode 100644
index 0000000..98aaced
--- /dev/null
+++ b/app/src/main/res/drawable/ic_widget_ask.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_widget_history.xml b/app/src/main/res/drawable/ic_widget_history.xml
new file mode 100644
index 0000000..d0ed572
--- /dev/null
+++ b/app/src/main/res/drawable/ic_widget_history.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_widget_mic.xml b/app/src/main/res/drawable/ic_widget_mic.xml
new file mode 100644
index 0000000..ca0edd9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_widget_mic.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable/widget_background.xml b/app/src/main/res/drawable/widget_background.xml
new file mode 100644
index 0000000..9b93d30
--- /dev/null
+++ b/app/src/main/res/drawable/widget_background.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/widget_mic_background.xml b/app/src/main/res/drawable/widget_mic_background.xml
new file mode 100644
index 0000000..aa94eab
--- /dev/null
+++ b/app/src/main/res/drawable/widget_mic_background.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/app/src/main/res/layout/widget_ask.xml b/app/src/main/res/layout/widget_ask.xml
new file mode 100644
index 0000000..0eaa35a
--- /dev/null
+++ b/app/src/main/res/layout/widget_ask.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index e23227a..de5328e 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -401,4 +401,9 @@
Používá ho asistent i mikrofon v konverzaci. S LLeMbas asistent ukazuje slova s malým zpožděním a pauza je odešle, konverzace je zapíše, když přestanete; s rozpoznáváním v telefonu se objevují, jak mluvíte.
Odesílá se do LLeMbas…
Podívejte se na tohle.
+ Co s tím má LLeMbas udělat? (nepovinné)
+ Zeptejte se na cokoli
+ Mluvit
+ Ptejte se hlasem nebo textem, nebo pokračujte v poslední konverzaci s asistentem. Neukazuje nic z vašeho účtu.
+ Poslední chat
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index dd2b37a..ba518e9 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -401,4 +401,9 @@
Wird vom Assistenten und vom Mikrofon im Chat genutzt. Mit LLeMbas zeigt der Assistent die Wörter einen Moment später, und eine Pause sendet sie, ein Chat schreibt sie auf, wenn Sie aufhören; mit der Erkennung des Telefons erscheinen sie beim Sprechen.
Wird an LLeMbas gesendet…
Schauen Sie sich das an.
+ Was soll LLeMbas damit tun? (optional)
+ Frag mich alles
+ Sprechen
+ Per Sprache oder Text fragen oder den letzten Assistenten-Chat fortsetzen. Zeigt nichts aus Ihrem Konto.
+ Letzter Chat
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 9ac58d1..44fc915 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -401,4 +401,9 @@
La usan el asistente y el micrófono de un chat. Con LLeMbas el asistente muestra las palabras un momento después y una pausa las envía, y un chat las escribe cuando usted para; con el reconocimiento del teléfono aparecen mientras habla.
Enviando a LLeMbas…
Échele un vistazo a esto.
+ ¿Qué debe hacer LLeMbas con esto? (opcional)
+ Pregunta lo que quieras
+ Hablar
+ Pregunta por voz o por texto, o continúa el último chat del asistente. No muestra nada de tu cuenta.
+ Último chat
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index b45ee16..08e3a84 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -401,4 +401,9 @@
Utilisée par l’assistant et par le micro d’une conversation. Avec LLeMbas, l’assistant affiche les mots avec un léger décalage et une pause les envoie, et une conversation les écrit quand vous vous arrêtez ; avec la reconnaissance du téléphone, ils apparaissent pendant que vous parlez.
Envoi à LLeMbas…
Jetez un œil à ceci.
+ Que doit en faire LLeMbas ? (facultatif)
+ Posez une question
+ Parler
+ Demandez à la voix ou par écrit, ou reprenez la dernière discussion de l’assistant. N’affiche rien de votre compte.
+ Dernière discussion
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index 8405a2f..1ec120e 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -401,4 +401,9 @@
Az asszisztens és a csevegés mikrofonja használja. LLeMbasszal az asszisztens kis késéssel mutatja a szavakat, és egy szünet elküldi őket, a csevegés pedig akkor írja le őket, amikor abbahagyja; a telefon felismerőjével beszéd közben jelennek meg.
Küldés az LLeMbas-nak…
Nézze meg ezt.
+ Mit kezdjen vele a LLeMbas? (nem kötelező)
+ Kérdezz bármit
+ Beszéd
+ Kérdezz hanggal vagy szöveggel, vagy folytasd az asszisztens legutóbbi csevegését. A fiókodból semmit sem mutat.
+ Utolsó csevegés
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index c66cae9..fc60cdb 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -401,4 +401,9 @@
La usano l’assistente e il microfono di una chat. Con LLeMbas l’assistente mostra le parole con un attimo di ritardo e una pausa le invia, e una chat le scrive quando si ferma; con il riconoscimento del telefono appaiono mentre parla.
Invio a LLeMbas…
Dai un\'occhiata a questo.
+ Cosa deve farne LLeMbas? (facoltativo)
+ Chiedi qualsiasi cosa
+ Parla
+ Chiedi a voce o per iscritto, o continua l’ultima chat dell’assistente. Non mostra nulla del tuo account.
+ Ultima chat
diff --git a/app/src/main/res/values-night/tokens.xml b/app/src/main/res/values-night/tokens.xml
new file mode 100644
index 0000000..de5e9a2
--- /dev/null
+++ b/app/src/main/res/values-night/tokens.xml
@@ -0,0 +1,13 @@
+
+
+
+ #FF0B0D10
+ #FF11151A
+ #FF171C22
+ #FF26303A
+ #FFE2E8EC
+ #FFA6B2BC
+ #FF8FD8E8
+ #FF061418
+ #1F8FD8E8
+
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 5298413..f4e35cc 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -401,4 +401,9 @@
Używa go asystent i mikrofon w czacie. Z LLeMbas asystent pokazuje słowa z lekkim opóźnieniem, a pauza je wysyła, czat zapisuje je, gdy przestaniesz; z rozpoznawaniem telefonu pojawiają się w trakcie mówienia.
Wysyłanie do LLeMbas…
Zobacz to.
+ Co LLeMbas ma z tym zrobić? (opcjonalnie)
+ Zapytaj o cokolwiek
+ Mów
+ Pytaj głosem lub tekstem albo kontynuuj ostatni czat asystenta. Nie pokazuje niczego z Twojego konta.
+ Ostatni czat
diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml
index 6bc95e2..f50d199 100644
--- a/app/src/main/res/values-sk/strings.xml
+++ b/app/src/main/res/values-sk/strings.xml
@@ -401,4 +401,9 @@
Používa ho asistent aj mikrofón v konverzácii. S LLeMbas asistent ukazuje slová s malým oneskorením a pauza ich odošle, konverzácia ich zapíše, keď prestanete; s rozpoznávaním v telefóne sa objavujú, ako hovoríte.
Odosiela sa do LLeMbas…
Pozrite sa na toto.
+ Čo s tým má LLeMbas urobiť? (nepovinné)
+ Opýtajte sa na čokoľvek
+ Hovoriť
+ Pýtajte sa hlasom alebo textom, alebo pokračujte v poslednej konverzácii s asistentom. Neukazuje nič z vášho účtu.
+ Posledný chat
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b3776a9..880bf59 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -403,4 +403,9 @@
Used by the assistant and by the microphone in a chat. With LLeMbas the assistant shows the words a moment behind you and a pause sends them, and a chat writes them down when you stop; with the phone\'s recogniser they appear as you speak.
Sending to LLeMbas…
Have a look at this.
+ What should LLeMbas do with it? (optional)
+ Ask anything
+ Speak
+ Ask by voice or text, or carry on the last assistant chat. Shows nothing from your account.
+ Last chat
diff --git a/app/src/main/res/values/tokens.xml b/app/src/main/res/values/tokens.xml
new file mode 100644
index 0000000..015d935
--- /dev/null
+++ b/app/src/main/res/values/tokens.xml
@@ -0,0 +1,13 @@
+
+
+
+ #FFF1EAD6
+ #FFF8F3E5
+ #FFFCF9F0
+ #FFCBBF9D
+ #FF1F2418
+ #FF474D3B
+ #FF285F3C
+ #FFF8F3E5
+ #1A285F3C
+
diff --git a/app/src/main/res/xml/shortcuts.xml b/app/src/main/res/xml/shortcuts.xml
deleted file mode 100644
index b458e8f..0000000
--- a/app/src/main/res/xml/shortcuts.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/xml/widget_ask.xml b/app/src/main/res/xml/widget_ask.xml
new file mode 100644
index 0000000..4adfe6d
--- /dev/null
+++ b/app/src/main/res/xml/widget_ask.xml
@@ -0,0 +1,13 @@
+
+
diff --git a/app/src/test/java/eu/llembas/android/AssistTest.kt b/app/src/test/java/eu/llembas/android/AssistTest.kt
index bba0eff..9a919da 100644
--- a/app/src/test/java/eu/llembas/android/AssistTest.kt
+++ b/app/src/test/java/eu/llembas/android/AssistTest.kt
@@ -10,6 +10,7 @@ import eu.llembas.android.assist.SheetStop
import eu.llembas.android.assist.settle
import eu.llembas.android.assist.usePhoneRecognizer
import eu.llembas.android.auth.Prefs
+import eu.llembas.android.share.shareMessage
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
@@ -87,4 +88,12 @@ class AssistTest {
assertFalse(usePhoneRecognizer(Prefs.VOICE_LEMBAS, phoneHas = true, instanceStt = true))
assertTrue(usePhoneRecognizer(Prefs.VOICE_LEMBAS, phoneHas = true, instanceStt = false))
}
+
+ @Test
+ fun aShareSendsTheRequestBeforeWhatWasShared() {
+ assertEquals("Summarise it.\n\n---\n\nhttps://example.org", shareMessage(" Summarise it. ", "https://example.org\n", "Have a look."))
+ assertEquals("Have a look.\n\n---\n\nSome text", shareMessage("", "Some text", "Have a look."))
+ // Files only: the request alone, the files go as attachments.
+ assertEquals("Have a look.", shareMessage(" ", "", "Have a look."))
+ }
}
diff --git a/app/src/test/java/eu/llembas/android/shots/Fakes.kt b/app/src/test/java/eu/llembas/android/shots/Fakes.kt
index 9ee8e33..ae1481f 100644
--- a/app/src/test/java/eu/llembas/android/shots/Fakes.kt
+++ b/app/src/test/java/eu/llembas/android/shots/Fakes.kt
@@ -44,6 +44,8 @@ import eu.llembas.android.assist.Connection
import eu.llembas.android.assist.LastAssist
import eu.llembas.android.auth.Instance
import eu.llembas.android.auth.Prefs
+import eu.llembas.android.share.ShareState
+import eu.llembas.android.share.SharedFile
import eu.llembas.android.ui.chat.ChatState
import eu.llembas.android.ui.chat.Draft
import eu.llembas.android.ui.home.ChatsState
@@ -411,6 +413,18 @@ object Fakes {
error = "Home cannot be reached.",
)
+ // A share from another app.
+ val shareLink = ShareState(
+ text = "The Long Road: a walker's guide to waybread\nhttps://example.org/waybread",
+ last = LastAssist("c1", "Packing for the road", 0),
+ )
+
+ val shareFiles = ShareState(
+ files = listOf(SharedFile("map-of-the-road.jpg", image = true), SharedFile("provisions.pdf", image = false)),
+ last = LastAssist("c1", "Packing for the road", 0),
+ error = "Home cannot be reached.",
+ )
+
// Scheduled: shaped as the server's contract fixtures are (contract/schedule*.json).
private fun rule(text: String) = LembasJson.parseToJsonElement(text).jsonObject
diff --git a/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt b/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt
index 57fed57..1e4720f 100644
--- a/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt
+++ b/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt
@@ -1,10 +1,14 @@
+@file:OptIn(ExperimentalRoborazziApi::class)
+
package eu.llembas.android.shots
+import android.view.LayoutInflater
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -16,10 +20,20 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.viewinterop.AndroidView
+import com.github.takahirom.roborazzi.ExperimentalRoborazziApi
+import com.github.takahirom.roborazzi.RoborazziComposeOptions
+import com.github.takahirom.roborazzi.captureRoboImage
+import com.github.takahirom.roborazzi.inspectionMode
+import com.github.takahirom.roborazzi.size
+import eu.llembas.android.R
import eu.llembas.android.assist.AssistActions
import eu.llembas.android.assist.AssistSheetContent
import eu.llembas.android.assist.AssistSheetFrame
import eu.llembas.android.assist.AssistUiState
+import eu.llembas.android.share.ShareActions
+import eu.llembas.android.share.ShareSheetContent
+import eu.llembas.android.share.ShareState
import eu.llembas.android.ui.chat.ActivityActions
import eu.llembas.android.ui.chat.ActivityContent
import eu.llembas.android.ui.chat.CardSheet
@@ -66,6 +80,8 @@ private object NoSettingsActions : SettingsActions
private object NoAssistActions : AssistActions
+private object NoShareActions : ShareActions
+
/**
* The app's screens with made-up data ([Fakes]), as a phone shows them: each in Shire and
* Moria, at a large phone's size and, where things crowd, a small one's and with large type.
@@ -287,6 +303,49 @@ class ScreenShots {
shoot("28-memory", Phone.Small, fontScale = 1.5f) { MemoryContent(Fakes.memory, NoMemoryActions) }
shoot("28-memory-none") { MemoryContent(MemoryState(), NoMemoryActions) }
}
+
+ /** "Ask LLeMbas" from another app's share menu: a link, and a picture with a file. */
+ @Test
+ fun share() {
+ val over: (ShareState) -> @Composable () -> Unit = { state ->
+ {
+ Box(Modifier.fillMaxSize()) {
+ ChatContent(Fakes.transcript, NoChatActions, agent = false)
+ AssistSheetFrame(onDismiss = {}) { handle, _ -> ShareSheetContent(state, NoShareActions, handle) }
+ }
+ }
+ }
+ shoot("30-share-link", content = over(Fakes.shareLink))
+ shoot("30-share-link", Phone.Small, fontScale = 1.5f, content = over(Fakes.shareLink))
+ shoot("31-share-files", content = over(Fakes.shareFiles))
+ }
+
+ /** The home-screen widget, as the launcher inflates it (light; [widgetNight] is dark). */
+ @Test
+ fun widget() = shootWidget("light")
+
+ @Test
+ @Config(qualifiers = "+night")
+ fun widgetNight() = shootWidget("dark")
+
+ private fun shootWidget(theme: String) {
+ for (phone in listOf(Phone.Large, Phone.Small)) {
+ captureRoboImage(
+ filePath = "build/screenshots/${phone.tag}-32-widget-$theme.png",
+ roborazziComposeOptions = RoborazziComposeOptions {
+ size(phone.widthDp, 120)
+ inspectionMode(true)
+ },
+ ) {
+ Box(Modifier.fillMaxSize().padding(16.dp), contentAlignment = Alignment.Center) {
+ AndroidView(
+ factory = { context -> LayoutInflater.from(context).inflate(R.layout.widget_ask, null) },
+ modifier = Modifier.fillMaxWidth().height(64.dp),
+ )
+ }
+ }
+ }
+ }
}
/**
diff --git a/scripts/fetch-tokens.py b/scripts/fetch-tokens.py
index f8a7648..06ac2d8 100755
--- a/scripts/fetch-tokens.py
+++ b/scripts/fetch-tokens.py
@@ -2,14 +2,19 @@
"""The server's colours, as the app's Compose theme.
scripts/fetch-tokens.py read tokens.css at that ref (a tag such as v1.7.0),
- write Tokens.kt and tokens.lock.json
- scripts/fetch-tokens.py verify: Tokens.kt matches tokens.lock.json
+ write Tokens.kt, the colour resources and tokens.lock.json
+ scripts/fetch-tokens.py verify: they match tokens.lock.json
The server is a git checkout, LLeMbas beside this repository by default (LEMBAS_SERVER names
another). Only the colour tokens of the two themes are read -- `moria` (declared on `:root`) and
`shire` -- and each becomes a `Palette` in Kotlin. The lock records the ref, the commit and the
SHA-256 of the generated file, as LLeMbas Desktop's `tokens.lock.json` does: the file in the tree
says which server version the look comes from, and CI refuses a copy that drifted.
+
+What Compose cannot draw -- the home-screen widget, the shortcuts' icons -- takes the same colours
+as Android resources: `values/tokens.xml` from `shire` and `values-night/tokens.xml` from `moria`,
+a few of the tokens as `@color/token_`, so a widget follows the phone's dark mode in the
+app's own colours.
"""
from __future__ import annotations
@@ -27,6 +32,10 @@ SERVER = Path(os.environ.get("LEMBAS_SERVER", ROOT.parent / "LLeMbas"))
SOURCE = "src/lembas/web/static/css/tokens.css"
OUT = ROOT / "app/src/main/java/eu/llembas/android/ui/theme/Tokens.kt"
LOCK = ROOT / "tokens.lock.json"
+RES = ROOT / "app/src/main/res"
+# The tokens a resource reads, and which theme each folder takes.
+RES_NAMES = ("bg", "surface", "surface-raised", "border", "ink", "ink-muted", "accent", "accent-ink", "accent-soft")
+RES_THEMES = {"values": "shire", "values-night": "moria"}
# The tokens the app uses, in the order they are written. A token missing from a theme is an
# error rather than a default: a palette that silently fell back would look right and be wrong.
@@ -75,6 +84,32 @@ def camel(name: str) -> str:
return head + "".join(p.capitalize() for p in rest)
+def android_colour(value: str) -> str:
+ """#AARRGGBB, as a resource writes it."""
+ return "#" + argb(value)[2:]
+
+
+def theme_values(css: str, theme: str) -> dict[str, str]:
+ return dict(re.findall(r"--([a-z0-9-]+)\s*:\s*([^;]+);", block(css, THEMES[theme])))
+
+
+def generate_res(css: str, ref: str, theme: str) -> str:
+ values = theme_values(css, theme)
+ lines = [
+ '',
+ f"",
+ "",
+ *[f' {android_colour(values[n])}' for n in RES_NAMES],
+ "",
+ "",
+ ]
+ return "\n".join(lines)
+
+
+def res_files() -> dict[str, Path]:
+ return {folder: RES / folder / "tokens.xml" for folder in RES_THEMES}
+
+
def generate(css: str, ref: str) -> str:
lines = [
"// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at "
@@ -105,6 +140,9 @@ def main() -> None:
lock = json.loads(LOCK.read_text())
if sha(OUT) != lock["sha256"]:
sys.exit(f"fetch-tokens: {OUT.name} does not match {LOCK.name} (server {lock['tag']})")
+ for folder, path in res_files().items():
+ if not path.exists() or sha(path) != lock.get("res", {}).get(folder):
+ sys.exit(f"fetch-tokens: {folder}/tokens.xml does not match {LOCK.name} (server {lock['tag']})")
print(f"fetch-tokens: {OUT.name} matches {LOCK.name} (server {lock['tag']})")
return
ref = sys.argv[1]
@@ -118,8 +156,13 @@ def main() -> None:
).stdout
OUT.parent.mkdir(parents=True, exist_ok=True)
OUT.write_text(generate(css, ref), encoding="utf-8")
+ res = {}
+ for folder, path in res_files().items():
+ path.parent.mkdir(parents=True, exist_ok=True)
+ path.write_text(generate_res(css, ref, RES_THEMES[folder]), encoding="utf-8")
+ res[folder] = sha(path)
LOCK.write_text(
- json.dumps({"tag": ref, "commit": commit, "sha256": sha(OUT)}, indent=2) + "\n"
+ json.dumps({"tag": ref, "commit": commit, "sha256": sha(OUT), "res": res}, indent=2) + "\n"
)
print(f"fetch-tokens: wrote {OUT.relative_to(ROOT)} from {ref} ({commit[:12]})")
diff --git a/scripts/strings.py b/scripts/strings.py
index 47568b6..a8c8881 100755
--- a/scripts/strings.py
+++ b/scripts/strings.py
@@ -429,6 +429,11 @@ STRINGS: dict[str, str] = {
# Share
"share_sending": "Sending to LLeMbas…",
"share_default_prompt": "Have a look at this.",
+ "share_ask_hint": "What should LLeMbas do with it? (optional)",
+ "widget_hint": "Ask anything",
+ "widget_speak": "Speak",
+ "widget_description": "Ask by voice or text, or carry on the last assistant chat. Shows nothing from your account.",
+ "shortcut_last": "Last chat",
}
diff --git a/scripts/strings_own.json b/scripts/strings_own.json
index 36b37ba..3874d44 100644
--- a/scripts/strings_own.json
+++ b/scripts/strings_own.json
@@ -152,9 +152,11 @@
"settings_about": "O aplikaci",
"settings_assistant": "Asistent",
"settings_instances": "Instance",
+ "share_ask_hint": "Co s tím má LLeMbas udělat? (nepovinné)",
"share_default_prompt": "Podívejte se na tohle.",
"share_label": "Zeptat se LLeMbas",
"share_sending": "Odesílá se do LLeMbas…",
+ "shortcut_last": "Poslední chat",
"shown": "Zobrazeno",
"signin_address": "Adresa instance",
"signin_code_intro": "Otevřete instanci v prohlížeči, přihlaste se a schvalte tento kód:",
@@ -221,7 +223,10 @@
"voice_input_lembas_line": "Převod řeči na text vaší instance, přes server. Nahrávka jde na vaši instanci a nikam jinam.",
"voice_input_phone": "Telefon (Google nebo systémový)",
"voice_input_phone_line": "Vlastní rozpoznávání řeči v telefonu. Slova se objevují, jak mluvíte; nahrávka jde tam, kam ji to rozpoznávání pošle.",
- "voice_input_phone_none": "Tento telefon nemá vlastní rozpoznávání řeči."
+ "voice_input_phone_none": "Tento telefon nemá vlastní rozpoznávání řeči.",
+ "widget_description": "Ptejte se hlasem nebo textem, nebo pokračujte v poslední konverzaci s asistentem. Neukazuje nic z vašeho účtu.",
+ "widget_hint": "Zeptejte se na cokoli",
+ "widget_speak": "Mluvit"
},
"de": {
"about_version": "LLeMbas für Android %1$s",
@@ -377,9 +382,11 @@
"settings_about": "Über",
"settings_assistant": "Assistent",
"settings_instances": "Instanzen",
+ "share_ask_hint": "Was soll LLeMbas damit tun? (optional)",
"share_default_prompt": "Schauen Sie sich das an.",
"share_label": "LLeMbas fragen",
"share_sending": "Wird an LLeMbas gesendet…",
+ "shortcut_last": "Letzter Chat",
"shown": "Angezeigt",
"signin_address": "Adresse der Instanz",
"signin_code_intro": "Öffnen Sie die Instanz im Browser, melden Sie sich an und bestätigen Sie diesen Code:",
@@ -446,7 +453,10 @@
"voice_input_lembas_line": "Die Spracherkennung Ihrer Instanz, über den Server. Die Aufnahme geht an Ihre Instanz und nirgendwo sonst hin.",
"voice_input_phone": "Telefon (Google oder das System)",
"voice_input_phone_line": "Die eigene Spracherkennung des Telefons. Die Wörter erscheinen beim Sprechen; die Aufnahme geht dorthin, wohin diese Erkennung sie schickt.",
- "voice_input_phone_none": "Dieses Telefon hat keine eigene Spracherkennung."
+ "voice_input_phone_none": "Dieses Telefon hat keine eigene Spracherkennung.",
+ "widget_description": "Per Sprache oder Text fragen oder den letzten Assistenten-Chat fortsetzen. Zeigt nichts aus Ihrem Konto.",
+ "widget_hint": "Frag mich alles",
+ "widget_speak": "Sprechen"
},
"es": {
"about_version": "LLeMbas para Android %1$s",
@@ -601,9 +611,11 @@
"settings_about": "Acerca de",
"settings_assistant": "Asistente",
"settings_instances": "Instancias",
+ "share_ask_hint": "¿Qué debe hacer LLeMbas con esto? (opcional)",
"share_default_prompt": "Échele un vistazo a esto.",
"share_label": "Preguntar a LLeMbas",
"share_sending": "Enviando a LLeMbas…",
+ "shortcut_last": "Último chat",
"shown": "Mostrado",
"signin_address": "Dirección de la instancia",
"signin_code_intro": "Abra la instancia en el navegador, inicie sesión y apruebe este código:",
@@ -670,7 +682,10 @@
"voice_input_lembas_line": "La conversión de voz a texto de su instancia, a través del servidor. La grabación va a su instancia y a ningún otro sitio.",
"voice_input_phone": "Teléfono (Google o el del sistema)",
"voice_input_phone_line": "El reconocimiento de voz del propio teléfono. Las palabras aparecen mientras habla; la grabación va adonde ese reconocimiento la envíe.",
- "voice_input_phone_none": "Este teléfono no tiene reconocimiento de voz propio."
+ "voice_input_phone_none": "Este teléfono no tiene reconocimiento de voz propio.",
+ "widget_description": "Pregunta por voz o por texto, o continúa el último chat del asistente. No muestra nada de tu cuenta.",
+ "widget_hint": "Pregunta lo que quieras",
+ "widget_speak": "Hablar"
},
"fr": {
"about_version": "LLeMbas pour Android %1$s",
@@ -826,9 +841,11 @@
"settings_about": "À propos",
"settings_assistant": "Assistant",
"settings_instances": "Instances",
+ "share_ask_hint": "Que doit en faire LLeMbas ? (facultatif)",
"share_default_prompt": "Jetez un œil à ceci.",
"share_label": "Demander à LLeMbas",
"share_sending": "Envoi à LLeMbas…",
+ "shortcut_last": "Dernière discussion",
"shown": "Affiché",
"signin_address": "Adresse de l'instance",
"signin_code_intro": "Ouvrez l'instance dans le navigateur, connectez-vous et approuvez ce code :",
@@ -895,7 +912,10 @@
"voice_input_lembas_line": "La transcription de votre instance, via le serveur. L’enregistrement va à votre instance et nulle part ailleurs.",
"voice_input_phone": "Téléphone (Google ou celui du système)",
"voice_input_phone_line": "La reconnaissance vocale du téléphone. Les mots apparaissent pendant que vous parlez ; l’enregistrement va là où cette reconnaissance l’envoie.",
- "voice_input_phone_none": "Ce téléphone n’a pas de reconnaissance vocale propre."
+ "voice_input_phone_none": "Ce téléphone n’a pas de reconnaissance vocale propre.",
+ "widget_description": "Demandez à la voix ou par écrit, ou reprenez la dernière discussion de l’assistant. N’affiche rien de votre compte.",
+ "widget_hint": "Posez une question",
+ "widget_speak": "Parler"
},
"hu": {
"about_version": "LLeMbas Androidra %1$s",
@@ -1051,9 +1071,11 @@
"settings_about": "Névjegy",
"settings_assistant": "Asszisztens",
"settings_instances": "Példányok",
+ "share_ask_hint": "Mit kezdjen vele a LLeMbas? (nem kötelező)",
"share_default_prompt": "Nézze meg ezt.",
"share_label": "Kérdés az LLeMbas-tól",
"share_sending": "Küldés az LLeMbas-nak…",
+ "shortcut_last": "Utolsó csevegés",
"shown": "Megjelenítve",
"signin_address": "A példány címe",
"signin_code_intro": "Nyissa meg a példányt a böngészőben, jelentkezzen be, és hagyja jóvá ezt a kódot:",
@@ -1120,7 +1142,10 @@
"voice_input_lembas_line": "A példánya beszédfelismerése, a szerveren át. A felvétel a példányához megy, máshová nem.",
"voice_input_phone": "Telefon (Google vagy a rendszeré)",
"voice_input_phone_line": "A telefon saját beszédfelismerője. A szavak beszéd közben jelennek meg; a felvétel oda megy, ahová az a felismerő küldi.",
- "voice_input_phone_none": "Ennek a telefonnak nincs saját beszédfelismerője."
+ "voice_input_phone_none": "Ennek a telefonnak nincs saját beszédfelismerője.",
+ "widget_description": "Kérdezz hanggal vagy szöveggel, vagy folytasd az asszisztens legutóbbi csevegését. A fiókodból semmit sem mutat.",
+ "widget_hint": "Kérdezz bármit",
+ "widget_speak": "Beszéd"
},
"it": {
"about_version": "LLeMbas per Android %1$s",
@@ -1275,9 +1300,11 @@
"settings_about": "Informazioni",
"settings_assistant": "Assistente",
"settings_instances": "Istanze",
+ "share_ask_hint": "Cosa deve farne LLeMbas? (facoltativo)",
"share_default_prompt": "Dai un'occhiata a questo.",
"share_label": "Chiedi a LLeMbas",
"share_sending": "Invio a LLeMbas…",
+ "shortcut_last": "Ultima chat",
"shown": "Mostrato",
"signin_address": "Indirizzo dell'istanza",
"signin_code_intro": "Apri l'istanza nel browser, accedi e approva questo codice:",
@@ -1344,7 +1371,10 @@
"voice_input_lembas_line": "La trascrizione della sua istanza, tramite il server. La registrazione va alla sua istanza e da nessun’altra parte.",
"voice_input_phone": "Telefono (Google o quello di sistema)",
"voice_input_phone_line": "Il riconoscimento vocale del telefono. Le parole appaiono mentre parla; la registrazione va dove la manda quel riconoscimento.",
- "voice_input_phone_none": "Questo telefono non ha un riconoscimento vocale proprio."
+ "voice_input_phone_none": "Questo telefono non ha un riconoscimento vocale proprio.",
+ "widget_description": "Chiedi a voce o per iscritto, o continua l’ultima chat dell’assistente. Non mostra nulla del tuo account.",
+ "widget_hint": "Chiedi qualsiasi cosa",
+ "widget_speak": "Parla"
},
"pl": {
"about_version": "LLeMbas na Androida %1$s",
@@ -1499,9 +1529,11 @@
"settings_about": "Informacje",
"settings_assistant": "Asystent",
"settings_instances": "Instancje",
+ "share_ask_hint": "Co LLeMbas ma z tym zrobić? (opcjonalnie)",
"share_default_prompt": "Zobacz to.",
"share_label": "Zapytaj LLeMbas",
"share_sending": "Wysyłanie do LLeMbas…",
+ "shortcut_last": "Ostatni czat",
"shown": "Pokazano",
"signin_address": "Adres instancji",
"signin_code_intro": "Otwórz instancję w przeglądarce, zaloguj się i zatwierdź ten kod:",
@@ -1568,7 +1600,10 @@
"voice_input_lembas_line": "Zamiana mowy na tekst Twojej instancji, przez serwer. Nagranie trafia do Twojej instancji i nigdzie indziej.",
"voice_input_phone": "Telefon (Google lub systemowy)",
"voice_input_phone_line": "Własne rozpoznawanie mowy telefonu. Słowa pojawiają się w trakcie mówienia; nagranie trafia tam, dokąd wyśle je to rozpoznawanie.",
- "voice_input_phone_none": "Ten telefon nie ma własnego rozpoznawania mowy."
+ "voice_input_phone_none": "Ten telefon nie ma własnego rozpoznawania mowy.",
+ "widget_description": "Pytaj głosem lub tekstem albo kontynuuj ostatni czat asystenta. Nie pokazuje niczego z Twojego konta.",
+ "widget_hint": "Zapytaj o cokolwiek",
+ "widget_speak": "Mów"
},
"sk": {
"about_version": "LLeMbas pre Android %1$s",
@@ -1723,9 +1758,11 @@
"settings_about": "O aplikácii",
"settings_assistant": "Asistent",
"settings_instances": "Inštancie",
+ "share_ask_hint": "Čo s tým má LLeMbas urobiť? (nepovinné)",
"share_default_prompt": "Pozrite sa na toto.",
"share_label": "Spýtať sa LLeMbas",
"share_sending": "Odosiela sa do LLeMbas…",
+ "shortcut_last": "Posledný chat",
"shown": "Zobrazené",
"signin_address": "Adresa inštancie",
"signin_code_intro": "Otvorte inštanciu v prehliadači, prihláste sa a schváľte tento kód:",
@@ -1792,6 +1829,9 @@
"voice_input_lembas_line": "Prevod reči na text vašej inštancie, cez server. Nahrávka ide na vašu inštanciu a nikam inam.",
"voice_input_phone": "Telefón (Google alebo systémový)",
"voice_input_phone_line": "Vlastné rozpoznávanie reči v telefóne. Slová sa objavujú, ako hovoríte; nahrávka ide tam, kam ju to rozpoznávanie pošle.",
- "voice_input_phone_none": "Tento telefón nemá vlastné rozpoznávanie reči."
+ "voice_input_phone_none": "Tento telefón nemá vlastné rozpoznávanie reči.",
+ "widget_description": "Pýtajte sa hlasom alebo textom, alebo pokračujte v poslednej konverzácii s asistentom. Neukazuje nič z vášho účtu.",
+ "widget_hint": "Opýtajte sa na čokoľvek",
+ "widget_speak": "Hovoriť"
}
}
diff --git a/tokens.lock.json b/tokens.lock.json
index 056057a..12bccf2 100644
--- a/tokens.lock.json
+++ b/tokens.lock.json
@@ -1,5 +1,9 @@
{
"tag": "v2.0.0-beta.9",
"commit": "3b7da5fc7ac72d5de9229919793dd299c03da6a8",
- "sha256": "9057a56beb78ef9f3042555841014b9372ac415e70e054f41afcd488a9f14777"
+ "sha256": "9057a56beb78ef9f3042555841014b9372ac415e70e054f41afcd488a9f14777",
+ "res": {
+ "values": "ffa9a947b34431144ba452c64efd3d948547ebe6ec52da8735f9463bfad6ce2d",
+ "values-night": "b8cd01974f9c7fd4a00f681b1c99c839ff5d86b538c1d777e9628e2bcc36b584"
+ }
}