fix #1616 (a11y): Use SP font size for marker labels on the map (#1630)

* Use and SP font size for marker labels on the map

* Fix detekt issue
This commit is contained in:
Joshua Soberg 2025-03-02 10:14:12 -05:00 committed by GitHub
parent 1a11c3351b
commit 5da827473a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -19,6 +19,7 @@ package com.geeksville.mesh.android
import android.app.Activity
import android.content.Context
import android.util.TypedValue
import android.view.inputmethod.InputMethodManager
import android.widget.Toast
@ -35,3 +36,7 @@ fun Activity.hideKeyboard() {
imm?.hideSoftInputFromWindow(v.windowToken, 0)
}
}
// Converts SP to pixels.
fun Context.spToPx(sp: Float): Int =
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, resources.displayMetrics).toInt()