merge fix_android_beta_86 -> android_branch

This commit is contained in:
Eric House 2014-07-30 07:24:47 -07:00
commit bbc3d0e8e3
6 changed files with 83 additions and 66 deletions

View file

@ -22,7 +22,7 @@
to come from a domain that you own or have control over. --> to come from a domain that you own or have control over. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.eehouse.android.xw4" package="org.eehouse.android.xw4"
android:versionCode="79" android:versionCode="80"
android:versionName="@string/app_version" android:versionName="@string/app_version"
> >

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/board_root"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"

View file

@ -5,12 +5,14 @@
</style> </style>
</head> </head>
<body> <body>
<b>Crosswords 4.4 beta 86 release</b> <b>Crosswords 4.4 beta 87 release</b>
<h3>New with this (and prev.) release</h3> <h3>New with this (and prev.) releases</h3>
<ul> <ul>
<li>Don't prevent board displaying in the landscape orientation on <li>Don't prevent board displaying in the landscape orientation on
large and x-large devices (tablets)</li> large and x-large devices (tablets)</li>
<li>Fix changes for above to not crash on small-screened phones
(thanks Anonymous)</li>
<li>Fix changes for above so Nexus 10 and other x-large devices <li>Fix changes for above so Nexus 10 and other x-large devices
still use the full screen in the portrait orientation (thanks DS)</li> still use the full screen in the portrait orientation (thanks DS)</li>
<li>Fix reported crash in new toolbar code (thanks Anonymous)</li> <li>Fix reported crash in new toolbar code (thanks Anonymous)</li>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_version">4.4 beta 86</string> <string name="app_version">4.4 beta 87</string>
</resources> </resources>

View file

