mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Use grid Rect when calculating clear all position
- This is a follow-up of http://ag/13827968 that uses separate grid Rect to calculate grid layout position - This fixes the case when there are not enough tasks to fill the screen Bug: 174464863 Test: Launch overview grid with only one task, clear all should not be shown until scrolled Change-Id: I4c4f720bc83e6f1feca83285adbe567deea2d063
This commit is contained in:
@@ -1624,12 +1624,12 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
|
||||
float clearAllShorterRowCompensation =
|
||||
mIsRtl ? -shorterRowCompensation : shorterRowCompensation;
|
||||
|
||||
// If the total width is shorter than one task's width, move ClearAllButton further away
|
||||
// If the total width is shorter than one grid's width, move ClearAllButton further away
|
||||
// accordingly.
|
||||
float clearAllShortTotalCompensation = 0;
|
||||
float longRowWidth = Math.max(topRowWidth, bottomRowWidth);
|
||||
if (longRowWidth < mTaskWidth) {
|
||||
float shortTotalCompensation = mTaskWidth - longRowWidth;
|
||||
if (longRowWidth < mLastComputedGridSize.width()) {
|
||||
float shortTotalCompensation = mLastComputedGridSize.width() - longRowWidth;
|
||||
clearAllShortTotalCompensation =
|
||||
mIsRtl ? -shortTotalCompensation : shortTotalCompensation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user