mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
mark games with unread chat
This commit is contained in:
parent
2616891608
commit
2735144515
2 changed files with 29 additions and 11 deletions
|
@ -64,7 +64,8 @@ public class GameListItem extends LinearLayout
|
|||
private LinearLayout m_list;
|
||||
private TextView m_state;
|
||||
private TextView m_modTime;
|
||||
private ImageView m_marker;
|
||||
private ImageView m_gameTypeImage;
|
||||
private View m_hasChatMarker;
|
||||
private TextView m_role;
|
||||
|
||||
private boolean m_expanded, m_haveTurn, m_haveTurnLocal;
|
||||
|
@ -194,7 +195,8 @@ public class GameListItem extends LinearLayout
|
|||
m_list = (LinearLayout)findViewById( R.id.player_list );
|
||||
m_state = (TextView)findViewById( R.id.state );
|
||||
m_modTime = (TextView)findViewById( R.id.modtime );
|
||||
m_marker = (ImageView)findViewById( R.id.msg_marker );
|
||||
m_gameTypeImage = (ImageView)findViewById( R.id.game_type_marker );
|
||||
m_hasChatMarker = (View)findViewById( R.id.has_chat_marker );
|
||||
m_thumb = (ImageView)findViewById( R.id.thumbnail );
|
||||
m_role = (TextView)findViewById( R.id.role );
|
||||
}
|
||||
|
@ -316,14 +318,18 @@ public class GameListItem extends LinearLayout
|
|||
|
||||
int iconID = summary.isMultiGame() ?
|
||||
R.drawable.multigame__gen : R.drawable.sologame__gen;
|
||||
m_marker.setImageResource( iconID );
|
||||
m_marker.setOnClickListener( new View.OnClickListener() {
|
||||
m_gameTypeImage.setImageResource( iconID );
|
||||
m_gameTypeImage.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View view ) {
|
||||
toggleSelected();
|
||||
}
|
||||
} );
|
||||
|
||||
int flags = DBUtils.getMsgFlags( m_context, m_rowid );
|
||||
boolean hasChat = 0 != (flags & GameSummary.MSG_FLAGS_CHAT);
|
||||
m_hasChatMarker.setVisibility( hasChat ? View.VISIBLE : View.GONE );
|
||||
|
||||
String roleSummary = summary.summarizeRole( m_context, m_rowid );
|
||||
m_role.setVisibility( null == roleSummary ? View.GONE : View.VISIBLE );
|
||||
if ( null != roleSummary ) {
|
||||
|
|
|
@ -31,13 +31,25 @@
|
|||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<ImageView android:id="@+id/msg_marker"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip"
|
||||
/>
|
||||
<RelativeLayout android:id="@+id/game_view_container"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip"
|
||||
>
|
||||
<ImageView android:id="@+id/game_type_marker"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:src="@drawable/multigame__gen"
|
||||
/>
|
||||
<ImageView android:id="@+id/has_chat_marker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/stat_notify_chat"
|
||||
android:layout_alignParentBottom="true"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView android:id="@+id/thumbnail"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
Loading…
Reference in a new issue