| | |
| | | |
| | | import android.Manifest |
| | | import android.app.ActivityManager |
| | | import android.content.ClipData |
| | | import android.content.ClipboardManager |
| | | import android.content.ContentResolver |
| | | import android.content.Context |
| | | import android.content.Intent |
| | |
| | | import androidx.activity.result.contract.ActivityResultContracts |
| | | import androidx.annotation.ColorRes |
| | | import androidx.annotation.StringRes |
| | | import androidx.collection.ArraySet |
| | | import androidx.core.content.ContextCompat |
| | | import androidx.lifecycle.Observer |
| | | import androidx.lifecycle.ViewModelProvider |
| | |
| | | showToast(getString(msg)) |
| | | } |
| | | |
| | | fun copyStr(str:String){ |
| | | // 获取系统剪贴板 |
| | | val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager |
| | | // 创建一个剪贴数据集,包含一个普通文本数据条目(需要复制的数据) |
| | | val clipData = ClipData.newPlainText(null ,str) |
| | | // 把数据集设置(复制)到剪贴板 |
| | | clipboard.setPrimaryClip(clipData) |
| | | } |
| | | /** |
| | | * 获取文件保存路径 sdcard根目录/download/文件名称 |
| | | * @param fileUrl |
| | |
| | | } |
| | | |
| | | fun getStringSetProjectPrefrence(key : String) : Set<*> { |
| | | return getStringSetProjectPrefrence(key, ArraySet<Any?>() ) |
| | | return getStringSetProjectPrefrence(key, HashSet<Any?>() ) |
| | | } |
| | | |
| | | fun getStringSetProjectPrefrence(key : String,value : Set<*>?) : Set<*> { |
| | |
| | | } |
| | | |
| | | fun getStringSetUserPrefrence(key : String) : Set<*> { |
| | | return getStringSetUserPrefrence(key,ArraySet<Any?>()) |
| | | return getStringSetUserPrefrence(key,HashSet<Any?>()) |
| | | } |
| | | |
| | | fun getStringSetUserPrefrence(key : String,value : Set<*>) : Set<*> { |