don't pop up dict picker menu in response to dict button if there's

only one for the game's language; open the browser instead.
This commit is contained in:
Eric House 2015-05-15 07:29:37 -07:00
parent fe472e0e9a
commit a4ce83f9cf

View file

@ -109,14 +109,15 @@ public class DictsActivity extends XWListActivity {
public static boolean handleDictsPopup( Context context, View button, public static boolean handleDictsPopup( Context context, View button,
String curDict, int lang ) String curDict, int lang )
{ {
if ( null == s_safePopup ) { int nDicts = DictLangCache.getLangCount( context, lang );
if ( null == s_safePopup && 1 < nDicts ) {
int sdkVersion = Integer.valueOf( android.os.Build.VERSION.SDK ); int sdkVersion = Integer.valueOf( android.os.Build.VERSION.SDK );
if ( 11 <= sdkVersion ) { if ( 11 <= sdkVersion ) {
s_safePopup = new SafePopupImpl(); s_safePopup = new SafePopupImpl();
} }
} }
boolean canHandle = null != s_safePopup; boolean canHandle = null != s_safePopup && 1 < nDicts;
if ( canHandle ) { if ( canHandle ) {
s_safePopup.doPopup( context, button, curDict, lang ); s_safePopup.doPopup( context, button, curDict, lang );
} }