package com.za.ext

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Context.CLIPBOARD_SERVICE
import com.blankj.utilcode.util.ToastUtils

fun String.taskStateToFlow() : String {
	return when (this) {
		"13001" -> "EXAMINE"
		"18001" -> "FINISH"
		"15001" -> "OPERATION"
		"17001" -> "DESTPHOTO"
		"18100" -> "GIVEUP"
		else -> ""
	}
}

fun String?.copy(context : Context) {
	if (this.isNullOrBlank()) {
		return
	}
	val clipboardManager = context.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
	clipboardManager.setPrimaryClip(ClipData.newPlainText("", this))
	ToastUtils.showLong("复制成功")
}