# HG changeset patch # User Da Risk # Date 1253884549 -7200 # Node ID 21f8a872962fa529f17e4afeccf2c1a8417c536a # Parent 055bfaf224cedbfa7c152e6362f92cecf01f41e3# Parent 928e9403f8c195eb2856fb7b96ecd30feec0228e merge diff -r 055bfaf224ce -r 21f8a872962f res/values-en/strings.xml --- a/res/values-en/strings.xml Fri Sep 25 15:14:49 2009 +0200 +++ b/res/values-en/strings.xml Fri Sep 25 15:15:49 2009 +0200 @@ -207,5 +207,6 @@ Add a contact Settings All contacts + No group diff -r 055bfaf224ce -r 21f8a872962f res/values-fr/strings.xml --- a/res/values-fr/strings.xml Fri Sep 25 15:14:49 2009 +0200 +++ b/res/values-fr/strings.xml Fri Sep 25 15:15:49 2009 +0200 @@ -201,5 +201,6 @@ Ajouter un contact Paramètres Tous les contacts + Aucun groupe diff -r 055bfaf224ce -r 21f8a872962f src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Fri Sep 25 15:14:49 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Fri Sep 25 15:15:49 2009 +0200 @@ -1,5 +1,6 @@ package com.beem.project.beem.ui; +import java.security.spec.MGF1ParameterSpec; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -156,6 +157,12 @@ unbindService(mServConn); } + @Override + public void onContentChanged() { + super.onContentChanged(); + Log.i("OO", "CHANGED"); + } + /** * Comparator Contact by Name. */ @@ -263,7 +270,7 @@ @Override public boolean onItemLongClick(AdapterView arg0, View v, int pos, long lpos) { Contact c = mListContact.get(pos); - ContactDialog dialogContact = new ContactDialog(ContactList.this, c, "MYSTATICGROUP"); + ContactDialog dialogContact = new ContactDialog(ContactList.this, c, mCurGroup); dialogContact.setOwnerActivity(ContactList.this); dialogContact.show(); return true; @@ -358,8 +365,21 @@ } @Override - public void onEntryDeleteFromGroup(String group, String jid) throws RemoteException { - // TODO Auto-generated method stub + public void onEntryDeleteFromGroup(String group, String jid) throws RemoteException { + List tmpContactList = mContactOnGroup.get(group); + Contact curContact = null; + for (Contact c : tmpContactList) { + if (jid.equals(c.getJID())) { + curContact = c; + tmpContactList.remove(c); + c.getGroups().remove(group); + break; + } + } + if (curContact != null && curContact.getGroups().size() == 0) { + mContactOnGroup.get(getString(R.string.contact_list_no_group)).add(curContact); + } + mHandler.post(new RunnableChange()); } /** @@ -367,7 +387,6 @@ */ @Override public void onPresenceChanged(PresenceAdapter presence) throws RemoteException { - // TODO gerer la presence au niveau de chaque ressources ? String from = presence.getFrom(); boolean resfound = false; for (Contact curContact : mListContact) { @@ -580,16 +599,20 @@ List tmpGroupList = mRoster.getGroupsNames(); Collections.sort(tmpGroupList); mListGroup = tmpGroupList; + mListGroup.add(getString(R.string.contact_list_no_group)); if (tmpGroupList.size() > 0) { + List tmpNoGroup = new ArrayList(); for (String s : tmpGroupList) { List tmpList = new ArrayList(); for (Contact c : tmpContactList) { - if (c.getGroups().contains(s)) { + if (c.getGroups().size() == 0 && !tmpNoGroup.contains(c)) + tmpNoGroup.add(c); + else if (c.getGroups().contains(s)) tmpList.add(c); - } } mContactOnGroup.put(s, tmpList); } + mContactOnGroup.put(getString(R.string.contact_list_no_group), tmpNoGroup); mCurGroup = tmpGroupList.get(0); } else { mCurGroup = null;