mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
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:
parent
3530e51102
commit
75e54fa727
2 changed files with 15 additions and 2 deletions
|
@ -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 )
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue