Changeset 59
- Timestamp:
- 08/08/07 02:45:29 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bbtracker/trunk/src/org/bbtracker/mobile/gui/StatusTile.java
r50 r59 8 8 import org.bbtracker.UnitConverter; 9 9 import org.bbtracker.Utils; 10 import org.bbtracker.mobile.BBTracker; 10 11 import org.bbtracker.mobile.Preferences; 11 12 import org.bbtracker.mobile.TrackManager; … … 70 71 protected void onResize() { 71 72 twoLineLayout = fitsTwoLineLayout(width); 73 if (!twoLineLayout && width < ((MARGIN + latWidth) * 2 + MINIMAL_GAP)) { 74 BBTracker.log("onResize: Setting Font size to small, because even three lines overlap!"); 75 setFontSize(Font.SIZE_SMALL); 76 } 72 77 } 73 78 74 79 protected boolean fitsTwoLineLayout(final int width) { 75 final int twoLineWidth = (MARGIN + MINIMAL_GAP + latWidth) * 2 + lengthWidth; 76 return width >= twoLineWidth; 80 return width >= (MARGIN + MINIMAL_GAP + latWidth) * 2 + lengthWidth; 81 } 82 83 protected boolean fitsThreeLineLayout(final int width) { 84 return width >= (MARGIN + latWidth) * 2 + MINIMAL_GAP; 77 85 } 78 86 … … 167 175 168 176 public int getPreferredHeight(final int width) { 169 final int lineCount = fitsTwoLineLayout(width) ? 2 : 3; 177 final int lineCount; 178 if (fitsTwoLineLayout(width)) { 179 lineCount = 2; 180 } else { 181 lineCount = 3; 182 if (!fitsThreeLineLayout(width)) { 183 BBTracker.log("getPreferredHeight: Setting Font size to small, because even three lines overlap!"); 184 setFontSize(Font.SIZE_SMALL); 185 } 186 } 170 187 return MARGIN + font.getHeight() * lineCount + MARGIN; 171 188 }
Note: See TracChangeset
for help on using the changeset viewer.