Gestion 1st connection.
--- a/src/com/beem/project/beem/ui/ContactList.java Fri Apr 24 21:41:32 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java Sat Apr 25 21:33:18 2009 +0200
@@ -65,6 +65,8 @@
mRosterListener = new BeemRosterListener();
mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
mBeemApplication = BeemApplication.getApplication(this);
+ if (mSettings.getString(getString(R.string.PreferenceHostKey), "").equals(""))
+ startActivityForResult(new Intent(this, ContactListSettings.class), PREFERENCECHANGED);
}
@Override
@@ -180,7 +182,7 @@
List<Map<String, Contact>> children = new ArrayList<Map<String, Contact>>();
for (int j = 0; j < listContact.size(); ++j) {
Contact c = listContact.get(j);
- if (groupSize == 0 || c.getGroups().contains(listGroup.get(i)) ) {
+ if (groupSize == 0 || c.getGroups().contains(listGroup.get(i))) {
Log.i(TAG, c.getID() + " " + c.getJID());
Map<String, Contact> curChildMap = new HashMap<String, Contact>();
children.add(curChildMap);
--- a/src/com/beem/project/beem/ui/ContactListSettings.java Fri Apr 24 21:41:32 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactListSettings.java Sat Apr 25 21:33:18 2009 +0200
@@ -65,7 +65,7 @@
SharedPreferences.Editor editor = mSettings.edit();
LayoutParams lp = (LayoutParams) ll.getLayoutParams();
if (value.equals(getString(R.string.PreferenceProxyTypeNone))) {
- ll.setVisibility(LinearLayout.INVISIBLE);
+ ll.setVisibility(LinearLayout.INVISIBLE);
lp.height = 0;
ll.setLayoutParams(lp);
editor.putBoolean(getString(R.string.PreferenceUseProxy), false);
@@ -96,7 +96,8 @@
editor.putString(getString(R.string.PreferenceHostKey), getWidgetText(R.id.host));
mIsChanged = true;
}
- if (Integer.parseInt(getWidgetText(R.id.port)) != mSettings.getInt(getString(R.string.PreferencePortKey), 5222) ) {
+ if (Integer.parseInt(getWidgetText(R.id.port)) != mSettings.getInt(getString(R.string.PreferencePortKey),
+ 5222)) {
editor.putInt(getString(R.string.PreferencePortKey), Integer.parseInt(getWidgetText(R.id.port)));
mIsChanged = true;
}
@@ -131,7 +132,6 @@
editor.putString(getString(R.string.PreferenceProxyPassword), getWidgetText(R.id.proxy_pwd));
mIsChanged = true;
}
-
if (mIsChanged == true) {
editor.commit();
setResult(RESULT_OK);