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

Commit 06665dcf authored by Chun-Ku Lin's avatar Chun-Ku Lin
Browse files

Enforce the gridview vertical spacing to be >= 0

In landscape mode on phone, when the viewpager's height is not able to
fit the grid items, the calculated vertical spacing is negative number,
which results in overlapping text

Bug: 361454352
Test: manual. Maxout the display and font size and view the a11yMenu on
phone in landscape mode
Flag: EXEMPT low risk bugfix

Change-Id: I2fea76399ba6f2b2bbb713ab578e00c439dafb04
parent 44141021
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -306,6 +306,10 @@ public class A11yMenuViewPager {
                    (viewPagerHeight - topMargin - defaultMargin
                            - (rowsInGridView * gridItemHeight))
                            / (rowsInGridView + 1);
            // The interval is negative number when the viewPagerHeight is not able to fit
            // the grid items, which result in text overlapping.
            // Adjust the interval to 0 could solve the issue.
            interval = Math.max(interval, 0);
            mViewPagerAdapter.setVerticalSpacing(interval);

            // Sets padding to view pager.