make cell line width settable

This commit is contained in:
Eric House 2021-07-16 12:21:49 -07:00
parent e19f1042cb
commit b49792c750
4 changed files with 28 additions and 11 deletions

View file

@ -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);
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 )

View file

@ -35,7 +35,7 @@
<string name="key_cellline">key_cellline</string>
<string name="key_clr_crosshairs">key_clr_crosshairs</string>
<string name="key_clr_bonushint">key_clr_bonushint</string>
<string name="key_board_line_pct">key_board_line_pct</string>
<string name="key_board_line_width">key_board_line_width</string>
<string name="key_relay_host">key_relay_host</string>
<string name="key_relay_port">key_relay_port2</string>
@ -194,6 +194,15 @@
<item>9</item>
</string-array>
<string-array name="cellline_widths">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>6</item>
<item>8</item>
</string-array>
<string-array name="phony_names">
<item>@string/phonies_ignore</item>
<item>@string/phonies_warn</item>

View file

@ -881,7 +881,7 @@
############################################################
-->
<!-- title of this sub-preference -->
<string name="prefs_colors">Board colors</string>
<string name="prefs_colors">Board colors etc.</string>
<!-- clarification of the above -->
<string name="prefs_colors_summary">Edit colors used on the board</string>
<!-- The remaining strings (down to the color edit dialog below)
@ -913,7 +913,8 @@
board -->
<string name="key_bonushint">Bonus square text</string>
<!-- The color of the lines delimiting cells on the board -->
<string name="cellline">Board lines</string>
<string name="cellline">Cell borders</string>
<string name="cellline_width">Cell border width</string>
<!--
############################################################
# :Dialogs:

View file

@ -81,5 +81,14 @@
android:title="@string/cellline"
android:defaultValue="0x101010"
/>
<org.eehouse.android.xw4.XWListPreference
android:key="@string/key_board_line_width"
android:title="@string/cellline_width"
android:entries="@array/cellline_widths"
android:entryValues="@array/cellline_widths"
android:defaultValue="2"
/>
</PreferenceCategory>
</PreferenceScreen>