trying to figure out why games list is occasionally redrawing itself

all the time: add logging that activated only when XWApp's DEBUG flag
is set, and turn that flag on.  The latter change should be reversed
before the next release.
This commit is contained in:
Eric House 2012-12-03 06:53:15 -08:00
parent a640f9d97b
commit ad606cdec0
3 changed files with 26 additions and 7 deletions

View file

@ -194,12 +194,20 @@ public class ExpiringDelegate {
if ( null == m_runnable ) {
m_runnable = new Runnable() {
public void run() {
if ( XWApp.DEBUG ) {
DbgUtils.logf( "ExpiringDelegate: timer fired"
+ " for %H", this );
}
if ( m_active ) {
figurePct();
if ( m_haveTurnLocal ) {
m_back = null;
setBackground();
}
if ( XWApp.DEBUG ) {
DbgUtils.logf( "ExpiringDelegate: invalidating"
+ " view %H", m_view );
}
m_view.invalidate();
}
}

View file

@ -1,7 +1,7 @@
/* -*- compile-command: "cd ../../../../../; ant debug install"; -*- */
/*
* Copyright 2009-2010 by Eric House (xwords@eehouse.org). All
* rights reserved.
* Copyright 2009-2012 by Eric House (xwords@eehouse.org). All rights
* reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@ -249,7 +249,9 @@ public class GameListAdapter extends XWListAdapter {
ViewInfo vi = new ViewInfo( layout, m_rowid, expanded,
summary.lastMoveTime, haveATurn,
haveALocalTurn );
if ( XWApp.DEBUG ) {
DbgUtils.logf( "created new view for rowid %d", m_rowid );
}
synchronized( m_viewsCache ) {
m_viewsCache.put( m_rowid, vi );
}
@ -329,7 +331,7 @@ public class GameListAdapter extends XWListAdapter {
}
}
public void setField( String field )
public void setField( String fieldName )
{
int[] ids = {
R.string.game_summary_field_empty
@ -339,12 +341,21 @@ public class GameListAdapter extends XWListAdapter {
};
int result = -1;
for ( int id : ids ) {
if ( m_context.getString( id ).equals( field ) ) {
if ( m_context.getString( id ).equals( fieldName ) ) {
result = id;
break;
}
}
if ( m_fieldID != result ) {
if ( -1 == result ) {
if ( XWApp.DEBUG ) {
DbgUtils.logf( "GameListAdapter.setField(): unable to match"
+ " fieldName %s", fieldName );
}
} else if ( m_fieldID != result ) {
if ( XWApp.DEBUG ) {
DbgUtils.logf( "setField: clearing views cache for change"
+ " from %d to %d", m_fieldID, result );
}
m_viewsCache.clear();
m_fieldID = result;
}

View file

@ -33,7 +33,7 @@ public class XWApp extends Application {
public static final boolean SMSSUPPORTED = true;
public static final boolean GCMSUPPORTED = true;
public static final boolean ATTACH_SUPPORTED = false;
public static final boolean DEBUG = false;
public static final boolean DEBUG = true; // DON'T SHIP THIS WAY
public static final String SMS_PUBLIC_HEADER = "-XW4";