From 2ae6bd8caf8f1cf0a395a2bf803a6a901044e1a3 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 1 Jul 2012 12:54:38 -0700 Subject: [PATCH] override onMeasure to make BoardView only as large as it needs to be so that on tall narrow screens (e.g. Kindle Fire) there's no white space between the tray and the buttons. --- xwords4/android/XWords4/res/layout/board.xml | 2 +- .../org/eehouse/android/xw4/BoardView.java | 84 +++++++++++++++++-- 2 files changed, 78 insertions(+), 8 deletions(-) diff --git a/xwords4/android/XWords4/res/layout/board.xml b/xwords4/android/XWords4/res/layout/board.xml index e53836991..001d4c4a6 100644 --- a/xwords4/android/XWords4/res/layout/board.xml +++ b/xwords4/android/XWords4/res/layout/board.xml @@ -9,7 +9,7 @@ maxCellSize ) { @@ -296,9 +368,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, trayHt += heightLeft * 2; scoreHt += heightLeft; heightUsed = trayHt + scoreHt + ((nCells - nToScroll) * cellSize); - heightLeft = height - heightUsed; } - result.top = heightLeft / 2; result.trayHt = trayHt; result.scoreHt = scoreHt; @@ -308,7 +378,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, result.height = heightUsed; result.cellSize = cellSize; - if ( gi.timerEnabled ) { + if ( m_gi.timerEnabled ) { Paint paint = new Paint(); paint.setTextSize( m_mediumFontHt ); paint.getTextBounds( "-00:00", 0, 6, m_boundsScratch ); @@ -334,7 +404,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, m_letterRect = null; m_valRect = null; - BoardDims dims = figureBoardDims( width, height, m_gi ); + BoardDims dims = figureBoardDims( width, height ); m_left = dims.left; m_top = dims.top;