@ -519,10 +519,14 @@ public class BoardDelegate extends DelegateBase
m_view = (BoardView)findViewById( R.id.board_view ); m_view = (BoardView)findViewById( R.id.board_view );
if ( ! ABUtils.haveActionBar() ) { if ( ! ABUtils.haveActionBar() ) {
m_tradeButtons = findViewById( R.id.exchange_buttons ); m_tradeButtons = findViewById( R.id.exchange_buttons );
m_exchCommmitButton = (Button)findViewById( R.id.exchange_commit ); if ( null != m_tradeButtons ) {
m_exchCommmitButton.setOnClickListener( this ); m_exchCommmitButton = (Button)
m_exchCancelButton = (Button)findViewById( R.id.exchange_cancel ); findViewById( R.id.exchange_commit );
m_exchCancelButton.setOnClickListener( this ); m_exchCommmitButton.setOnClickListener( this );
m_exchCancelButton = (Button)
findViewById( R.id.exchange_cancel );
m_exchCancelButton.setOnClickListener( this );
}
} }
m_volKeysZoom = XWPrefs.getVolKeysZoom( m_activity ); m_volKeysZoom = XWPrefs.getVolKeysZoom( m_activity );
@ -1855,9 +1859,11 @@ public class BoardDelegate extends DelegateBase
setTitle( GameUtils.getName( m_activity, m_rowid ) ); setTitle( GameUtils.getName( m_activity, m_rowid ) );
} }
int orient = m_activity.getResources().getConfiguration().orientation; if ( null != findViewById( R.id.tbar_parent_hor ) ) {
boolean isLandscape = Configuration.ORIENTATION_LANDSCAPE == orient; int orient = m_activity.getResources().getConfiguration().orientation;
m_toolbar = new Toolbar( m_activity, this, isLandscape ); boolean isLandscape = Configuration.ORIENTATION_LANDSCAPE == orient;
m_toolbar = new Toolbar( m_activity, this, isLandscape );
}
populateToolbar(); populateToolbar();
adjustTradeVisibility(); adjustTradeVisibility();
@ -1907,47 +1913,49 @@ public class BoardDelegate extends DelegateBase
private void populateToolbar() private void populateToolbar()
{ {
m_toolbar.setListener( Toolbar.BUTTON_BROWSE_DICT, if ( null != m_toolbar ) {
R.string.not_again_browseall, m_toolbar.setListener( Toolbar.BUTTON_BROWSE_DICT,
R.string.key_na_browseall, R.string.not_again_browseall,
Action.BUTTON_BROWSEALL_ACTION ); R.string.key_na_browseall,
m_toolbar.setLongClickListener( Toolbar.BUTTON_BROWSE_DICT, Action.BUTTON_BROWSEALL_ACTION );
R.string.not_again_browse, m_toolbar.setLongClickListener( Toolbar.BUTTON_BROWSE_DICT,
R.string.key_na_browse, R.string.not_again_browse,
Action.BUTTON_BROWSE_ACTION ); R.string.key_na_browse,
m_toolbar.setListener( Toolbar.BUTTON_HINT_PREV, Action.BUTTON_BROWSE_ACTION );
R.string.not_again_hintprev, m_toolbar.setListener( Toolbar.BUTTON_HINT_PREV,
R.string.key_notagain_hintprev, R.string.not_again_hintprev,
Action.PREV_HINT_ACTION ); R.string.key_notagain_hintprev,
m_toolbar.setListener( Toolbar.BUTTON_HINT_NEXT, Action.PREV_HINT_ACTION );
R.string.not_again_hintnext, m_toolbar.setListener( Toolbar.BUTTON_HINT_NEXT,
R.string.key_notagain_hintnext, R.string.not_again_hintnext,
Action.NEXT_HINT_ACTION ); R.string.key_notagain_hintnext,
m_toolbar.setListener( Toolbar.BUTTON_JUGGLE, Action.NEXT_HINT_ACTION );
R.string.not_again_juggle, m_toolbar.setListener( Toolbar.BUTTON_JUGGLE,
R.string.key_notagain_juggle, R.string.not_again_juggle,
Action.JUGGLE_ACTION ); R.string.key_notagain_juggle,
m_toolbar.setListener( Toolbar.BUTTON_FLIP, Action.JUGGLE_ACTION );
R.string.not_again_flip, m_toolbar.setListener( Toolbar.BUTTON_FLIP,
R.string.key_notagain_flip, R.string.not_again_flip,
Action.FLIP_ACTION ); R.string.key_notagain_flip,
m_toolbar.setListener( Toolbar.BUTTON_ZOOM, Action.FLIP_ACTION );
R.string.not_again_zoom, m_toolbar.setListener( Toolbar.BUTTON_ZOOM,
R.string.key_notagain_zoom, R.string.not_again_zoom,
Action.ZOOM_ACTION ); R.string.key_notagain_zoom,
m_toolbar.setListener( Toolbar.BUTTON_VALUES, Action.ZOOM_ACTION );
R.string.not_again_values, m_toolbar.setListener( Toolbar.BUTTON_VALUES,
R.string.key_na_values, R.string.not_again_values,
Action.VALUES_ACTION ); R.string.key_na_values,
m_toolbar.setListener( Toolbar.BUTTON_UNDO, Action.VALUES_ACTION );
R.string.not_again_undo, m_toolbar.setListener( Toolbar.BUTTON_UNDO,
R.string.key_notagain_undo, R.string.not_again_undo,
Action.UNDO_ACTION ); R.string.key_notagain_undo,
if ( BuildConstants.CHAT_SUPPORTED ) { Action.UNDO_ACTION );
m_toolbar.setListener( Toolbar.BUTTON_CHAT, if ( BuildConstants.CHAT_SUPPORTED ) {
R.string.not_again_chat, m_toolbar.setListener( Toolbar.BUTTON_CHAT,
R.string.key_notagain_chat, R.string.not_again_chat,
Action.CHAT_ACTION ); R.string.key_notagain_chat,
Action.CHAT_ACTION );
}
} }
} // populateToolbar } // populateToolbar
@ -2134,21 +2142,25 @@ public class BoardDelegate extends DelegateBase
private void updateToolbar() private void updateToolbar()
{ {
m_toolbar.update( Toolbar.BUTTON_FLIP, m_gsi.visTileCount >= 1 ); if ( null != m_toolbar ) {
m_toolbar.update( Toolbar.BUTTON_VALUES, m_gsi.visTileCount >= 1 ); m_toolbar.update( Toolbar.BUTTON_FLIP, m_gsi.visTileCount >= 1 );
m_toolbar.update( Toolbar.BUTTON_JUGGLE, m_gsi.canShuffle ); m_toolbar.update( Toolbar.BUTTON_VALUES, m_gsi.visTileCount >= 1 );
m_toolbar.update( Toolbar.BUTTON_UNDO, m_gsi.canRedo ); m_toolbar.update( Toolbar.BUTTON_JUGGLE, m_gsi.canShuffle );
m_toolbar.update( Toolbar.BUTTON_HINT_PREV, m_gsi.canHint ); m_toolbar.update( Toolbar.BUTTON_UNDO, m_gsi.canRedo );
m_toolbar.update( Toolbar.BUTTON_HINT_NEXT, m_gsi.canHint ); m_toolbar.update( Toolbar.BUTTON_HINT_PREV, m_gsi.canHint );
m_toolbar.update( Toolbar.BUTTON_CHAT, m_toolbar.update( Toolbar.BUTTON_HINT_NEXT, m_gsi.canHint );
BuildConstants.CHAT_SUPPORTED && m_gsi.canChat ); m_toolbar.update( Toolbar.BUTTON_CHAT,
m_toolbar.update( Toolbar.BUTTON_BROWSE_DICT, BuildConstants.CHAT_SUPPORTED && m_gsi.canChat );
null != m_gi.dictName( m_view.getCurPlayer() ) ); m_toolbar.update( Toolbar.BUTTON_BROWSE_DICT,
null != m_gi.dictName( m_view.getCurPlayer() ) );
}
} }
private void adjustTradeVisibility() private void adjustTradeVisibility()
{ {
m_toolbar.setVisible( !m_inTrade ); if ( null != m_toolbar ) {
m_toolbar.setVisible( !m_inTrade );
}
if ( null != m_tradeButtons ) { if ( null != m_tradeButtons ) {
m_tradeButtons.setVisibility( m_inTrade? View.VISIBLE : View.GONE ); m_tradeButtons.setVisibility( m_inTrade? View.VISIBLE : View.GONE );
} }

View file

@ -160,9 +160,11 @@ public class Toolbar {
int id = isLandscape ? R.id.tbar_parent_vert : R.id.tbar_parent_hor; int id = isLandscape ? R.id.tbar_parent_vert : R.id.tbar_parent_hor;
ViewGroup scroller = (ViewGroup)m_activity.findViewById( id ); ViewGroup scroller = (ViewGroup)m_activity.findViewById( id );
// Google's had reports of a crash adding second view if ( null != scroller ) {
scroller.removeAllViews(); // Google's had reports of a crash adding second view
scroller.addView( m_layout ); // failing scroller.removeAllViews();
scroller.addView( m_layout ); // failing
}
} }
m_layout.setVisibility( m_visible? View.VISIBLE : View.GONE ); m_layout.setVisibility( m_visible? View.VISIBLE : View.GONE );