mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-16 15:20:31 +05:30
b2b444d3e5
Also improve some related code.
15 lines
457 B
Kotlin
15 lines
457 B
Kotlin
package com.github.libretube.helpers
|
|
|
|
import android.content.ClipData
|
|
import android.content.ClipboardManager
|
|
import android.content.Context
|
|
import androidx.core.content.getSystemService
|
|
import com.github.libretube.R
|
|
|
|
object ClipboardHelper {
|
|
fun save(context: Context, text: String) {
|
|
val clip = ClipData.newPlainText(context.getString(R.string.copied), text)
|
|
context.getSystemService<ClipboardManager>()!!.setPrimaryClip(clip)
|
|
}
|
|
}
|