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

Commit eb3faf68 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Call adjustSpacingForImage only when showing the image

The fix from Ife591964a0b83377889d263eed0d23423fa4493b unfortunately
made adjustSpacingForImage be called a bit too eagerly - so when we had
a large icon, but no messaging image, the margins calculated in
Notification.java would be overridden.

Fix: 433674096
Flag: android.app.notifications_redesign_templates
Test: manually test group conversations with and without large icons and
image messages (and combinations thereof)

Change-Id: I5e9daf60818727b1e6c1f12fc8ea47b775e1d3a9
parent 45b04e57
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RemoteViews;
import android.widget.TextView;
import android.widget.flags.Flags;

import com.android.internal.R;
import com.android.internal.widget.ConversationAvatarData.GroupConversationAvatarData;
@@ -724,8 +723,10 @@ public class ConversationLayout extends FrameLayout
                mRightIconView.setVisibility(GONE);
            }
        }
        if (isShowingImage) {
            adjustSpacingForImage();
        }
    }

    /**
     * When showing an isolated image message similar to the large icon, adjust the margin of the
+3 −2
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RemoteViews;
import android.widget.flags.Flags;

import com.android.internal.R;

@@ -435,8 +434,10 @@ public class MessagingLayout extends FrameLayout
                mRightIconView.setVisibility(GONE);
            }
        }
        if (isShowingImage) {
            adjustSpacingForImage();
        }
    }

    /**
     * When showing an isolated image message similar to the large icon, adjust the margin of the