mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
General code refactoring
> Removing utility method for isAttachedToWindow > Moving logic to calculate cell size from workspace to DeviceProfile > Replacing some constants with xml resource variables > Saving the item info using content values for better compatibility with other methods Change-Id: Idd612633d97a6241cb31148df9466031374bd5a0
This commit is contained in:
@@ -280,6 +280,18 @@ public class DeviceProfile {
|
||||
return bounds;
|
||||
}
|
||||
|
||||
public Point getCellSize() {
|
||||
Point result = new Point();
|
||||
// Since we are only concerned with the overall padding, layout direction does
|
||||
// not matter.
|
||||
Rect padding = getWorkspacePadding(false /* isLayoutRtl */ );
|
||||
result.x = calculateCellWidth(availableWidthPx - padding.left - padding.right,
|
||||
inv.numColumns);
|
||||
result.y = calculateCellHeight(availableHeightPx - padding.top - padding.bottom,
|
||||
inv.numRows);
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Returns the workspace padding in the specified orientation */
|
||||
Rect getWorkspacePadding(boolean isLayoutRtl) {
|
||||
Rect searchBarBounds = getSearchBarBounds(isLayoutRtl);
|
||||
|
||||
Reference in New Issue
Block a user