diff options
author | SlipkHunter <abrito025@gmail.com> | 2023-09-10 19:34:36 -0300 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-09-12 12:23:46 +0530 |
commit | 0be12b8d07f2632deb2100b4e8e025626c0fe85a (patch) | |
tree | 5b3eb589b5a51c257a6363f5e225795fb855f052 /ui/src | |
parent | 56be913fa4e14449b4eb3185c86361a35dbf30d6 (diff) |
ui: only show a snackbar for Android 12 and lower
Signed-off-by: SlipkHunter <abrito025@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'ui/src')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt b/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt index 6a0d54ba..c9a7f59d 100644 --- a/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt +++ b/ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt @@ -6,6 +6,7 @@ package com.wireguard.android.util import android.content.ClipData import android.content.ClipboardManager +import android.os.Build import android.view.View import android.widget.TextView import androidx.core.content.getSystemService @@ -29,6 +30,8 @@ object ClipboardUtils { } val service = view.context.getSystemService<ClipboardManager>() ?: return service.setPrimaryClip(ClipData.newPlainText(data.second, data.first)) - Snackbar.make(view, view.context.getString(R.string.copied_to_clipboard, data.second), Snackbar.LENGTH_LONG).show() + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { + Snackbar.make(view, view.context.getString(R.string.copied_to_clipboard, data.second), Snackbar.LENGTH_LONG).show() + } } } |