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

Commit 5cba8626 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

QuickContactBadge shows its pressed state

Change-Id: I7dfd02cc5c4e0a5ba6a7d65c2c61d650f5aa9249
parent ef9932c2
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -112,6 +112,16 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
        mBadgeBackground = getBackground();
    }

    @Override
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        Drawable d = mOverlay;
        if (d != null && d.isStateful()) {
            d.setState(getDrawableState());
            invalidate();
        }
    }

    private void init() {
        mQueryHandler = new QueryHandler(mContext.getContentResolver());
        setOnClickListener(this);
@@ -130,7 +140,8 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        if (mOverlay == null || mOverlay.getIntrinsicWidth() == 0 || mOverlay.getIntrinsicHeight() == 0) {
        if (mOverlay == null || mOverlay.getIntrinsicWidth() == 0 ||
                mOverlay.getIntrinsicHeight() == 0) {
            return; // nothing to draw
        }