don't reuse game list group if it's had its background changed since

that can't be undone (yet)
This commit is contained in:
Eric House 2014-07-12 11:04:41 -07:00
parent 3530e51102
commit 75e54fa727
2 changed files with 15 additions and 2 deletions

View file

@ -44,6 +44,11 @@ public class ExpiringLinearLayout extends LinearLayout {
m_delegate.configure( haveTurn, haveTurnLocal, startSecs );
}
public boolean hasDelegate()
{
return null != m_delegate;
}
@Override
// not called unless setWillNotDraw( false ) called
protected void onDraw( Canvas canvas )

View file

@ -55,10 +55,18 @@ public class GameListGroup extends ExpiringLinearLayout
SelectableItem cb,
GroupStateListener gcb )
{
GameListGroup result;
GameListGroup result = null;
if ( null != convertView && convertView instanceof GameListGroup ) {
result = (GameListGroup)convertView;
} else {
// Hack: once an ExpiringLinearLayout has a background it's not
// set up to be reused without one. Until that's fixed, don't
// reuse in that case.
if ( result.hasDelegate() ) {
result = null;
}
}
if ( null == result ) {
result = (GameListGroup)
LocUtils.inflate( context, R.layout.game_list_group );
}