Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1039c87e authored by fuzz's avatar fuzz
Browse files

QS: smaller tiles: Fix the text labels on small screen devices

The text labels are broken if the density is smaller than xhdpi

Change-Id: Ie9859a9d8d539249de1584953f28ac56256ef35c
parent b70ab625
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -91,8 +91,11 @@ public class QuickSettingsTile implements OnClickListener {
        if (tv != null) {
            tv.setText(mLabel);
            tv.setTextSize(mTileTextSize);
            int dpi = mContext.getResources().getDisplayMetrics().densityDpi;
            if (dpi > DisplayMetrics.DENSITY_HIGH) {
                tv.setPadding(0, mTileTextPadding, 0, 0);
            }
        }
        View image = mTile.findViewById(R.id.image);
        if (image != null) {
            MarginLayoutParams params = (MarginLayoutParams) image.getLayoutParams();
@@ -122,8 +125,11 @@ public class QuickSettingsTile implements OnClickListener {
        if (tv != null) {
            tv.setText(mLabel);
            tv.setTextSize(mTileTextSize);
            int dpi = mContext.getResources().getDisplayMetrics().densityDpi;
            if (dpi > DisplayMetrics.DENSITY_HIGH) {
                tv.setPadding(0, mTileTextPadding, 0, 0);
            }
        }
        View image = mTile.findViewById(R.id.image);
        if (image != null && image instanceof ImageView) {
            ((ImageView) image).setImageResource(mDrawable);