Use the standard glyphs for share, look up and ask
Share was already the Material share icon in both top bars, but appeared as bare text in the couplet actions and under an assistant's answer, so the same action looked like two different things. It now carries the glyph everywhere. The selection-menu entries had no icons of their own, so the system drew the app logo three times over. Each alias now has the icon for its verb, from Material's own path data: the share glyph people know from every other app, a magnifier for the dictionary, and send for handing a question elsewhere. Whether the floating toolbar draws them is the system's decision, not ours. "Ask an assistant" had a magnifier, which belongs to searching. It sends. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
65bc9ed0fc
commit
2f16b52c2c
@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".LookUpText"
|
android:name=".LookUpText"
|
||||||
|
android:icon="@drawable/ic_lookup"
|
||||||
android:targetActivity=".ProcessTextActivity"
|
android:targetActivity=".ProcessTextActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/look_up">
|
android:label="@string/look_up">
|
||||||
@ -56,6 +57,7 @@
|
|||||||
|
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".AskAssistantText"
|
android:name=".AskAssistantText"
|
||||||
|
android:icon="@drawable/ic_ask"
|
||||||
android:targetActivity=".ProcessTextActivity"
|
android:targetActivity=".ProcessTextActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/assistant_ask">
|
android:label="@string/assistant_ask">
|
||||||
@ -68,6 +70,7 @@
|
|||||||
|
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".ShareText"
|
android:name=".ShareText"
|
||||||
|
android:icon="@drawable/ic_share"
|
||||||
android:targetActivity=".ProcessTextActivity"
|
android:targetActivity=".ProcessTextActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/share">
|
android:label="@string/share">
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Close
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material.icons.filled.Search
|
import androidx.compose.material.icons.automirrored.filled.Send
|
||||||
import androidx.compose.material.icons.filled.Share
|
import androidx.compose.material.icons.filled.Share
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
@ -165,7 +165,7 @@ private fun SelectionScreen(selected: String, action: SelectionAction, onClose:
|
|||||||
actions = {
|
actions = {
|
||||||
// The dictionary knows single words; a whole line is better asked about.
|
// The dictionary knows single words; a whole line is better asked about.
|
||||||
IconButton(onClick = { context.shareText("$prompt\n\n$selected") }) {
|
IconButton(onClick = { context.shareText("$prompt\n\n$selected") }) {
|
||||||
Icon(Icons.Default.Search, stringResource(R.string.assistant_ask))
|
Icon(Icons.AutoMirrored.Filled.Send, stringResource(R.string.assistant_ask))
|
||||||
}
|
}
|
||||||
IconButton(onClick = { context.shareText(selected) }) {
|
IconButton(onClick = { context.shareText(selected) }) {
|
||||||
Icon(Icons.Default.Share, stringResource(R.string.share))
|
Icon(Icons.Default.Share, stringResource(R.string.share))
|
||||||
|
|||||||
@ -6,7 +6,11 @@ import androidx.compose.foundation.layout.navigationBarsPadding
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Share
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.ModalBottomSheet
|
import androidx.compose.material3.ModalBottomSheet
|
||||||
@ -116,6 +120,11 @@ fun AssistantAnswer(text: String, prompt: String = "translate") {
|
|||||||
Text(reply, style = MaterialTheme.typography.bodyLarge)
|
Text(reply, style = MaterialTheme.typography.bodyLarge)
|
||||||
}
|
}
|
||||||
TextButton(onClick = { context.shareText(reply) }) {
|
TextButton(onClick = { context.shareText(reply) }) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Share,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(18.dp).padding(end = 4.dp),
|
||||||
|
)
|
||||||
Text(stringResource(R.string.share))
|
Text(stringResource(R.string.share))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.Row
|
|||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.foundation.text.selection.SelectionContainer
|
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||||
@ -385,6 +386,13 @@ private fun PassageActions(passage: Bookmark) {
|
|||||||
subject = passage.title,
|
subject = passage.title,
|
||||||
)
|
)
|
||||||
}) {
|
}) {
|
||||||
|
// The same glyph as the top bar and as every other Android app: share is a shape
|
||||||
|
// people recognise before they read the word next to it.
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Share,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(18.dp).padding(end = 4.dp),
|
||||||
|
)
|
||||||
Text(stringResource(R.string.share))
|
Text(stringResource(R.string.share))
|
||||||
}
|
}
|
||||||
AssistantAction(
|
AssistantAction(
|
||||||
|
|||||||
12
app/src/main/res/drawable/ic_ask.xml
Normal file
12
app/src/main/res/drawable/ic_ask.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!-- Material "send": the question is handed to another app, not answered here. -->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:autoMirrored="true"
|
||||||
|
android:tint="?android:attr/textColorPrimary">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
|
||||||
|
</vector>
|
||||||
11
app/src/main/res/drawable/ic_lookup.xml
Normal file
11
app/src/main/res/drawable/ic_lookup.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!-- Material "search", for the dictionary entry. -->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/textColorPrimary">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zm-6,0C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||||
|
</vector>
|
||||||
11
app/src/main/res/drawable/ic_share.xml
Normal file
11
app/src/main/res/drawable/ic_share.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!-- Material "share" — the standard Android share glyph. -->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/textColorPrimary">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92s2.92,-1.31 2.92,-2.92 -1.31,-2.92 -2.92,-2.92z" />
|
||||||
|
</vector>
|
||||||
Loading…
Reference in New Issue
Block a user