--- a/res/layout/contactlistcontact.xml Fri Apr 24 17:20:59 2009 +0200
+++ b/res/layout/contactlistcontact.xml Fri Apr 24 17:22:03 2009 +0200
@@ -5,7 +5,6 @@
android:layout_height="wrap_content"
android:paddingLeft="10px"
android:paddingRight="10px"
- android:background="@drawable/beem_sendim_header_1"
android:gravity="center_vertical" >
<ImageView android:id="@+id/contactliststatus"
--- a/res/layout/contactlistgroup.xml Fri Apr 24 17:20:59 2009 +0200
+++ b/res/layout/contactlistgroup.xml Fri Apr 24 17:22:03 2009 +0200
@@ -4,7 +4,6 @@
android:layout_width="fill_parent"
android:layout_height="50sp"
android:paddingTop="5sp"
- android:background="@drawable/beem_contactlist_header_1"
android:gravity="center_vertical">
<TextView android:id="@+id/textgroup"
--- a/res/layout/sendim.xml Fri Apr 24 17:20:59 2009 +0200
+++ b/res/layout/sendim.xml Fri Apr 24 17:22:03 2009 +0200
@@ -7,7 +7,6 @@
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:background="@drawable/beem_sendim_header_1"
android:gravity="center_vertical" >
<ImageView
--- a/src/com/beem/project/beem/ui/ContactList.java Fri Apr 24 17:20:59 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java Fri Apr 24 17:22:03 2009 +0200
@@ -42,6 +42,7 @@
private static final String CHILD = "CHILD";
private static final String GROUP = "GROUP";
private IXmppFacade mService = null;
+ private ExpandableListAdapter mAdapter;
private BeemApplication mBeemApplication;
private BeemRosterListener mRosterListener;
private SharedPreferences mSettings;
@@ -61,22 +62,25 @@
@Override
protected void onCreate(Bundle saveBundle) {
super.onCreate(saveBundle);
- mBeemApplication = BeemApplication.getApplication(this);
mRosterListener = new BeemRosterListener();
mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
+ mBeemApplication = BeemApplication.getApplication(this);
// bug fixe temporaire des betises de marseille
- /*
- * SharedPreferences mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
- * SharedPreferences.Editor editor = mSettings.edit(); editor.putInt(getString(R.string.PreferencePortKey),
- * 5222); editor.commit();
- */
+//
+// SharedPreferences mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
+// SharedPreferences.Editor editor = mSettings.edit(); editor.putInt(getString(R.string.PreferencePortKey),
+// 5222); editor.commit();
+
}
-
+
@Override
protected void onResume() {
super.onResume();
- if (!mBeemApplication.isConnected())
+
+ if (!mBeemApplication.isConnected()) {
+ mBeemApplication = BeemApplication.getApplication(this);
mBeemApplication.startBeemService();
+ }
mBeemApplication.callWhenConnectedToServer(new Handler(), new Runnable() {
@Override
public void run() {
@@ -93,7 +97,8 @@
e.printStackTrace();
}
}
- callbackShowContactList();
+ if (mAdapter == null)
+ callbackShowContactList();
}
});
}
@@ -159,19 +164,18 @@
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == PREFERENCECHANGED) {
if (resultCode == RESULT_OK) {
- setListAdapter(null);
+ mAdapter = null;
+ setListAdapter(mAdapter);
mBeemApplication.stopBeemService();
- mBeemApplication.startBeemService();
}
}
}
private void showContactList(List<String> listGroup, List<Contact> listContact) {
- ExpandableListAdapter Adapter;
List<Map<String, String>> groupData = new ArrayList<Map<String, String>>();
List<List<Map<String, Contact>>> childData = new ArrayList<List<Map<String, Contact>>>();
-
- if (listGroup.size() == 0)
+ int groupSize = listGroup.size();
+ if (groupSize == 0)
listGroup.add("Default");
for (int i = 0; i < listGroup.size(); i++) {
Map<String, String> curGroupMap = new HashMap<String, String>();
@@ -182,18 +186,20 @@
List<Map<String, Contact>> children = new ArrayList<Map<String, Contact>>();
for (int j = 0; j < listContact.size(); ++j) {
Contact c = listContact.get(j);
- Log.i(TAG, c.getID() + " " + c.getJID());
- Map<String, Contact> curChildMap = new HashMap<String, Contact>();
- children.add(curChildMap);
- curChildMap.put(CHILD, c);
+ if (groupSize == 0 /* || listGroup.get(i).equals(c.getGroupName()) */) {
+ Log.i(TAG, c.getID() + " " + c.getJID());
+ Map<String, Contact> curChildMap = new HashMap<String, Contact>();
+ children.add(curChildMap);
+ curChildMap.put(CHILD, c);
+ }
}
childData.add(children);
}
- Adapter = new ContactExpandableListAdapter(this, groupData, R.layout.contactlistgroup, new String[] { GROUP },
+ mAdapter = new ContactExpandableListAdapter(this, groupData, R.layout.contactlistgroup, new String[] { GROUP },
new int[] { R.id.textgroup }, childData, R.layout.contactlistcontact, new String[] { CHILD }, new int[] {
R.id.contactliststatus, R.id.contactlistpseudo, R.id.contactlistmsgperso, R.id.contactlistavatar });
- setListAdapter(Adapter);
+ setListAdapter(mAdapter);
}
/**
--- a/src/com/beem/project/beem/ui/ContactListSettings.java Fri Apr 24 17:20:59 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactListSettings.java Fri Apr 24 17:22:03 2009 +0200
@@ -108,7 +108,7 @@
editor.putString(getString(R.string.PreferencePasswordKey), getWidgetText(R.id.password));
mIsChanged = true;
}
- if (isChanged(R.id.host, R.string.PreferenceService)) {
+ if (isChanged(R.id.service, R.string.PreferenceService)) {
editor.putString(getString(R.string.PreferenceService), getWidgetText(R.id.service));
mIsChanged = true;
}
@@ -118,7 +118,7 @@
mIsChanged = true;
}
if (Integer.parseInt(getWidgetText(R.id.proxy_port)) != mSettings.getInt(
- getString(R.string.PreferenceProxyPort), 1080)) {
+ getString(R.string.PreferenceProxyPort), 0)) {
editor
.putInt(getString(R.string.PreferenceProxyPort), Integer.parseInt(getWidgetText(R.id.proxy_port)));
mIsChanged = true;
--- a/src/com/beem/project/beem/ui/SendIM.java Fri Apr 24 17:20:59 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java Fri Apr 24 17:22:03 2009 +0200
@@ -109,6 +109,7 @@
@Override
protected void onResume() {
super.onResume();
+ mBeemApplication = BeemApplication.getApplication(this);
if (!mBeemApplication.isConnected())
mBeemApplication.startBeemService();
mBeemApplication.callWhenConnectedToServer(mHandler, new Runnable() {