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

Commit 891bd2ba authored by Paul Soulos's avatar Paul Soulos
Browse files

Fixes TouchDelegate bug in QCA

bug: 16460824
Change-Id: I0357cec8ad1899137174bae23c0d494bd290190d
parent a5e17ac3
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -455,7 +455,6 @@ public class ExpandingEntryCardView extends LinearLayout {
        }
    }

    // TODO add accessibility content descriptions
    private View createEntryView(LayoutInflater layoutInflater, Entry entry) {
        final View view = layoutInflater.inflate(
                R.layout.expanding_entry_card_item, this, false);
@@ -518,22 +517,20 @@ public class ExpandingEntryCardView extends LinearLayout {
            alternateIcon.setVisibility(View.VISIBLE);
            alternateIcon.setContentDescription(entry.getAlternateContentDescription());

            // Expand the clickable area for alternate icon to be top to bottom and to right edge
            // Expand the clickable area for alternate icon to be top to bottom and to end edge
            // of the entry view
            view.post(new Runnable() {
                @Override
                public void run() {
                    final Rect entryRect = new Rect();
                    view.getHitRect(entryRect);

                    final Rect alternateIconRect = new Rect();
                    alternateIcon.getHitRect(alternateIconRect);
                    alternateIconRect.bottom = entryRect.bottom;
                    alternateIconRect.top = entryRect.top;

                    alternateIconRect.bottom = view.getHeight();
                    alternateIconRect.top = 0;
                    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
                        alternateIconRect.left = entryRect.left;
                        alternateIconRect.left = 0;
                    } else {
                        alternateIconRect.right = entryRect.right;
                        alternateIconRect.right = view.getWidth();
                    }
                    final TouchDelegate touchDelegate =
                            new TouchDelegate(alternateIconRect, alternateIcon);