Skip to content

Commit

Permalink
Merge pull request #512 from Mahmud0808/beta
Browse files Browse the repository at this point in the history
Vertical Tiles: Fix compatibility with text size changer
  • Loading branch information
Mahmud0808 authored Jun 2, 2024
2 parents d87da14 + 676df39 commit 138fbf2
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -898,17 +898,25 @@ class QuickSettings(context: Context?) : ModPack(context!!) {

private fun setLabelSizes(paramThisObject: Any) {
try {
val textSize = mContext.resources.getDimensionPixelSize(
mContext.resources.getIdentifier(
"qs_tile_text_size",
"dimen",
mContext.packageName
)
)

if (qsTilePrimaryTextSize != null && qsTilePrimaryTextSizeUnit != -1) {
(getObjectField(paramThisObject, "label") as TextView).setTextSize(
qsTilePrimaryTextSizeUnit,
qsTilePrimaryTextSize!!
textSize.toFloat()
)
}

if (qsTileSecondaryTextSize != null && qsTileSecondaryTextSizeUnit != -1) {
(getObjectField(paramThisObject, "secondaryLabel") as TextView).setTextSize(
qsTileSecondaryTextSizeUnit,
(qsTileSecondaryTextSize!! * 0.92).toFloat()
(textSize * 0.92).toFloat()
)
}
} catch (ignored: Throwable) {
Expand Down

0 comments on commit 138fbf2

Please sign in to comment.