Skip to content

Commit

Permalink
Fixed possible error on copy to clipboard for older android versions
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickunterwegs committed Mar 25, 2024
1 parent 5c58c90 commit 8ffb9c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/src/main/java/at/techbee/jtx/ui/detail/DetailsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ fun DetailsScreen(
val clipboardManager = context.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
clipboardManager.setPrimaryClip(ClipData.newPlainText("", text))
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) // Only show a toast for Android 12 and lower.
Toast.makeText(context, context.getText(R.string.menu_view_copy_to_clipboard_copied), Toast.LENGTH_SHORT).show()

detailViewModel.toastMessage.value = context.getString(R.string.menu_view_copy_to_clipboard_copied)
}
}
menuExpanded.value = false
Expand Down

0 comments on commit 8ffb9c0

Please sign in to comment.