data class ContactItem |
|
enum class Intensity |
|
class RHintSpinner |
|
class RPermission |
|
class RPickMedia |
|
class RPreference |
|
enum class ResizeMode |
fun bitmapToDrawable(bitmap: Bitmap): Drawable
Bitmap to Drawable |
|
fun copyAssets(path: String): Unit
Assets to Internal Storage |
|
fun copyText(text: CharSequence): Unit
copy text to clipboard |
|
fun createNotificationChannel(id: String = "", name: String = "", description: String = "", importance: Int = NotificationManager.IMPORTANCE_LOW): String
create Notification Channel for Android Oreo and above. every options is optional, if you doesn't matter whatever value, leave them no parameters. |
|
fun dimen(resource: Int): Int
get pixel size from DimenRes |
|
fun dip2px(value: Int): Int fun dip2px(value: Float): Int
convert dip to px |
|
fun downloadBitmap(imageUrl: String): Bitmap?
Download bitmap from uri |
|
fun downloadFile(urlPath: String, localPath: String, callback: (Uri?) -> Unit = {}): Uri? fun downloadFile(urlPath: String, localPath: String, callback: F1<Uri>?): Uri?
Download file from uri |
|
fun drawableToBitmap(drawable: Drawable): Bitmap
Convert Drawable to Bitmap in safe way |
|
fun generateViewId(): Int
Generate View ID |
|
fun getAndroidId(): String
get androidId of device |
|
fun getImageHeight(resId: Int): Int
get Height of Image which given Drawable Resources |
|
fun getImageMimeType(resId: Int): String
get MimeType of Image which given Drawable Resources |
|
fun getImageWidth(resId: Int): Int
get Width of Image which given Drawable Resources |
|
fun getJSONArray(jsonObject: JSONObject?, name: String): JSONArray?
get JSONArray from JSONObject fun getJSONArray(jsonArray: JSONArray?, index: Int): JSONArray?
get JSONArray from JSONArray |
|
fun getJSONObject(jsonObject: JSONObject?, name: String): JSONObject?
get JSONObject from JSONObject fun getJSONObject(jsonArray: JSONArray?, index: Int): JSONObject?
get JSONObject from JSONArray |
|
fun getKeyHash(): String
get key hash of application |
|
fun getPhotoOrientationDegree(filePath: String?): Int
get orientation degree of photo from ExifInterface |
|
fun getTextFromClipboard(): String
get text of clipboard list |
|
fun getUri(file: File?): Uri?
Convert File into Uri. |
|
fun getVibratorPattern(intensity: Intensity, duration: Long): LongArray
get Intensity (Desired Strength) of Vibrate NOTE: Some device's default value may 0.7f (Tested in Galaxy S6), fun getVibratorPattern(intensity: Float, duration: Long): LongArray
get Intensity (Desired Strength) of Vibrate Normal Way, just use getVibratorPattern(Intensity, long) for easy work. |
|
fun isConnected(): Boolean
get state of connected |
|
fun isMediaUri(uri: Uri?): Boolean
check uri is media uri |
|
fun isMobileConnected(): Boolean
get Mobile connection check |
|
fun isNotConnected(): Boolean
get state of not connected |
|
fun isWifiConnected(): Boolean
get Wifi connection check |
|
fun put(jsonObject: JSONObject?, name: String, value: Any): JSONObject?
put value to JSONObject fun put(jsonArray: JSONArray?, index: Int, value: Any): JSONArray?
put value to JSONArray fun put(jsonArray: JSONArray?, value: Any): JSONArray?
put value to JSONArray without ordering |
|
fun px2dip(px: Int): Float
convert px to dip |
|
fun px2sp(px: Int): Float
convert px to sp |
|
fun rotate(bitmap: Bitmap, degree: Int): Bitmap
rotate bitmap |
|
fun runAsync(poolSize: Int = RAsync.instance.settingPoolSize, action: () -> Unit): Unit fun runAsync(poolSize: Int = RAsync.instance.settingPoolSize, action: F0): Unit
run code inside of Background thread with custom pool size this will help in multi-threading working fun runAsync(action: () -> Unit): Unit fun runAsync(action: F0): Unit
run code inside of Background thread with default pool size this will help in multi-threading working |
|
fun runDelayed(delayMillis: Long, action: () -> Unit): Boolean fun runDelayed(delayMillis: Long, action: F0): Boolean
run code inside of Background Thread after given delay |
|
fun runDelayedOnUiThread(action: () -> Unit, delayMillis: Long): Boolean fun runDelayedOnUiThread(action: F0, delayMillis: Long): Boolean
run code inside of UI Thread after given delay |
|
fun runOnUiThread(action: () -> Unit): Boolean fun runOnUiThread(action: F0): Boolean
run code inside of UI Thread |
|
fun saveFile(fullPath: String, content: String): File
save file with content |
|
fun sp2px(value: Int): Int fun sp2px(value: Float): Int
convert sp to px |
|
fun toNumFormat(num: String): String
formatting number like 1,000,000 |
|
fun <T, R> T.tryCatch(block: (T) -> R): R |
|
fun versionCode(): Int
get version code of this application |
|
fun versionName(): String
get version name of this application |
|
fun vibrate(millSec: Long): Unit fun vibrate(pattern: LongArray, repeat: Int = -1): Unit
Vibrate need VIBRATE permission |