Fix widget span
Need to take the horizontal margin of the view into consideration. Fix: 233302799 Test: manual Change-Id: I5f584977db85d5436b22c3701f586a5b079099ae
This commit is contained in:
1 parent
2940565595
commit
4f3cf5d05f
1 file changed
+3
-1
@@ -198,7 +198,9 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
|
||||
/** Returns the number of cells that can fit horizontally in a given {@code content}. */
|
||||
protected int computeMaxHorizontalSpans(View content, int contentHorizontalPaddingPx) {
|
||||
DeviceProfile deviceProfile = mActivityContext.getDeviceProfile();
|
||||
int availableWidth = content.getMeasuredWidth() - contentHorizontalPaddingPx;
|
||||
int availableWidth = content.getMeasuredWidth()
|
||||
- contentHorizontalPaddingPx
|
||||
- (2 * mContentHorizontalMarginInPx);
|
||||
Point cellSize = deviceProfile.getCellSize();
|
||||
if (cellSize.x > 0) {
|
||||
return availableWidth / cellSize.x;
|
||||
|
||||
Reference in new issue
Block a user