Modification pour la video de barbi
authormarseille
Fri, 24 Apr 2009 21:13:54 +0200
changeset 178 393009fc8265
parent 177 779ac7aefd71
child 184 e9d73490be9b
Modification pour la video de barbi
res/values/strings.xml
src/com/beem/project/beem/service/BeemChatManager.java
src/com/beem/project/beem/service/XmppFacade.java
--- a/res/values/strings.xml	Fri Apr 24 17:22:03 2009 +0200
+++ b/res/values/strings.xml	Fri Apr 24 21:13:54 2009 +0200
@@ -65,5 +65,7 @@
 	<string name="ChangeStatusOk">Updating status</string>
 	<string name="ChangeStatusNoChange">Nothing to change</string>
 
+	<!--  BeemChatManager -->
+	<string name="BeemChatManagerNewMessage">You have got a new message</string>
 
 </resources>
--- a/src/com/beem/project/beem/service/BeemChatManager.java	Fri Apr 24 17:22:03 2009 +0200
+++ b/src/com/beem/project/beem/service/BeemChatManager.java	Fri Apr 24 21:13:54 2009 +0200
@@ -23,6 +23,7 @@
 import android.util.Log;
 
 import com.beem.project.beem.BeemService;
+import com.beem.project.beem.R;
 import com.beem.project.beem.service.aidl.IChat;
 import com.beem.project.beem.service.aidl.IChatManager;
 import com.beem.project.beem.service.aidl.IChatManagerListener;
@@ -140,7 +141,7 @@
 	public void chatCreated(Chat chat, boolean locally) {
 	    IChat newchat = getChat(chat);
 	    if (!locally) {
-		//	chat.addMessageListener(mChatListener);
+		// chat.addMessageListener(mChatListener);
 		notifyNewChat(newchat);
 	    }
 	    chat.addMessageListener(mChatListener);
@@ -162,15 +163,15 @@
 	private void notifyNewChat(IChat chat) {
 	    try {
 		String text = chat.getParticipant().getJID();
-		Notification notif = new Notification(com.beem.project.beem.R.drawable.signal, text, System
+		Notification notif = new Notification(com.beem.project.beem.R.drawable.notify_message, text, System
 		    .currentTimeMillis());
 		notif.defaults = Notification.DEFAULT_ALL;
 		notif.flags = Notification.FLAG_AUTO_CANCEL;
 		Intent intent = new Intent(mService, SendIM.class);
 		// TODO use prefix for name
 		intent.putExtra("contact", chat.getParticipant());
-		notif.setLatestEventInfo(mService, text, "nouveau message", PendingIntent.getActivity(mService, 0,
-		    intent, PendingIntent.FLAG_ONE_SHOT));
+		notif.setLatestEventInfo(mService, text, mService.getString(R.string.BeemChatManagerNewMessage),
+		    PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_ONE_SHOT));
 		int id = chat.hashCode();
 		mService.sendNotification(id, notif);
 	    } catch (RemoteException e) {
--- a/src/com/beem/project/beem/service/XmppFacade.java	Fri Apr 24 17:22:03 2009 +0200
+++ b/src/com/beem/project/beem/service/XmppFacade.java	Fri Apr 24 21:13:54 2009 +0200
@@ -97,7 +97,7 @@
 	
 	Notification mStatusNotification;
 	String text = (msg == null ? "" : msg);
-	mStatusNotification = new Notification(com.beem.project.beem.R.drawable.signal, text, System.currentTimeMillis());
+	mStatusNotification = new Notification(com.beem.project.beem.R.drawable.notify_signal, text, System.currentTimeMillis());
 	mStatusNotification.defaults = Notification.DEFAULT_ALL;
 	mStatusNotification.flags = Notification.FLAG_NO_CLEAR;