mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
add board layout for small case that doesn't include toolbar or
exchange-state buttons, and check for presence of Views that may now be missing. With this checkin small screen devices don't have access to toolbar functionality -- new and expanded menu will be required for them.
This commit is contained in:
parent
1e9928e7f3
commit
b78ea03ea6
3 changed files with 39 additions and 7 deletions
20
xwords4/android/XWords4/res/layout-small/board.xml
Normal file
20
xwords4/android/XWords4/res/layout-small/board.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
>
|
||||
<org.eehouse.android.xw4.BoardView
|
||||
android:id="@+id/board_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:longClickable="true"
|
||||
android:drawSelectorOnTop="false"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
|
@ -457,9 +457,13 @@ public class BoardActivity extends XWActivity
|
|||
m_view = (BoardView)findViewById( R.id.board_view );
|
||||
m_tradeButtons = findViewById( R.id.exchange_buttons );
|
||||
m_exchCommmitButton = (Button)findViewById( R.id.exchange_commit );
|
||||
m_exchCommmitButton.setOnClickListener( this );
|
||||
if ( null != m_exchCommmitButton ) {
|
||||
m_exchCommmitButton.setOnClickListener( this );
|
||||
}
|
||||
m_exchCancelButton = (Button)findViewById( R.id.exchange_cancel );
|
||||
m_exchCancelButton.setOnClickListener( this );
|
||||
if ( null != m_exchCancelButton ) {
|
||||
m_exchCancelButton.setOnClickListener( this );
|
||||
}
|
||||
m_volKeysZoom = CommonPrefs.getVolKeysZoom( this );
|
||||
|
||||
Intent intent = getIntent();
|
||||
|
@ -1815,8 +1819,10 @@ public class BoardActivity extends XWActivity
|
|||
private void adjustTradeVisibility()
|
||||
{
|
||||
m_toolbar.setVisibility( m_inTrade? View.GONE : View.VISIBLE );
|
||||
m_tradeButtons.setVisibility( m_inTrade? View.VISIBLE : View.GONE );
|
||||
if ( m_inTrade ) {
|
||||
if ( null != m_tradeButtons ) {
|
||||
m_tradeButtons.setVisibility( m_inTrade? View.VISIBLE : View.GONE );
|
||||
}
|
||||
if ( m_inTrade && null != m_exchCommmitButton ) {
|
||||
m_exchCommmitButton.setEnabled( m_gsi.tradeTilesSelected );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,14 +87,18 @@ public class Toolbar {
|
|||
|
||||
public void setVisibility( int vis )
|
||||
{
|
||||
m_me.setVisibility( vis );
|
||||
if ( null != m_me ) {
|
||||
m_me.setVisibility( vis );
|
||||
}
|
||||
}
|
||||
|
||||
public void setListener( int index, View.OnClickListener listener )
|
||||
{
|
||||
TBButtonInfo info = s_buttonInfo[index];
|
||||
ImageButton button = (ImageButton)m_activity.findViewById( info.m_id );
|
||||
button.setOnClickListener( listener );
|
||||
if ( null != button ) {
|
||||
button.setOnClickListener( listener );
|
||||
}
|
||||
}
|
||||
|
||||
public void setListener( int index, final int msgID, final int prefsKey,
|
||||
|
@ -114,7 +118,9 @@ public class Toolbar {
|
|||
int vis = enable ? View.VISIBLE : View.GONE;
|
||||
|
||||
ImageButton button = (ImageButton)m_activity.findViewById( info.m_id );
|
||||
button.setVisibility( vis );
|
||||
if ( null != button ) {
|
||||
button.setVisibility( vis );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue