derive GameListGroup from ExpiringLinearLayout

This commit is contained in:
Eric House 2014-03-31 07:14:40 -07:00
parent d896670c21
commit 3ff60861f7
4 changed files with 20 additions and 24 deletions

View file

@ -8,18 +8,17 @@
android:background="#FF7F7F7F"
>
<org.eehouse.android.xw4.ExpiringTextView
android:id="@+id/game_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:textStyle="italic"
android:layout_weight="1"
/>
<TextView android:id="@+id/game_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:textStyle="italic"
android:layout_weight="1"
/>
<ImageButton android:id="@+id/expander"
android:layout_width="32dp"

View file

@ -49,6 +49,8 @@ public class ExpiringLinearLayout extends LinearLayout {
protected void onDraw( Canvas canvas )
{
super.onDraw( canvas );
m_delegate.onDraw( canvas );
if ( null != m_delegate ) {
m_delegate.onDraw( canvas );
}
}
}

View file

@ -564,7 +564,7 @@ public class GameListAdapter extends XWListAdapter
GameListGroup group = getGroupItemFor( groupPosition );
if ( null != group ) {
GameGroupInfo ggi = getInfoForGroup( groupPosition );
group.setPct( ggi.m_hasTurn, ggi.m_turnLocal, ggi.m_lastMoveTime );
group.setPct( m_handler, ggi.m_hasTurn, ggi.m_turnLocal, ggi.m_lastMoveTime );
}
}

View file

@ -24,12 +24,13 @@ import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import org.eehouse.android.xw4.DBUtils.GameGroupInfo;
public class GameListGroup extends LinearLayout
public class GameListGroup extends ExpiringLinearLayout
implements SelectableItem.LongClickHandler,
View.OnClickListener,
View.OnLongClickListener
@ -44,7 +45,7 @@ public class GameListGroup extends LinearLayout
private boolean m_expanded;
private SelectableItem m_cb;
private GroupStateListener m_gcb;
private ExpiringTextView m_etv;
private TextView m_etv;
private boolean m_selected;
private int m_nGames;
private DrawSelDelegate m_dsdel;
@ -81,7 +82,7 @@ public class GameListGroup extends LinearLayout
protected void onFinishInflate()
{
super.onFinishInflate();
m_etv = (ExpiringTextView)findViewById( R.id.game_name );
m_etv = (TextView)findViewById( R.id.game_name );
m_expandButton = (ImageButton)findViewById( R.id.expander );
// click on me OR the button expands/contracts...
@ -122,12 +123,6 @@ public class GameListGroup extends LinearLayout
m_etv.setText( text );
}
protected void setPct( boolean haveTurn, boolean haveTurnLocal,
long startSecs )
{
m_etv.setPct( haveTurn, haveTurnLocal, startSecs );
}
// GameListAdapter.ClickHandler interface
public void longClicked()
{