mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-01 19:57:11 +01:00
cleanup and rename variable
This commit is contained in:
parent
0431f1a7ea
commit
253073efc5
1 changed files with 12 additions and 14 deletions
|
@ -24,7 +24,6 @@ import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
// import android.text.TextUtils;
|
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
@ -34,7 +33,6 @@ import android.widget.TextView;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
// import java.util.Iterator;
|
|
||||||
|
|
||||||
import org.eehouse.android.xw4.jni.GameSummary;
|
import org.eehouse.android.xw4.jni.GameSummary;
|
||||||
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType;
|
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType;
|
||||||
|
@ -205,7 +203,7 @@ public class GameListItem extends LinearLayout
|
||||||
private void setData( final GameSummary summary )
|
private void setData( final GameSummary summary )
|
||||||
{
|
{
|
||||||
if ( null != summary ) {
|
if ( null != summary ) {
|
||||||
TextView view;
|
TextView tview;
|
||||||
String state = setName();
|
String state = setName();
|
||||||
|
|
||||||
setOnClickListener( new View.OnClickListener() {
|
setOnClickListener( new View.OnClickListener() {
|
||||||
|
@ -224,10 +222,10 @@ public class GameListItem extends LinearLayout
|
||||||
for ( int ii = 0; ii < summary.nPlayers; ++ii ) {
|
for ( int ii = 0; ii < summary.nPlayers; ++ii ) {
|
||||||
ExpiringLinearLayout tmp = (ExpiringLinearLayout)
|
ExpiringLinearLayout tmp = (ExpiringLinearLayout)
|
||||||
Utils.inflate( m_context, R.layout.player_list_elem );
|
Utils.inflate( m_context, R.layout.player_list_elem );
|
||||||
view = (TextView)tmp.findViewById( R.id.item_name );
|
tview = (TextView)tmp.findViewById( R.id.item_name );
|
||||||
view.setText( summary.summarizePlayer( ii ) );
|
tview.setText( summary.summarizePlayer( ii ) );
|
||||||
view = (TextView)tmp.findViewById( R.id.item_score );
|
tview = (TextView)tmp.findViewById( R.id.item_score );
|
||||||
view.setText( String.format( " %d", summary.scores[ii] ) );
|
tview.setText( String.format( " %d", summary.scores[ii] ) );
|
||||||
boolean thisHasTurn = summary.isNextToPlay( ii, isLocal );
|
boolean thisHasTurn = summary.isNextToPlay( ii, isLocal );
|
||||||
if ( thisHasTurn ) {
|
if ( thisHasTurn ) {
|
||||||
haveATurn = true;
|
haveATurn = true;
|
||||||
|
@ -240,15 +238,15 @@ public class GameListItem extends LinearLayout
|
||||||
list.addView( tmp, ii );
|
list.addView( tmp, ii );
|
||||||
}
|
}
|
||||||
|
|
||||||
view = (TextView)findViewById( R.id.state );
|
tview = (TextView)findViewById( R.id.state );
|
||||||
view.setText( state );
|
tview.setText( state );
|
||||||
view = (TextView)findViewById( R.id.modtime );
|
tview = (TextView)findViewById( R.id.modtime );
|
||||||
long lastMoveTime = summary.lastMoveTime;
|
long lastMoveTime = summary.lastMoveTime;
|
||||||
lastMoveTime *= 1000;
|
lastMoveTime *= 1000;
|
||||||
|
|
||||||
DateFormat df = DateFormat.getDateTimeInstance( DateFormat.SHORT,
|
DateFormat df = DateFormat.getDateTimeInstance( DateFormat.SHORT,
|
||||||
DateFormat.SHORT );
|
DateFormat.SHORT );
|
||||||
view.setText( df.format( new Date( lastMoveTime ) ) );
|
tview.setText( df.format( new Date( lastMoveTime ) ) );
|
||||||
|
|
||||||
int iconID;
|
int iconID;
|
||||||
ImageView marker =
|
ImageView marker =
|
||||||
|
@ -265,12 +263,12 @@ public class GameListItem extends LinearLayout
|
||||||
}
|
}
|
||||||
marker.setImageResource( iconID );
|
marker.setImageResource( iconID );
|
||||||
|
|
||||||
view = (TextView)findViewById( R.id.role );
|
tview = (TextView)findViewById( R.id.role );
|
||||||
String roleSummary = summary.summarizeRole();
|
String roleSummary = summary.summarizeRole();
|
||||||
if ( null != roleSummary ) {
|
if ( null != roleSummary ) {
|
||||||
view.setText( roleSummary );
|
tview.setText( roleSummary );
|
||||||
} else {
|
} else {
|
||||||
view.setVisibility( View.GONE );
|
tview.setVisibility( View.GONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean expanded = DBUtils.getExpanded( m_context, m_rowid );
|
boolean expanded = DBUtils.getExpanded( m_context, m_rowid );
|
||||||
|
|
Loading…
Add table
Reference in a new issue