mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
show alert icon in place of chat when quarantined
It'll be helpful (non-release only) to see an alert icon for all games that can't be opened.
This commit is contained in:
parent
fe2d8712d4
commit
996e0d62c7
1 changed files with 14 additions and 5 deletions
|
@ -327,13 +327,22 @@ public class GameListItem extends LinearLayout
|
|||
R.drawable.ic_multigame : R.drawable.ic_sologame;
|
||||
m_gameTypeImage.setImageResource( iconID );
|
||||
|
||||
boolean hasChat = summary.isMultiGame();
|
||||
if ( hasChat ) {
|
||||
// Let's use the chat-icon space for an ALERT icon when we're
|
||||
// quarantined. Not ready for non-debug use though, as it shows up
|
||||
// temporarily after every game closes because an *already-open*
|
||||
// game always tests as not safe-to-open.
|
||||
boolean doShow = false;
|
||||
boolean quarantined = (BuildConfig.DEBUG || !BuildConfig.IS_TAGGED_BUILD)
|
||||
&& !Quarantine.safeToOpen( m_rowid );
|
||||
ImageView iv = (ImageView)findViewById( R.id.has_chat_marker );
|
||||
if ( quarantined ) {
|
||||
iv.setImageResource( android.R.drawable.stat_sys_warning );
|
||||
doShow = true;
|
||||
} else if ( summary.isMultiGame() ) {
|
||||
int flags = DBUtils.getMsgFlags( m_context, m_rowid );
|
||||
hasChat = 0 != (flags & GameSummary.MSG_FLAGS_CHAT);
|
||||
doShow = 0 != (flags & GameSummary.MSG_FLAGS_CHAT);
|
||||
}
|
||||
findViewById( R.id.has_chat_marker )
|
||||
.setVisibility( hasChat ? View.VISIBLE : View.GONE );
|
||||
iv.setVisibility( doShow ? View.VISIBLE : View.GONE );
|
||||
|
||||
if ( XWPrefs.moveCountEnabled( m_context ) ) {
|
||||
TextView tv = (TextView)findViewById( R.id.n_pending );
|
||||
|
|
Loading…
Add table
Reference in a new issue