在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):VictorChow/kotlin-android-lib开源软件地址(OpenSource Url):https://github.com/VictorChow/kotlin-android-lib开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):KotlinAndroidLib一些Android开发的扩展。 2.x - AndroidX1.x - Android SupportUsage//初始化
Ext.with(application) Gradleallprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
} //依赖项
//org.jetbrains.kotlin:kotlin-stdlib-jdk7
2.x
dependencies {
implementation 'com.github.VictorChow:kotlin-android-lib:2.0.0'
}
1.x
dependencies {
implementation 'com.github.VictorChow:kotlin-android-lib:1.2.4'
} BriefViewExt//设置宽高
fun View.setWidth(value: Int)
fun View.setHeight(value: Int)
fun View.resize(width: Int, height: Int)
... CommonExtfun findColor(@ColorRes resId: Int)
fun findDrawable(@DrawableRes resId: Int)
fun findColorStateList(@ColorRes resId: Int)
... DisplayExtval screenWidth: Int
val screenHeight: Int
val screenDensity: Float
... DateTimeExtfun Long.year()
fun Long.month()
fun Long.day()
... StringExtfun String.toast()
fun String.md5()
fun String.sha1()
... ListenerExtfun Animator.addListener {
onStart { }
onCancel { }
onEnd { }
onRepeat { }
}
fun Animator.addPauseListener {
onPause { }
onResume { }
}
... ManagerExtval connectivityManager
val alarmManager
val telephonyManager
val activityManager
... SharedPreferencesExtfun spSetInt(key: String, value: Int)
fun spGetInt(key: String, defaultValue: Int = 0)
... BitmapExtfun Bitmap.toBase64(): String
fun Bitmap.resize(w: Number, h: Number): Bitmap
... FileExtfun File.copy(dest: File)
fun File.copyDirectory(dest: File)
... ToastExtfun toast(msg: Any, isShort: Boolean = true) ActivityExtfun Activity.goActivity<T>()
fun Activity.goActivity<T>(requestCode: Int)
... FragmentExt (support.v4)fun Fragment.goActivity<T>()
fun Fragment.goActivity<T>(requestCode: Int)
... ActivityMgrfun add(activity: Activity)
fun remove(activity: Activity)
fun removeAll()
... ApiExtfun aboveApi(api: Int, included: Boolean = false, block: () -> Unit)
fun belowApi(api: Int, included: Boolean = false, block: () -> Unit) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论