fixed review

This commit is contained in:
Vladimir 2020-07-09 11:38:03 +03:00
parent cf09511e16
commit b2084ed4a1
1 changed files with 3 additions and 5 deletions

View File

@ -36,20 +36,18 @@ fun Context.getDisplayMetrics(): DisplayMetrics {
*
* @return Size in pixels.
*/
fun Int.toPixels() = (this * Resources.getSystem().displayMetrics.density).toInt()
fun Int.toPixels(): Int = (this * Resources.getSystem().displayMetrics.density).toInt()
/**
* Simply converts Dp to pixels.
*
* @return Size in pixels.
*/
fun Float.toPixels() = this * Resources.getSystem().displayMetrics.density
fun Float.toPixels(): Float = this * Resources.getSystem().displayMetrics.density
/**
* Simply converts pixels to Dp.
*
* @return Size in dp.
*/
fun Int.toDp() = (this / Resources.getSystem().displayMetrics.density).toInt()
fun Int.toDp(): Int = (this / Resources.getSystem().displayMetrics.density).toInt()