mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
play notification sound when a move or chat is added to the board or
chat view. Still TODO: post a notification when that view isn't visible.
This commit is contained in:
parent
994672667c
commit
e239430260
3 changed files with 9 additions and 0 deletions
|
@ -1936,6 +1936,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
{
|
{
|
||||||
m_words = null == words? null : wordsToArray( words );
|
m_words = null == words? null : wordsToArray( words );
|
||||||
nonBlockingDialog( DlgID.DLG_SCORES, expl );
|
nonBlockingDialog( DlgID.DLG_SCORES, expl );
|
||||||
|
Utils.playNotificationSound( m_activity );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -234,6 +234,7 @@ public class ChatDelegate extends DelegateBase {
|
||||||
&& s_visibleThis.m_rowid == rowid;
|
&& s_visibleThis.m_rowid == rowid;
|
||||||
if ( handled ) {
|
if ( handled ) {
|
||||||
s_visibleThis.addRow( msg, fromIndx );
|
s_visibleThis.addRow( msg, fromIndx );
|
||||||
|
Utils.playNotificationSound( s_visibleThis.m_activity );
|
||||||
}
|
}
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,6 +239,13 @@ public class Utils {
|
||||||
nm.cancel( id );
|
nm.cancel( id );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void playNotificationSound( Context context )
|
||||||
|
{
|
||||||
|
Uri uri = RingtoneManager
|
||||||
|
.getDefaultUri( RingtoneManager.TYPE_NOTIFICATION );
|
||||||
|
RingtoneManager.getRingtone( context, uri ).play();
|
||||||
|
}
|
||||||
|
|
||||||
// adapted from
|
// adapted from
|
||||||
// http://stackoverflow.com/questions/2174048/how-to-look-up-a-contacts-name-from-their-phone-number-on-android
|
// http://stackoverflow.com/questions/2174048/how-to-look-up-a-contacts-name-from-their-phone-number-on-android
|
||||||
public static String phoneToContact( Context context, String phone,
|
public static String phoneToContact( Context context, String phone,
|
||||||
|
|
Loading…
Reference in a new issue