From 8e9ca8603d3269d8c0cf720873ea6e6bac05282f Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 29 Sep 2014 20:12:56 -0700 Subject: [PATCH] don't recalc menu and title too early --- .../android/xw4/GamesListDelegate.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java index 59e221342..fe4687fec 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java @@ -1,6 +1,6 @@ /* -*- compile-command: "find-and-ant.sh debug install"; -*- */ /* - * Copyright 2009 - 2012 by Eric House (xwords@eehouse.org). All + * Copyright 2009 - 2014 by Eric House (xwords@eehouse.org). All * rights reserved. * * This program is free software; you can redistribute it and/or @@ -1690,22 +1690,25 @@ public class GamesListDelegate extends ListDelegateBase private void setSelGame( long rowid ) { - clearSelections(); + clearSelections( false ); m_selGames.add( rowid ); m_adapter.setSelected( rowid, true ); + + invalidateOptionsMenuIf(); + setTitleBar(); } private void clearSelections() { - boolean inval = false; - if ( clearSelectedGames() ) { - inval = true; - } - if ( clearSelectedGroups() ) { - inval = true; - } - if ( inval ) { + clearSelections( true ); + } + + private void clearSelections( boolean updateStuff ) + { + boolean inval = clearSelectedGames(); + inval = clearSelectedGroups() || inval; + if ( updateStuff && inval ) { invalidateOptionsMenuIf(); setTitleBar(); }