mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-02 21:04:28 +00:00
properly set text size for "internal main dictionary", so it should work for all devices
This commit is contained in:
parent
0a6a667ef1
commit
50ba6e3129
1 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
|
@ -208,7 +209,10 @@ class LanguageSettingsDialog(
|
|||
if (hasInternalDictForLanguage) {
|
||||
binding.dictionaries.addView(TextView(context, null, R.style.PreferenceCategoryTitleText).apply {
|
||||
setText(R.string.internal_dictionary_summary)
|
||||
textSize *= 0.8f
|
||||
// just setting a text size can be complicated...
|
||||
val attrs = context.obtainStyledAttributes(R.style.PreferenceSubtitleText, intArrayOf(android.R.attr.textSize))
|
||||
setTextSize(TypedValue.COMPLEX_UNIT_PX, attrs.getDimension(0, 20f))
|
||||
attrs.recycle()
|
||||
setPadding((context.resources.displayMetrics.scaledDensity * 16).toInt(), 0, 0, 0)
|
||||
isEnabled = userDicts.none { it.name == "${DictionaryInfoUtils.MAIN_DICT_PREFIX}${USER_DICTIONARY_SUFFIX}" }
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue