package app.furmeet.events.system.helper

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import app.furmeet.events.bff.R
//import org.jetbrains.anko.toast

fun Context.toClipboard(data: CharSequence, label: CharSequence = "Some text", showToast: Boolean = false) {
    val clipboardManager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
    val clipData = ClipData.newPlainText(label, data)
    clipboardManager.setPrimaryClip(clipData)
    if (showToast) {
        toast(getString(R.string.copied_to_clipboard))
    }
}