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

Commit ae74d12c authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

base: Fix margin layouts params of MobileNetworkTile



MobileNetworkTile use an internal frame, so we need to restrict frame margins instead of image margin

Change-Id: I1861866c814eece7911f6fc4a5671575173c12e0
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent c1220445
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ import android.content.Intent;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.internal.util.cm.QSUtils;
import com.android.systemui.R;
@@ -167,4 +167,16 @@ public class MobileNetworkTile extends NetworkTile {
        }
        return aux;
    }

    // MobileNetworkTile use an internal frame, so we need to restrict frame margins
    // instead of image margin
    @Override
    public void setImageMargins(int margin) {
        View image = mTile.findViewById(R.id.image);
        if (image != null) {
            MarginLayoutParams params = (MarginLayoutParams) image.getLayoutParams();
            params.topMargin = params.bottomMargin = margin;
            image.setLayoutParams(params);
        }
    }
}