feat: do not show copied toast on android >12
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
a84ce38b1f
commit
00e66ea939
|
|
@ -50,6 +50,7 @@ import chat.revolt.api.routes.misc.Root
|
|||
import chat.revolt.api.routes.misc.getRootRoute
|
||||
import chat.revolt.components.generic.PageHeader
|
||||
import chat.revolt.components.generic.PrimaryTabs
|
||||
import chat.revolt.internals.Platform
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.serialization.encodeToString
|
||||
import java.net.URI
|
||||
|
|
@ -140,11 +141,14 @@ fun AboutScreen(
|
|||
|
||||
fun copyDebugInformation() {
|
||||
clipboardManager.setText(AnnotatedString(RevoltJson.encodeToString(viewModel.getDebugInformation())))
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
|
||||
if (Platform.needsShowClipboardNotification()) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
Column(
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import androidx.compose.ui.unit.dp
|
|||
import chat.revolt.R
|
||||
import chat.revolt.api.RevoltAPI
|
||||
import chat.revolt.components.generic.SheetClickable
|
||||
import chat.revolt.internals.Platform
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Composable
|
||||
|
|
@ -64,11 +65,14 @@ fun ChannelContextSheet(
|
|||
if (channel.id == null) return@SheetClickable
|
||||
|
||||
clipboardManager.setText(AnnotatedString(channel.id))
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.channel_context_sheet_actions_copy_id_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
|
||||
if (Platform.needsShowClipboardNotification()) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.channel_context_sheet_actions_copy_id_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
coroutineScope.launch {
|
||||
onHideSheet()
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import chat.revolt.api.RevoltAPI
|
|||
import chat.revolt.callbacks.UiCallbacks
|
||||
import chat.revolt.components.chat.Message
|
||||
import chat.revolt.components.generic.SheetClickable
|
||||
import chat.revolt.internals.Platform
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
|
|
@ -111,11 +112,13 @@ fun MessageContextSheet(
|
|||
return@SheetClickable
|
||||
}
|
||||
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
if (Platform.needsShowClipboardNotification()) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
coroutineScope.launch {
|
||||
shareSheetState.hide()
|
||||
|
|
@ -165,11 +168,13 @@ fun MessageContextSheet(
|
|||
"$REVOLT_APP/server/${server?.id}/channel/${message.channel}/${message.id}"
|
||||
|
||||
clipboardManager.setText(AnnotatedString(messageLink))
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.message_context_sheet_actions_copy_link_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
if (Platform.needsShowClipboardNotification()) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.message_context_sheet_actions_copy_link_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
coroutineScope.launch {
|
||||
shareSheetState.hide()
|
||||
|
|
@ -197,11 +202,14 @@ fun MessageContextSheet(
|
|||
if (message.id == null) return@SheetClickable
|
||||
|
||||
clipboardManager.setText(AnnotatedString(message.id))
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.message_context_sheet_actions_copy_id_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
|
||||
if (Platform.needsShowClipboardNotification()) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.message_context_sheet_actions_copy_id_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
coroutineScope.launch {
|
||||
shareSheetState.hide()
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ import chat.revolt.components.generic.IconPlaceholder
|
|||
import chat.revolt.components.generic.RemoteImage
|
||||
import chat.revolt.components.generic.SheetClickable
|
||||
import chat.revolt.components.generic.UIMarkdown
|
||||
import chat.revolt.internals.Platform
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Composable
|
||||
|
|
@ -269,11 +270,14 @@ fun ServerContextSheet(
|
|||
if (server.id == null) return@SheetClickable
|
||||
|
||||
clipboardManager.setText(AnnotatedString(server.id))
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.server_context_sheet_actions_copy_id_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
|
||||
if (Platform.needsShowClipboardNotification()) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.server_context_sheet_actions_copy_id_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
coroutineScope.launch {
|
||||
onHideSheet()
|
||||
|
|
|
|||
Loading…
Reference in New Issue