mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Setting tab bar widths automatically
- will make launcher adapt better to different screen sizes - also, moved customization tray tab setup code from Launcher to CustomizeTrayTabHost Change-Id: I27a1acdacd231150bf191548d155c0e94d855796
This commit is contained in:
@@ -243,6 +243,15 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
|
||||
setMeasuredDimension(newWidth, newHeight);
|
||||
}
|
||||
|
||||
int getContentWidth() {
|
||||
// Return the distance from the left edge of the content of the leftmost icon to
|
||||
// the right edge of the content of the rightmost icon
|
||||
|
||||
// icons are centered within cells, find out how much offset that accounts for
|
||||
int iconHorizontalOffset = (mCellWidth - Utilities.getIconContentSize());
|
||||
return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap - iconHorizontalOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
int count = getChildCount();
|
||||
@@ -281,17 +290,6 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
|
||||
mHolographicChildren.setGap(widthGap, heightGap);
|
||||
}
|
||||
|
||||
public void setCellDimensions(int width, int height) {
|
||||
mCellWidth = width;
|
||||
mCellHeight = height;
|
||||
mChildren.setCellDimensions(width, height);
|
||||
mHolographicChildren.setCellDimensions(width, height);
|
||||
}
|
||||
|
||||
public int getDefaultCellDimensions() {
|
||||
return sDefaultCellDimensions;
|
||||
}
|
||||
|
||||
public int[] getCellCountForDimensions(int width, int height) {
|
||||
// Always assume we're working with the smallest span to make sure we
|
||||
// reserve enough space in both orientations
|
||||
|
||||
Reference in New Issue
Block a user