From 36fd71bde8acc63bc78ad87b013e2abb08bfffbd Mon Sep 17 00:00:00 2001 From: eehouse Date: Sun, 28 Feb 2010 16:53:48 +0000 Subject: [PATCH] use fillRect instead of two lines --- .../src/org/eehouse/android/xw4/BoardView.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java index 00479396b..0893d34f0 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java @@ -275,8 +275,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, { int indx = focussed ? CommonPrefs.COLOR_FOCUS : CommonPrefs.COLOR_TILE_BACK; - m_fillPaint.setColor( m_otherColors[indx] ); - m_canvas.drawRect( rOuter, m_fillPaint ); + fillRect( rOuter, m_otherColors[indx] ); m_fillPaint.setColor( BLACK ); drawCentered( m_remText, rOuter, null ); @@ -308,8 +307,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, public void score_drawPlayer( Rect rInner, Rect rOuter, DrawScoreInfo dsi ) { if ( 0 != (dsi.flags & CELL_ISCURSOR) ) { - m_fillPaint.setColor( m_otherColors[CommonPrefs.COLOR_FOCUS] ); - m_canvas.drawRect( rOuter, m_fillPaint ); + fillRect( rOuter, m_otherColors[CommonPrefs.COLOR_FOCUS] ); } String text = m_scores[dsi.playerNum]; m_fillPaint.setColor( m_playerColors[dsi.playerNum] ); @@ -362,8 +360,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, foreColor = m_playerColors[owner]; } - m_fillPaint.setColor( backColor ); - m_canvas.drawRect( rect, m_fillPaint ); + fillRect( rect, backColor ); if ( empty ) { if ( (CELL_ISSTAR & flags) != 0 ) { @@ -541,8 +538,8 @@ public class BoardView extends View implements DrawCtx, BoardHandler, } private void drawTileImpl( Rect rect, String text, - BitmapDrawable[] bitmaps, int val, - int flags, boolean clearBack ) + BitmapDrawable[] bitmaps, int val, + int flags, boolean clearBack ) { // boolean valHidden = (flags & CELL_VALHIDDEN) != 0; boolean notEmpty = (flags & CELL_ISEMPTY) == 0; @@ -561,8 +558,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, if ( clearBack ) { int indx = isCursor? CommonPrefs.COLOR_FOCUS : CommonPrefs.COLOR_TILE_BACK; - m_fillPaint.setColor( m_otherColors[indx] ); - m_canvas.drawRect( rect, m_fillPaint ); + fillRect( rect, m_otherColors[indx] ); } m_fillPaint.setColor( m_playerColors[m_trayOwner] );