Giter Club home page Giter Club logo

utils-android's Issues

快捷方法调整

/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 就行

bug

方法错误,返回值没有!!

fun View.toBitmap() { ImageUtils.view2Bitmap(this) }

TODO

        (binding.vp.getChildAt(0) as? RecyclerView)?.overScrollMode = RecyclerView.OVER_SCROLL_NEVER

add a convinent method for ViewPager2 to set overScrollMode

bug

me.shouheng.utils.ui.BarUtils#setNavBarLightMode(android.app.Activity, boolean)

activity utils

activity 启动动画

增加 noanimation 使用


            activity.overridePendingTransition(0, 0)

需求池

  1. SPUtils getInstance 方法重命名为 get,getInstance 太长
  2. LogUtils 类重命名为 L,LogUtils 太长
  3. 应用前后台切换的监听
  4. 动画工具类修改名称
  5. 权限工具类增加自定义权限名称的接口

新增需求

  • 平板检测相关的逻辑添加到 utils
  • let 等的增强版本 letOrElse 便捷方法

代码缩进等相关的快捷方法

SpannableString(binding.tvLog.text).apply {
    setSpan(UnderlineSpan(), 0, binding.tvLog.text.length, 0)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.