Skip to content

Commit 0be12b8

Browse files
SlipkHuntermsfjarvis
authored andcommitted
ui: only show a snackbar for Android 12 and lower
Signed-off-by: SlipkHunter <[email protected]> Signed-off-by: Harsh Shandilya <[email protected]>
1 parent 56be913 commit 0be12b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/src/main/java/com/wireguard/android/util/ClipboardUtils.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package com.wireguard.android.util
66

77
import android.content.ClipData
88
import android.content.ClipboardManager
9+
import android.os.Build
910
import android.view.View
1011
import android.widget.TextView
1112
import androidx.core.content.getSystemService
@@ -29,6 +30,8 @@ object ClipboardUtils {
2930
}
3031
val service = view.context.getSystemService<ClipboardManager>() ?: return
3132
service.setPrimaryClip(ClipData.newPlainText(data.second, data.first))
32-
Snackbar.make(view, view.context.getString(R.string.copied_to_clipboard, data.second), Snackbar.LENGTH_LONG).show()
33+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
34+
Snackbar.make(view, view.context.getString(R.string.copied_to_clipboard, data.second), Snackbar.LENGTH_LONG).show()
35+
}
3336
}
3437
}

0 commit comments

Comments
 (0)