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

Commit 2849b3c4 authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "QS: respect equalizer in switch to small tiles" into cm-11.0

parents edfb6f0e 3ce27032
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,10 @@ public class EqualizerTile extends QuickSettingsTile {
        };
    }

    @Override
    protected View getImageView() {
        return mTile.findViewById(R.id.visualizer_view);
    }

    @Override
    void onPostCreate() {
+14 −6
Original line number Diff line number Diff line
@@ -72,11 +72,11 @@ public class QuickSettingsTile implements OnClickListener {
    }

    public void switchToRibbonMode() {
        TextView tv = (TextView) mTile.findViewById(R.id.text);
        TextView tv = getLabelView();
        if (tv != null) {
            tv.setVisibility(View.GONE);
        }
        View image = mTile.findViewById(R.id.image);
        View image = getImageView();
        if (image != null) {
            MarginLayoutParams params = (MarginLayoutParams) image.getLayoutParams();
            int margin = mContext.getResources().getDimensionPixelSize(
@@ -87,7 +87,7 @@ public class QuickSettingsTile implements OnClickListener {
    }

    public void switchToSmallIcons() {
        TextView tv = (TextView) mTile.findViewById(R.id.text);
        TextView tv = getLabelView();
        if (tv != null) {
            tv.setText(mLabel);
            tv.setTextSize(mTileTextSize);
@@ -96,7 +96,7 @@ public class QuickSettingsTile implements OnClickListener {
                tv.setPadding(0, mTileTextPadding, 0, 0);
            }
        }
        View image = mTile.findViewById(R.id.image);
        View image = getImageView();
        if (image != null) {
            MarginLayoutParams params = (MarginLayoutParams) image.getLayoutParams();
            int margin = mContext.getResources().getDimensionPixelSize(
@@ -106,6 +106,14 @@ public class QuickSettingsTile implements OnClickListener {
        }
    }

    protected View getImageView() {
        return mTile.findViewById(R.id.image);
    }

    protected TextView getLabelView() {
        return (TextView) mTile.findViewById(R.id.text);
    }

    void onPostCreate() {}

    public void onDestroy() {}
@@ -121,7 +129,7 @@ public class QuickSettingsTile implements OnClickListener {
    }

    void updateQuickSettings() {
        TextView tv = (TextView) mTile.findViewById(R.id.text);
        TextView tv = getLabelView();
        if (tv != null) {
            tv.setText(mLabel);
            tv.setTextSize(mTileTextSize);
@@ -130,7 +138,7 @@ public class QuickSettingsTile implements OnClickListener {
                tv.setPadding(0, mTileTextPadding, 0, 0);
            }
        }
        View image = mTile.findViewById(R.id.image);
        View image = getImageView();
        if (image != null && image instanceof ImageView) {
            ((ImageView) image).setImageResource(mDrawable);
        }