diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ThemeEditText.kt b/app/src/main/java/io/legado/app/lib/theme/view/ThemeEditText.kt index b9e2b891cea4..b7607f51a984 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ThemeEditText.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ThemeEditText.kt @@ -1,6 +1,7 @@ package io.legado.app.lib.theme.view import android.content.Context +import android.os.Build import android.util.AttributeSet import androidx.appcompat.widget.AppCompatEditText import io.legado.app.lib.theme.accentColor @@ -15,5 +16,8 @@ class ThemeEditText @JvmOverloads constructor( if (!isInEditMode) { applyTint(context.accentColor) } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) { + isLocalePreferredLineHeightForMinimumUsed = false + } } } diff --git a/app/src/main/java/io/legado/app/ui/widget/SearchView.kt b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt index 7e97591f89a4..24eeca7d5cfa 100644 --- a/app/src/main/java/io/legado/app/ui/widget/SearchView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt @@ -6,6 +6,7 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Paint import android.graphics.drawable.Drawable +import android.os.Build import android.text.Spannable import android.text.SpannableStringBuilder import android.text.style.ImageSpan @@ -42,6 +43,9 @@ class SearchView @JvmOverloads constructor( // 改变字体 textView!!.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f) textView!!.gravity = Gravity.CENTER_VERTICAL + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) { + textView!!.isLocalePreferredLineHeightForMinimumUsed = false + } updateQueryHint() } catch (e: Exception) { e.printOnDebug()