From be47bbcc81648cd7b619f2f40d070b227fa56b69 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 29 Feb 2024 16:52:48 -0800 Subject: [PATCH] paint recent move tiles differently from pending ones --- .../org/eehouse/android/xw4/BoardCanvas.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardCanvas.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardCanvas.java index 4eb57598f..09641a649 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardCanvas.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardCanvas.java @@ -405,10 +405,8 @@ public class BoardCanvas extends Canvas implements DrawCtx { backColor = m_bonusColors[bonus]; bonusStr = m_bonusSummaries[bonus]; } - } else if ( pending || recent ) { - if ( pending ) { - ++mPendingCount; - } + } else if ( pending ) { + ++mPendingCount; if ( darkOnLight() ) { foreColor = WHITE; backColor = BLACK; @@ -418,6 +416,9 @@ public class BoardCanvas extends Canvas implements DrawCtx { } } else { backColor = m_otherColors[CommonPrefs.COLOR_TILE_BACK]; + if ( recent ) { + backColor = shade( backColor ); + } } fillRect( rect, adjustColor( backColor ) ); @@ -923,6 +924,19 @@ public class BoardCanvas extends Canvas implements DrawCtx { return null != m_fontDims; } // figureFontDims + private int shade( int color ) + { + int newColor = color & 0xFF000000; // keep the alpha + for ( int ii = 0; ii < 3; ++ii ) { + int byt = ((color >> (ii * 8)) & 0xFF); + byt = (byt + 0x7F) % 0xFF; + Assert.assertTrue( byt <= 255 ); + newColor |= byt << (ii * 8); + } + Log.d( TAG, "shade(%x) => %x", color, newColor ); + return newColor; + } + private int adjustColor( int color ) { if ( m_inTrade ) {