Setting min width of content in customize tray automatically

This commit is contained in:
Michael Jurka
2011-04-05 16:52:32 -07:00
parent 3f272c6665
commit 0413dfa01b
4 changed files with 7 additions and 8 deletions

View File

@@ -247,9 +247,12 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
// 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;
// icons are centered within cells, find out how much padding that accounts for
return getWidthBeforeLayout() - (mCellWidth - Utilities.getIconContentSize());
}
int getWidthBeforeLayout() {
return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap;
}
@Override