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

Commit 1110fd77 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed the messaging clipping for RTL languages

Because in landscape the width is bigger than the height,
our clipping logic was wrong and clipped off most of the
text.

Test: add messaging style notification, switch to RTL, landscape, observe normal clipping
Change-Id: I8c74a8405280047f8b2a08ecdf3f37b0fbeeec62
Fixes: 73895612
Fixes: 78606052
parent 9f88bbc0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -118,7 +118,8 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
            ViewGroup parent = (ViewGroup) mSenderName.getParent();
            int top = getDistanceFromParent(mSenderName, parent) - getDistanceFromParent(
                    mMessageContainer, parent) + mSenderName.getHeight();
            clipRect = new Rect(0, top, mDisplaySize.x, mDisplaySize.y);
            int size = Math.max(mDisplaySize.x, mDisplaySize.y);
            clipRect = new Rect(0, top, size, size);
        } else {
            clipRect = null;
        }
+2 −1
Original line number Diff line number Diff line
@@ -110,7 +110,8 @@ public class MessagingLayout extends FrameLayout {
        // We still want to clip, but only on the top, since views can temporarily out of bounds
        // during transitions.
        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
        Rect rect = new Rect(0, 0, displayMetrics.widthPixels, displayMetrics.heightPixels);
        int size = Math.max(displayMetrics.widthPixels, displayMetrics.heightPixels);
        Rect rect = new Rect(0, 0, size, size);
        mMessagingLinearLayout.setClipBounds(rect);
        mTitleView = findViewById(R.id.title);
        mAvatarSize = getResources().getDimensionPixelSize(R.dimen.messaging_avatar_size);