# HG changeset patch # User Da Risk # Date 1261499311 -3600 # Node ID cdadf4e39f99305409b185ff37cba9b306e29097 # Parent 8d54817f081f5bf6c8ffe86f6a7f4387d0143e6d Checkstyle diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/BeemChatManager.java --- a/src/com/beem/project/beem/service/BeemChatManager.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/BeemChatManager.java Tue Dec 22 17:28:31 2009 +0100 @@ -68,7 +68,6 @@ import com.beem.project.beem.service.aidl.IMessageListener; import com.beem.project.beem.service.aidl.IRoster; -// TODO: Auto-generated Javadoc /** * An adapter for smack's ChatManager. This class provides functionnality to handle chats. * @author darisk @@ -216,7 +215,7 @@ public IChat createChat(String jid, IMessageListener listener) { String key = StringUtils.parseBareAddress(jid); ChatAdapter result; - Log.d(TAG, "Get chat key = "+key); + Log.d(TAG, "Get chat key = " + key); if (mChats.containsKey(key)) { result = mChats.get(key); result.addMessageListener(listener); diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/ChatAdapter.java --- a/src/com/beem/project/beem/service/ChatAdapter.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/ChatAdapter.java Tue Dec 22 17:28:31 2009 +0100 @@ -60,7 +60,6 @@ import com.beem.project.beem.service.aidl.IChat; import com.beem.project.beem.service.aidl.IMessageListener; -// TODO: Auto-generated Javadoc /** * An adapter for smack's Chat class. * @author darisk @@ -199,6 +198,11 @@ * Listener. */ private class MsgListener implements MessageListener, ChatStateListener { + /** + * Constructor. + */ + public MsgListener() { } + @Override public void processMessage(Chat chat, org.jivesoftware.smack.packet.Message message) { Message msg = new Message(message); diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/Contact.aidl --- a/src/com/beem/project/beem/service/Contact.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/Contact.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service; parcelable Contact; diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/Contact.java --- a/src/com/beem/project/beem/service/Contact.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/Contact.java Tue Dec 22 17:28:31 2009 +0100 @@ -57,7 +57,6 @@ import com.beem.project.beem.utils.Status; -// TODO: Auto-generated Javadoc /** * This class contains informations on a jabber contact. * @author darisk @@ -109,20 +108,6 @@ } /** - * {@inheritDoc} - */ - @Override - public void writeToParcel(Parcel dest, int flags) { - dest.writeInt(mID); - dest.writeInt(mStatus); - dest.writeString(mJID); - dest.writeString(mName); - dest.writeString(mMsgState); - dest.writeStringList(getMRes()); - dest.writeStringList(getGroups()); - } - - /** * Constructor. * @param jid JID of the contact */ @@ -157,6 +142,20 @@ } /** + * {@inheritDoc} + */ + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(mID); + dest.writeInt(mStatus); + dest.writeString(mJID); + dest.writeString(mName); + dest.writeString(mMsgState); + dest.writeStringList(getMRes()); + dest.writeStringList(getGroups()); + } + + /** * Add a group for the contact. * @param group the group */ diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/Message.aidl --- a/src/com/beem/project/beem/service/Message.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/Message.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service; -parcelable Message; \ No newline at end of file +parcelable Message; diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/Message.java --- a/src/com/beem/project/beem/service/Message.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/Message.java Tue Dec 22 17:28:31 2009 +0100 @@ -49,7 +49,6 @@ import android.os.Parcelable; import android.util.Log; -// TODO: Auto-generated Javadoc /** * This class represents a instant message. * @author darisk @@ -67,7 +66,7 @@ /** Error message type. */ public static final int MSG_TYPE_ERROR = 400; - + /** Parcelable.Creator needs by Android. */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/PresenceAdapter.aidl --- a/src/com/beem/project/beem/service/PresenceAdapter.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/PresenceAdapter.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service; -parcelable PresenceAdapter; \ No newline at end of file +parcelable PresenceAdapter; diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/PresenceAdapter.java --- a/src/com/beem/project/beem/service/PresenceAdapter.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/PresenceAdapter.java Tue Dec 22 17:28:31 2009 +0100 @@ -51,7 +51,6 @@ import com.beem.project.beem.utils.PresenceType; import com.beem.project.beem.utils.Status; -// TODO: Auto-generated Javadoc /** * this class contain contact presence informations. * @author nikita diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/PrivacyListItem.aidl --- a/src/com/beem/project/beem/service/PrivacyListItem.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/PrivacyListItem.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service; parcelable PrivacyListItem; diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/PrivacyListItem.java --- a/src/com/beem/project/beem/service/PrivacyListItem.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/PrivacyListItem.java Tue Dec 22 17:28:31 2009 +0100 @@ -46,7 +46,6 @@ import android.os.Parcel; import android.os.Parcelable; -// TODO: Auto-generated Javadoc /** * A simplified version of the Smack PrivacyItem class. * @author Jean-Manuel Da Silva diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/PrivacyListManagerAdapter.java --- a/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java Tue Dec 22 17:28:31 2009 +0100 @@ -60,7 +60,6 @@ import com.beem.project.beem.service.aidl.IPrivacyListListener; import com.beem.project.beem.service.aidl.IPrivacyListManager; -// TODO: Auto-generated Javadoc /** * An adapter for the Smack's PrivacyListManager. * @author Jean-Manuel Da Silva @@ -284,6 +283,10 @@ * @author Jean-Manuel Da Silva */ private class PrivacyListListenerAdapter implements PrivacyListListener { + /** + * Constructor. + */ + public PrivacyListListenerAdapter() { } @Override public void setPrivacyList(final String listName, final List listItem) { @@ -317,18 +320,12 @@ } } - /* (non-Javadoc) - * @see com.beem.project.beem.service.aidl.IPrivacyListManager#addPrivacyListListener(com.beem.project.beem.service.aidl.IPrivacyListListener) - */ @Override public void addPrivacyListListener(IPrivacyListListener listener) throws RemoteException { if (listener != null) mPrivacyListListeners.register(listener); } - /* (non-Javadoc) - * @see com.beem.project.beem.service.aidl.IPrivacyListManager#removePrivacyListListener(com.beem.project.beem.service.aidl.IPrivacyListListener) - */ @Override public void removePrivacyListListener(IPrivacyListListener listener) throws RemoteException { if (listener != null) diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/RosterAdapter.java --- a/src/com/beem/project/beem/service/RosterAdapter.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/RosterAdapter.java Tue Dec 22 17:28:31 2009 +0100 @@ -65,7 +65,6 @@ import com.beem.project.beem.service.aidl.IBeemRosterListener; import com.beem.project.beem.utils.Status; -// TODO: Auto-generated Javadoc /** * This class implement a Roster adapter for BEEM. */ @@ -82,7 +81,7 @@ * @param roster The roster to adapt. * @param context The context of the RosterAdapter. */ - public RosterAdapter(final Roster roster, Context context) { + public RosterAdapter(final Roster roster, final Context context) { mAdaptee = roster; roster.addRosterListener(mRosterListener); mDefaultStatusMessages = createDefaultStatusMessagesMap(context); @@ -177,7 +176,7 @@ } } // Because getEntries return duplicated user. - if (add == true) + if (add) coList.add(getContactFromRosterEntry(entry)); } return coList; @@ -287,7 +286,7 @@ .getString(R.string.contact_status_msg_offline)); defaultStatusMessages.put(Status.CONTACT_STATUS_UNAVAILABLE, context.getString(R.string.contact_status_msg_xa)); - return (defaultStatusMessages); + return defaultStatusMessages; } /** diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/XmppFacade.java --- a/src/com/beem/project/beem/service/XmppFacade.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/XmppFacade.java Tue Dec 22 17:28:31 2009 +0100 @@ -58,7 +58,6 @@ import com.beem.project.beem.service.aidl.IXmppFacade; import com.beem.project.beem.utils.PresenceType; -// TODO: Auto-generated Javadoc /** * This class is a facade for the Beem Service. * @author darisk @@ -145,9 +144,6 @@ return mConnexion.getPrivacyListManager(); } - /* (non-Javadoc) - * @see com.beem.project.beem.service.aidl.IXmppFacade#sendPresencePacket(com.beem.project.beem.service.PresenceAdapter) - */ @Override public void sendPresencePacket(PresenceAdapter presence) throws RemoteException { Presence presence2 = new Presence(PresenceType.getPresenceTypeFrom(presence.getType())); diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl --- a/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; /** @@ -5,7 +48,7 @@ * @author Da Risk */ interface IBeemConnectionListener { - + /** * Callback to call when the connection is closed */ diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl --- a/src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.PresenceAdapter; @@ -8,4 +51,4 @@ void onEntriesDeleted(in List addresses); void onPresenceChanged(in PresenceAdapter presence); void onEntryDeleteFromGroup(in String group, in String jid); -} \ No newline at end of file +} diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IChat.aidl --- a/src/com/beem/project/beem/service/aidl/IChat.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IChat.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.Contact; @@ -8,13 +51,13 @@ * An aidl interface for Chat session. */ interface IChat { - + /** * Send a message. * @param message the message to send */ void sendMessage(in Message message); - + /** * Get the participant of the chat * @return the participant @@ -32,15 +75,15 @@ * @param listener the listener to remove. */ void removeMessageListener(in IMessageListener listener); - + String getState(); - + void setOpen(in boolean isOpen); - + boolean isOpen(); - + void setState(in String state); - + List getMessages(); } diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IChatManager.aidl --- a/src/com/beem/project/beem/service/aidl/IChatManager.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IChatManager.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.Contact; @@ -10,9 +53,7 @@ * The chat manager will manage all the chat sessions. */ interface IChatManager { - - //IChat createChat(in String jid, in IMessageListener listener); - + /** * Create a chat session with a contact. * @param contact the contact to chat with @@ -20,13 +61,13 @@ * @return the chat session */ IChat createChat(in Contact contact, in IMessageListener listener); - + /** * Destroy a chat session with a contact. * @param chat the chat session */ void destroyChat(in IChat chat); - + /** * @param chat the chat. */ @@ -37,7 +78,7 @@ * @param listener the callback to add */ void addChatCreationListener(in IChatManagerListener listener); - + /** * Remove a callback for the creation of new chat session. * @param listener the callback to remove. diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IChatManagerListener.aidl --- a/src/com/beem/project/beem/service/aidl/IChatManagerListener.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IChatManagerListener.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.aidl.IChat; @@ -7,12 +50,12 @@ * This listener will execute on events like creation of chat session. */ interface IChatManagerListener { - + /** * Call when a new chat session is created. * @param chat the created chat session * @param locally true if the session is create by a chat manager. */ void chatCreated(IChat chat, boolean locally); - -} \ No newline at end of file + +} diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IContact.aidl --- a/src/com/beem/project/beem/service/aidl/IContact.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IContact.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,9 +1,53 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; interface IContact { String getJID(); - + void setJID(String mjid); -} \ No newline at end of file +} + diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IMessageListener.aidl --- a/src/com/beem/project/beem/service/aidl/IMessageListener.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IMessageListener.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.Message; @@ -6,7 +49,7 @@ interface IMessageListener { void processMessage(in IChat chat, in Message msg); - + /** * le chatState se trouve dans le IChat */ diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IPrivacyListManager.aidl --- a/src/com/beem/project/beem/service/aidl/IPrivacyListManager.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IPrivacyListManager.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.PrivacyListItem; @@ -19,4 +62,5 @@ List getBlockedGroupsByList(in String listName); void addPrivacyListListener(in IPrivacyListListener listener); void removePrivacyListListener(in IPrivacyListListener listener); -} \ No newline at end of file +} + diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IRoster.aidl --- a/src/com/beem/project/beem/service/aidl/IRoster.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IRoster.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.aidl.IBeemRosterListener; @@ -5,27 +48,27 @@ import com.beem.project.beem.service.PresenceAdapter; interface IRoster { - + Contact addContact(in String user, in String name, in String[] groups); - + void deleteContact(in Contact contact); - + Contact getContact(in String jid); void setContactName(in String jid, in String name); - + void createGroup(in String groupname); - + void addContactToGroup(in String groupName, in String jid); - + void removeContactFromGroup(in String groupName, in String jid); - + List getContactList(); - + List getGroupsNames(); - + PresenceAdapter getPresence(in String jid); - + void addRosterListener(in IBeemRosterListener listen); void removeRosterListener(in IBeemRosterListener listen); -} \ No newline at end of file +} diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IXmppConnection.aidl --- a/src/com/beem/project/beem/service/aidl/IXmppConnection.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IXmppConnection.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.aidl.IRoster; diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/service/aidl/IXmppFacade.aidl --- a/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Tue Dec 22 17:28:31 2009 +0100 @@ -1,3 +1,46 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ package com.beem.project.beem.service.aidl; import com.beem.project.beem.service.aidl.IXmppConnection; @@ -12,22 +55,22 @@ * Get the XmppConnection of the facade. */ IXmppConnection createConnection(); - + /** * Get the roster of the user */ IRoster getRoster(); - + /** * Connect and login synchronously on the server. */ void connectSync(); - + /** * Connect and login asynchronously on the server. */ void connectAsync(); - + /** * Disconnect from the server */ @@ -37,14 +80,14 @@ * Get the chat manager. */ IChatManager getChatManager(); - + /** * Change the status of the user. * @param status the status to set * @param msg the message state to set */ void changeStatus(in int status, in String msg); - + void sendPresencePacket(in PresenceAdapter presence); /** @@ -52,12 +95,12 @@ * @param jid the receiver id */ void call(in String jid); - - /** - * get the user vcard avatar - * @param jid the user jid - */ - byte[] getVcardAvatar(in String jid); - - IPrivacyListManager getPrivacyListManager(); + + /** + * get the user vcard avatar + * @param jid the user jid + */ + byte[] getVcardAvatar(in String jid); + + IPrivacyListManager getPrivacyListManager(); } diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/AddContact.java --- a/src/com/beem/project/beem/ui/AddContact.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/AddContact.java Tue Dec 22 17:28:31 2009 +0100 @@ -67,7 +67,6 @@ import com.beem.project.beem.service.aidl.IXmppFacade; import com.beem.project.beem.utils.BeemBroadcastReceiver; -// TODO: Auto-generated Javadoc /** * This activity is used to add a contact. * @author nikita @@ -176,6 +175,11 @@ */ private class OkListener implements OnClickListener { + /** + * Constructor. + */ + public OkListener() { } + @Override public void onClick(View v) { String login; @@ -196,9 +200,8 @@ mGroup.add(getWidgetText(R.id.addc_group)); try { if (mXmppFacade != null) { - if (mXmppFacade.getRoster().getContact(login) != null) + if (mXmppFacade.getRoster().getContact(login) != null) { mGroup.addAll(mXmppFacade.getRoster().getContact(login).getGroups()); - if (mXmppFacade.getRoster().getContact(login) != null) { Toast.makeText(AddContact.this, getString(R.string.AddCContactAlready), Toast.LENGTH_SHORT) .show(); return; diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/ChangeStatus.java --- a/src/com/beem/project/beem/ui/ChangeStatus.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/ChangeStatus.java Tue Dec 22 17:28:31 2009 +0100 @@ -192,22 +192,31 @@ * @return item position in the array. */ private int getStatusForService(String item) { + int result; switch (mAdapter.getPosition(item)) { case ChangeStatus.DISCONNECTED_IDX: - return Status.CONTACT_STATUS_DISCONNECT; + result = Status.CONTACT_STATUS_DISCONNECT; + break; case ChangeStatus.AVAILABLE_FOR_CHAT_IDX: - return Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT; + result = Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT; + break; case ChangeStatus.AVAILABLE_IDX: - return Status.CONTACT_STATUS_AVAILABLE; + result = Status.CONTACT_STATUS_AVAILABLE; + break; case ChangeStatus.AWAY_IDX: - return Status.CONTACT_STATUS_AWAY; + result = Status.CONTACT_STATUS_AWAY; + break; case ChangeStatus.BUSY_IDX: - return Status.CONTACT_STATUS_BUSY; + result = Status.CONTACT_STATUS_BUSY; + break; case ChangeStatus.UNAVAILABLE_IDX: - return Status.CONTACT_STATUS_UNAVAILABLE; + result = Status.CONTACT_STATUS_UNAVAILABLE; + break; default: - return Status.CONTACT_STATUS_AVAILABLE; + result = Status.CONTACT_STATUS_AVAILABLE; + break; } + return result; } /** diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/Chat.java --- a/src/com/beem/project/beem/ui/Chat.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/Chat.java Tue Dec 22 17:28:31 2009 +0100 @@ -97,7 +97,6 @@ import com.beem.project.beem.utils.BeemBroadcastReceiver; import com.beem.project.beem.utils.Status; -// TODO: Auto-generated Javadoc /** * This class represents an activity which allows the user to chat with his/her contacts. * @author Jean-Manuel Da Silva @@ -390,6 +389,10 @@ */ private final class BeemServiceConnection implements ServiceConnection { + /** + * Constructor. + */ + public BeemServiceConnection() { } /** * {@inheritDoc}. diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/ContactList.java Tue Dec 22 17:28:31 2009 +0100 @@ -54,7 +54,6 @@ import android.app.Activity; import android.app.Dialog; import android.content.ComponentName; -import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; @@ -81,7 +80,6 @@ import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.graphics.drawable.BitmapDrawable; -import android.R.drawable; import com.beem.project.beem.R; import com.beem.project.beem.service.Contact; @@ -107,6 +105,8 @@ } private static final int REQUEST_CODE = 1; + private static final String SETTINGS_HIDDEN_CONTACT = "settings_key_hidden_contact"; + private static final String TAG = "ContactList"; private final BeemContactList mAdapterContactList = new BeemContactList(); private final BeemBanner mAdapterBanner = new BeemBanner(); private final List mListGroup = new ArrayList(); @@ -114,7 +114,8 @@ private final Handler mHandler = new Handler(); private final ServiceConnection mServConn = new BeemServiceConnection(); private final BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver(); - private final ComparatorContactListByStatusAndName mComparator = new ComparatorContactListByStatusAndName(); + private final ComparatorContactListByStatusAndName mComparator = + new ComparatorContactListByStatusAndName(); private final BeemRosterListener mBeemRosterListener = new BeemRosterListener(); private final Map mIconsMap = new HashMap(); private List mListContact; @@ -188,46 +189,57 @@ @Override public boolean onContextItemSelected(MenuItem item) { Intent in; + boolean result; if (mContact != null) { switch (item.getItemId()) { case R.id.contact_list_context_menu_chat_item: in = new Intent(this, Chat.class); in.setData(mContact.toUri()); startActivity(in); - return true; + result = true; + break; case R.id.contact_list_context_menu_call_item: try { mXmppFacade.call(mContact.getJID() + "/psi"); - return true; + result = true; } catch (RemoteException e) { e.printStackTrace(); } - return true; + result = true; + break; case R.id.contact_list_context_menu_user_info: item.getSubMenu().setHeaderTitle(mContact.getJID()); - return true; + result = true; + break; case R.id.contact_list_context_menu_userinfo_alias: Dialog alias = new Alias(ContactList.this, mRoster, mContact).create(); alias.show(); - return true; + result = true; + break; case R.id.contact_list_context_menu_userinfo_group: in = new Intent(this, GroupList.class); in.putExtra("contact", mContact); startActivity(in); - return true; + result = true; + break; case R.id.contact_list_context_menu_userinfo_subscription: Dialog subscription = new ResendSubscription(ContactList.this, mXmppFacade, mContact).create(); subscription.show(); - return true; + result = true; + break; case R.id.contact_list_context_menu_userinfo_block: - return true; + result = true; + break; case R.id.contact_list_context_menu_userinfo_delete: Dialog delete = new DeleteContact(ContactList.this, mRoster, mContact).create(); delete.show(); - return true; + result = true; + break; default: - return super.onContextItemSelected(item); + result = super.onContextItemSelected(item); + break; } + return result; } return super.onContextItemSelected(item); } @@ -254,7 +266,7 @@ @Override protected void onCreate(Bundle saveBundle) { super.onCreate(saveBundle); - Log.v("CONTACTLIST", "onCreate"); + Log.v(TAG, "onCreate"); mSettings = PreferenceManager.getDefaultSharedPreferences(this); setContentView(R.layout.contactlist); @@ -266,17 +278,11 @@ /** * {@inheritDoc} - * + */ @Override - protected void onStart() { - super.onStart(); - if (mXmppFacade == null) - bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE); - } -*/ protected void onResume() { super.onResume(); - Log.d("CONTACTLIST", "onResume"); + Log.d(TAG, "onResume"); if (mXmppFacade == null) bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE); } @@ -297,7 +303,7 @@ } unbindService(mServConn); mXmppFacade = null; - Log.e("CONTACTLIST", "onPause activity"); + Log.e(TAG, "onPause activity"); } /* @@ -308,7 +314,7 @@ protected void onDestroy() { super.onDestroy(); this.unregisterReceiver(mReceiver); - Log.e("CONTACTLIST", "onDestroy activity"); + Log.e(TAG, "onDestroy activity"); } /** @@ -424,10 +430,12 @@ private void prepareIconsStatus() { mIconsMap.put(Status.CONTACT_STATUS_AVAILABLE, new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_online))); - mIconsMap.put(Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT, new BitmapDrawable(BitmapFactory.decodeResource(getResources(), - android.R.drawable.presence_online))); - mIconsMap.put(Status.CONTACT_STATUS_AWAY, new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_away))); - mIconsMap.put(Status.CONTACT_STATUS_BUSY, new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_busy))); + mIconsMap.put(Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT, + new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_online))); + mIconsMap.put(Status.CONTACT_STATUS_AWAY, + new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_away))); + mIconsMap.put(Status.CONTACT_STATUS_BUSY, + new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_busy))); mIconsMap.put(Status.CONTACT_STATUS_DISCONNECT, new BitmapDrawable(BitmapFactory.decodeResource(getResources(), android.R.drawable.presence_offline))); mIconsMap.put(Status.CONTACT_STATUS_UNAVAILABLE, new BitmapDrawable(BitmapFactory.decodeResource(getResources(), @@ -606,7 +614,7 @@ */ @Override public int getCount() { - if (mSettings.getBoolean("settings_key_hidden_contact", false)) { + if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) { int res = 0; for (Contact c : mListContact) { if (Status.statusOnline(c.getStatus())) @@ -624,7 +632,7 @@ @Override public Object getItem(int position) { Contact c = null; - if (mSettings.getBoolean("settings_key_hidden_contact", false)) { + if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) { int res = 0; for (Contact cur : mListContact) { if (res == position) { @@ -657,7 +665,7 @@ v = mInflater.inflate(R.layout.contactlistcontact, null); } Contact c = null; - if (mSettings.getBoolean("settings_key_hidden_contact", false)) { + if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false)) { int res = 0; for (Contact cur : mListContact) { if (res == position) { @@ -676,7 +684,7 @@ e.printStackTrace(); } } - if (mSettings.getBoolean("settings_key_hidden_contact", false) && !Status.statusOnline(c.getStatus())) { + if (mSettings.getBoolean(SETTINGS_HIDDEN_CONTACT, false) && !Status.statusOnline(c.getStatus())) { v.setVisibility(View.GONE); } else { bindView(v, c); @@ -822,7 +830,8 @@ } } + @Override protected void finalize() { - Log.e("CONTACTLIST", "FINALIZE"); + Log.e(TAG, "FINALIZE"); } } diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/CreateAccount.java --- a/src/com/beem/project/beem/ui/CreateAccount.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/CreateAccount.java Tue Dec 22 17:28:31 2009 +0100 @@ -108,8 +108,8 @@ private boolean createAccount(String username, String password) { XMPPConnection xmppConnection = null; ConnectionConfiguration connectionConfiguration = null; - ProxyInfo pi = null; - if ((pi = getRegisteredProxy()) != null) { + ProxyInfo pi = getRegisteredProxy(); + if (pi != null) { connectionConfiguration = new ConnectionConfiguration(getXMPPServer(), getXMPPPort(), pi); } else { connectionConfiguration = new ConnectionConfiguration(getXMPPServer(), getXMPPPort()); @@ -139,7 +139,10 @@ */ private void createErrorDialog(String errMsg) { AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.create_account_err_dialog_title).setMessage(errMsg).setCancelable(false).setIcon(android.R.drawable.ic_dialog_alert); + builder.setTitle(R.string.create_account_err_dialog_title) + .setMessage(errMsg) + .setCancelable(false) + .setIcon(android.R.drawable.ic_dialog_alert); builder.setNeutralButton(R.string.create_account_close_dialog_button, new DialogInterface.OnClickListener() { @Override diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/GroupList.java --- a/src/com/beem/project/beem/ui/GroupList.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/GroupList.java Tue Dec 22 17:28:31 2009 +0100 @@ -71,7 +71,6 @@ import com.beem.project.beem.service.aidl.IXmppFacade; import com.beem.project.beem.utils.BeemBroadcastReceiver; -// TODO: Auto-generated Javadoc /** * That activity permit to manage user groups. * @author nikita diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/Login.java --- a/src/com/beem/project/beem/ui/Login.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/Login.java Tue Dec 22 17:28:31 2009 +0100 @@ -65,6 +65,7 @@ */ public class Login extends Activity { + private static final int LOGIN_REQUEST_CODE = 1; private SharedPreferences mSettings; private TextView mTextView; private boolean mIsConfigured; @@ -98,7 +99,7 @@ if (mIsConfigured && !mIsResult && BeemConnectivity.isConnected(getApplicationContext())) { mTextView.setText(""); Intent i = new Intent(this, LoginAnim.class); - startActivityForResult(i, 42); + startActivityForResult(i, LOGIN_REQUEST_CODE); mIsResult = false; } } @@ -108,7 +109,7 @@ */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == 42) { + if (requestCode == LOGIN_REQUEST_CODE) { mIsResult = true; if (resultCode == Activity.RESULT_OK) { startActivity(new Intent(this, ContactList.class)); @@ -139,25 +140,35 @@ */ @Override public final boolean onOptionsItemSelected(MenuItem item) { + boolean result; switch (item.getItemId()) { case R.id.login_menu_settings: mTextView.setText(""); startActivity(new Intent(Login.this, Settings.class)); - return true; + result = true; + break; case R.id.login_menu_about: createAboutDialog(); - return true; + result = true; + break; case R.id.login_menu_login: if (testConnectivity()) { Intent i = new Intent(this, LoginAnim.class); - startActivityForResult(i, 42); + startActivityForResult(i, LOGIN_REQUEST_CODE); } - return true; + result = true; + break; default: - return false; + result = false; + break; } + return result; } + /** + * Test the connectivity of the phone. + * @return true if we are connected to a network. + */ private boolean testConnectivity() { if (!BeemConnectivity.isConnected(getApplicationContext())) { Toast.makeText(Login.this, R.string.login_no_connectivity, Toast.LENGTH_SHORT).show(); diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/LoginAnim.java --- a/src/com/beem/project/beem/ui/LoginAnim.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/LoginAnim.java Tue Dec 22 17:28:31 2009 +0100 @@ -64,7 +64,6 @@ import com.beem.project.beem.service.aidl.IXmppConnection; import com.beem.project.beem.service.aidl.IXmppFacade; -// TODO: Auto-generated Javadoc /** * This class is an activity which display an animation during the connection with the server. * @author Da Risk diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/Settings.java --- a/src/com/beem/project/beem/ui/Settings.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/Settings.java Tue Dec 22 17:28:31 2009 +0100 @@ -58,7 +58,6 @@ import com.beem.project.beem.R; import com.beem.project.beem.utils.BeemBroadcastReceiver; -// TODO: Auto-generated Javadoc /** * This class represents an activity which allows the user to change his account or proxy parameters. */ diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/Subscription.java --- a/src/com/beem/project/beem/ui/Subscription.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/Subscription.java Tue Dec 22 17:28:31 2009 +0100 @@ -65,7 +65,6 @@ import com.beem.project.beem.service.aidl.IXmppFacade; import com.beem.project.beem.utils.BeemBroadcastReceiver; -// TODO: Auto-generated Javadoc /** * This activity is used to accept a subscription request. * @author nikita @@ -76,7 +75,7 @@ private IXmppFacade mService; private String mContact; private ServiceConnection mServConn = new BeemServiceConnection(); - private final BeemBroadcastReceiver mReceiver= new BeemBroadcastReceiver(); + private final BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver(); private MyOnClickListener mClickListener = new MyOnClickListener(); static { diff -r 8d54817f081f -r cdadf4e39f99 src/com/beem/project/beem/ui/package-info.java --- a/src/com/beem/project/beem/ui/package-info.java Tue Dec 22 15:56:54 2009 +0100 +++ b/src/com/beem/project/beem/ui/package-info.java Tue Dec 22 17:28:31 2009 +0100 @@ -39,7 +39,9 @@ Flavien Astraud, November 26, 2009 Head of the EIP Laboratory. - */ +/** + * This package contains the different activity displayed by BEEM and other class useful to make the UI. + */ package com.beem.project.beem.ui;