mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
Merge branch 'android_smallscreen' into android_branch
Conflicts: xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java
This commit is contained in:
commit
2b9fb13dbd
4 changed files with 22 additions and 8 deletions
|
@ -22,7 +22,7 @@
|
|||
to come from a domain that you own or have control over. -->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.eehouse.android.xw4"
|
||||
android:versionCode="37"
|
||||
android:versionCode="38"
|
||||
android:versionName="@string/app_version"
|
||||
>
|
||||
|
||||
|
|
|
@ -5,12 +5,10 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<b>Crosswords 4.4 beta 45 release</b>
|
||||
<b>Crosswords 4.4 beta 46 release</b>
|
||||
<ul>
|
||||
|
||||
<li>Turn on undo for multi-device games</li>
|
||||
|
||||
<li>UI tweaks, e.g. frame in green the remote player whose turn it is</li>
|
||||
<li>Improve board layout for small-screen phones, e.g. Samsung Galaxy Y</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!-- Resources in this file do not require localization -->
|
||||
<resources>
|
||||
|
||||
<string name="app_version">4.4 beta 45</string>
|
||||
<string name="app_version">4.4 beta 46</string>
|
||||
|
||||
<!-- prefs keys -->
|
||||
<string name="key_color_tiles">key_color_tiles</string>
|
||||
|
|
|
@ -55,6 +55,8 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
private static Bitmap s_bitmap; // the board
|
||||
private static final int IN_TRADE_ALPHA = 0x3FFFFFFF;
|
||||
private static final int PINCH_THRESHOLD = 40;
|
||||
private static final int SCORE_HT_DROP = 2;
|
||||
private static final boolean DEBUG_DRAWFRAMES = false;
|
||||
|
||||
private Context m_context;
|
||||
private Paint m_drawPaint;
|
||||
|
@ -476,7 +478,15 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
scoreInfo[indx] = sb.toString();
|
||||
m_scores[dsi.playerNum] = scoreInfo;
|
||||
|
||||
m_fillPaint.setTextSize( dsi.isTurn? rect.height() : m_defaultFontHt );
|
||||
int rectHt = rect.height();
|
||||
if ( !dsi.isTurn ) {
|
||||
rectHt /= 2;
|
||||
}
|
||||
int textHeight = rectHt - SCORE_HT_DROP;
|
||||
if ( textHeight < m_defaultFontHt ) {
|
||||
textHeight = m_defaultFontHt;
|
||||
}
|
||||
m_fillPaint.setTextSize( textHeight );
|
||||
|
||||
int needWidth = 0;
|
||||
for ( int ii = 0; ii < scoreInfo.length; ++ii ) {
|
||||
|
@ -499,6 +509,8 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
{
|
||||
if ( 0 != (dsi.flags & CELL_ISCURSOR) ) {
|
||||
fillRectOther( rOuter, CommonPrefs.COLOR_FOCUS );
|
||||
} else if ( DEBUG_DRAWFRAMES && dsi.selected ) {
|
||||
fillRectOther( rOuter, CommonPrefs.COLOR_FOCUS );
|
||||
}
|
||||
String[] texts = m_scores[dsi.playerNum];
|
||||
int color = m_playerColors[dsi.playerNum];
|
||||
|
@ -513,6 +525,10 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
drawCentered( text, rOuter, null );
|
||||
rOuter.offset( 0, height );
|
||||
}
|
||||
if ( DEBUG_DRAWFRAMES ) {
|
||||
m_strokePaint.setColor( BLACK );
|
||||
m_canvas.drawRect( rInner, m_strokePaint );
|
||||
}
|
||||
}
|
||||
|
||||
public void drawTimer( Rect rect, int player, int secondsLeft )
|
||||
|
@ -783,7 +799,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
int descent = -1;
|
||||
int textSize;
|
||||
if ( null == fontDims ) {
|
||||
textSize = rect.height() - 2;
|
||||
textSize = rect.height() - SCORE_HT_DROP;
|
||||
} else {
|
||||
int height = rect.height() - 4; // borders and padding, 2 each
|
||||
descent = fontDims.descentFor( height );
|
||||
|
|
Loading…
Add table
Reference in a new issue