mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 12:00:03 +03:00
making use of roundToInt to avoid separate rounding and toInt
This commit is contained in:
parent
f8e65f5872
commit
57be0ba913
1 changed files with 2 additions and 1 deletions
|
@ -26,6 +26,7 @@ import androidx.core.content.ContextCompat
|
|||
import dagger.hilt.EntryPoints
|
||||
import im.vector.app.core.di.SingletonEntryPoint
|
||||
import kotlin.math.round
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
fun Context.singletonEntryPoint(): SingletonEntryPoint {
|
||||
return EntryPoints.get(applicationContext, SingletonEntryPoint::class.java)
|
||||
|
@ -45,5 +46,5 @@ fun Context.getTintedDrawable(@DrawableRes drawableRes: Int, @ColorInt tint: Int
|
|||
}
|
||||
|
||||
private fun Float.toAndroidAlpha(): Int {
|
||||
return round(this * 255).toInt()
|
||||
return (this * 255).roundToInt()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue