mark games with unread chat

This commit is contained in:
Eric House 2017-09-02 11:34:30 -07:00
parent 2616891608
commit 2735144515
2 changed files with 29 additions and 11 deletions

View file

@ -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 ) {

View file

@ -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"