2023-01-31 21:13:39 +05:30
|
|
|
package com.github.libretube.helpers
|
2022-10-12 23:26:31 +05:30
|
|
|
|
|
|
|
import android.content.ClipData
|
|
|
|
import android.content.ClipboardManager
|
|
|
|
import android.content.Context
|
2023-02-01 20:16:10 +05:30
|
|
|
import androidx.core.content.getSystemService
|
2022-10-12 23:26:31 +05:30
|
|
|
import com.github.libretube.R
|
|
|
|
|
2023-02-01 20:16:10 +05:30
|
|
|
object ClipboardHelper {
|
|
|
|
fun save(context: Context, text: String) {
|
2022-10-12 23:26:31 +05:30
|
|
|
val clip = ClipData.newPlainText(context.getString(R.string.copied), text)
|
2023-02-01 20:16:10 +05:30
|
|
|
context.getSystemService<ClipboardManager>()!!.setPrimaryClip(clip)
|
2022-10-12 23:26:31 +05:30
|
|
|
}
|
|
|
|
}
|