shouheng88 / utils-android Goto Github PK
View Code? Open in Web Editor NEWConvenient android utils and Kotlin DSL styled extensions.
License: Apache License 2.0
Convenient android utils and Kotlin DSL styled extensions.
License: Apache License 2.0
/Users/shouhwang/.gradle/caches/modules-2/files-2.1/com.github.Shouheng88/utils-ktx/2.8.7/3d16a937b3877b2a49b6d05a9c49cb4667b181fa/utils-ktx-2.8.7-sources.jar!/me/shouheng/utils/ktx/StringKtx.kt:67
fun String.safeToInt(str: String, def: Int = 0): Int = try { str.toInt() } catch (e: NumberFormatException) { def }
fun String.safeToLong(str: String, def: Long = 0): Long = try { str.toLong() } catch (e: NumberFormatException) { def }
fun String.safeToFloat(str: String, def: Float = 0f): Float = try { str.toFloat() } catch (e: NumberFormatException) { def }
fun String.safeToDouble(str: String, def: Double = .0): Double = try { str.toDouble() } catch (e: NumberFormatException) { def }
写错了,应该用 this 就行
方法错误,返回值没有!!
fun View.toBitmap() { ImageUtils.view2Bitmap(this) }
(binding.vp.getChildAt(0) as? RecyclerView)?.overScrollMode = RecyclerView.OVER_SCROLL_NEVER
add a convinent method for ViewPager2 to set overScrollMode
me.shouheng.utils.ui.BarUtils#setNavBarLightMode(android.app.Activity, boolean)
activity 启动动画
增加 noanimation 使用
activity.overridePendingTransition(0, 0)
toast 新增 errorToast, infoToast, errorToast 等快捷方法
代码缩进等相关的快捷方法
SpannableString(binding.tvLog.text).apply {
setSpan(UnderlineSpan(), 0, binding.tvLog.text.length, 0)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.