mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
don't make snapshots for non-expanded game list items; make when first
expanded instead.
This commit is contained in:
parent
2e5e10ef6d
commit
24e015f259
1 changed files with 17 additions and 10 deletions
|
@ -169,6 +169,9 @@ public class GameListItem extends LinearLayout
|
||||||
public void onClick( View view ) {
|
public void onClick( View view ) {
|
||||||
m_expanded = !m_expanded;
|
m_expanded = !m_expanded;
|
||||||
DBUtils.setExpanded( m_rowid, m_expanded );
|
DBUtils.setExpanded( m_rowid, m_expanded );
|
||||||
|
|
||||||
|
makeThumbnailIf( m_expanded );
|
||||||
|
|
||||||
showHide();
|
showHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +246,7 @@ public class GameListItem extends LinearLayout
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setData( GameSummary summary )
|
private void setData( GameSummary summary, boolean expanded )
|
||||||
{
|
{
|
||||||
if ( null != summary ) {
|
if ( null != summary ) {
|
||||||
TextView tview;
|
TextView tview;
|
||||||
|
@ -318,8 +321,6 @@ public class GameListItem extends LinearLayout
|
||||||
tview.setVisibility( View.GONE );
|
tview.setVisibility( View.GONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean expanded = DBUtils.getExpanded( m_context, m_rowid );
|
|
||||||
|
|
||||||
update( expanded, summary.lastMoveTime, haveATurn,
|
update( expanded, summary.lastMoveTime, haveATurn,
|
||||||
haveALocalTurn );
|
haveALocalTurn );
|
||||||
}
|
}
|
||||||
|
@ -337,6 +338,16 @@ public class GameListItem extends LinearLayout
|
||||||
m_cb.itemToggled( this, m_selected );
|
m_cb.itemToggled( this, m_selected );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void makeThumbnailIf( boolean expanded )
|
||||||
|
{
|
||||||
|
if ( expanded && null != m_activity && null != m_summary
|
||||||
|
&& null == m_summary.getThumbnail()
|
||||||
|
&& XWPrefs.getThumbEnabled( m_context ) ) {
|
||||||
|
m_summary.setThumbnail( GameUtils.loadMakeBitmap( m_activity,
|
||||||
|
m_rowid ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class LoadItemTask extends AsyncTask<Void, Void, GameSummary> {
|
private class LoadItemTask extends AsyncTask<Void, Void, GameSummary> {
|
||||||
@Override
|
@Override
|
||||||
protected GameSummary doInBackground( Void... unused )
|
protected GameSummary doInBackground( Void... unused )
|
||||||
|
@ -349,15 +360,11 @@ public class GameListItem extends LinearLayout
|
||||||
{
|
{
|
||||||
if ( 0 == --m_loadingCount ) {
|
if ( 0 == --m_loadingCount ) {
|
||||||
m_summary = summary;
|
m_summary = summary;
|
||||||
|
boolean expanded = DBUtils.getExpanded( m_context, m_rowid );
|
||||||
|
|
||||||
if ( null != m_activity && null != summary
|
makeThumbnailIf( expanded );
|
||||||
&& null == summary.getThumbnail()
|
|
||||||
&& XWPrefs.getThumbEnabled( m_context ) ) {
|
|
||||||
summary.setThumbnail( GameUtils.loadMakeBitmap( m_activity,
|
|
||||||
m_rowid ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
setData( summary );
|
setData( summary, expanded );
|
||||||
setLoaded( null != m_summary );
|
setLoaded( null != m_summary );
|
||||||
synchronized( s_invalRows ) {
|
synchronized( s_invalRows ) {
|
||||||
s_invalRows.remove( m_rowid );
|
s_invalRows.remove( m_rowid );
|
||||||
|
|
Loading…
Reference in a new issue