From b49792c750d8745edbc6fe6c0ec3372c0add8db9 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 16 Jul 2021 12:21:49 -0700 Subject: [PATCH] make cell line width settable --- .../java/org/eehouse/android/xw4/BoardCanvas.java | 14 ++++++-------- .../app/src/main/res/values/common_rsrc.xml | 11 ++++++++++- .../android/app/src/main/res/values/strings.xml | 5 +++-- .../app/src/main/res/xml/prefs_appear_colors.xml | 9 +++++++++ 4 files changed, 28 insertions(+), 11 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 a80bd8e5f..c6ff4e498 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 @@ -468,13 +468,11 @@ public class BoardCanvas extends Canvas implements DrawCtx { // frame the cell int frameColor = m_otherColors[CommonPrefs.COLOR_CELLLINE]; m_strokePaint.setColor( adjustColor(frameColor) ); - if ( false ) { - // PENDING: fetch/calculate this a lot less frequently!! - int linePct = XWPrefs.getPrefsInt( m_activity, R.string.key_board_line_pct, 1 ); - linePct = Math.min( 25, linePct ); - int width = Math.max(1, (rect.width() * linePct) / 100); - m_strokePaint.setStrokeWidth( width ); - } + + // PENDING: fetch/calculate this a lot less frequently!! + int width = XWPrefs.getPrefsInt( m_activity, R.string.key_board_line_width, 1 ); + m_strokePaint.setStrokeWidth( width ); + drawRect( rect, m_strokePaint ); drawCrosshairs( rect, flags ); @@ -779,7 +777,7 @@ public class BoardCanvas extends Canvas implements DrawCtx { m_fillPaint.setTextAlign( align ); drawText( text, origin, bottom, m_fillPaint ); } - } // drawCentered + } // drawIn private void drawScaled( String text, final Rect rect, Rect textBounds, int descent ) diff --git a/xwords4/android/app/src/main/res/values/common_rsrc.xml b/xwords4/android/app/src/main/res/values/common_rsrc.xml index a4aeeca6d..a14bf96b4 100644 --- a/xwords4/android/app/src/main/res/values/common_rsrc.xml +++ b/xwords4/android/app/src/main/res/values/common_rsrc.xml @@ -35,7 +35,7 @@ key_cellline key_clr_crosshairs key_clr_bonushint - key_board_line_pct + key_board_line_width key_relay_host key_relay_port2 @@ -194,6 +194,15 @@ 9 + + 1 + 2 + 3 + 4 + 6 + 8 + + @string/phonies_ignore @string/phonies_warn diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 97cc32ea0..c4e33b3b7 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -881,7 +881,7 @@ ############################################################ --> - Board colors + Board colors etc. Edit colors used on the board Bonus square text - Board lines + Cell borders + Cell border width