merged
authornikita@nikita-lab
Fri, 22 May 2009 15:49:37 +0200
changeset 199 32104eafe784
parent 198 088857b09c7d
child 203 99d2dad14716
merged
src/com/beem/project/beem/ui/ContactDialog.java
src/com/beem/project/beem/ui/ContactList.java
--- a/src/com/beem/project/beem/ui/ContactDialog.java	Fri May 22 15:43:31 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactDialog.java	Fri May 22 15:49:37 2009 +0200
@@ -17,7 +17,7 @@
     private Contact mContact;
     private Context mContext;
 
-    public ContactDialog(final Context context, Contact curContact, Intent curIntent) {
+    public ContactDialog(final Context context, Contact curContact) {
 	super(context);
 	mContext = context;
 	setContentView(R.layout.contactdialog);
@@ -29,11 +29,10 @@
 
 	    @Override
 	    public void onClick(View v) {
-		/*Activity a = ContactDialog.this.getOwnerActivity();
+		Activity a = ContactDialog.this.getOwnerActivity();
 		Intent i = new Intent(mContext, SendIM.class);
 		i.putExtra("contact", mContact);
-		a.startActivity(i);*/
-		String type = ((TextView) v).getText();
+		a.startActivity(i);
 		dismiss();
 	    }
 	    
--- a/src/com/beem/project/beem/ui/ContactList.java	Fri May 22 15:43:31 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java	Fri May 22 15:49:37 2009 +0200
@@ -65,7 +65,6 @@
 	mRosterListener = new BeemRosterListener();
 	mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
 	mBeemApplication = BeemApplication.getApplication(this);
-<<<<<<< local
 	groupMap = new HashMap<String, List<Contact>>();
 	groupName = new ArrayList<String>();
 	mBeemApplication.callWhenConnectedToServer(mHandler, new Runnable() {
@@ -76,32 +75,17 @@
 		    mRoster = mService.getRoster();
 		} catch (RemoteException e1) {
 		    Log.e(TAG, "Get roster failed", e1);
-=======
-
-	//TODO: a refaire
-	/*if (mSettings.getString(getString(R.string.PreferenceHostKey), "").equals(""))
-	    startActivityForResult(new Intent(this, ContactListSettings.class), PREFERENCECHANGED);*/
-    }
-
-    @Override
-		protected void onResume() {	
-			super.onResume();
-
->>>>>>> other
 		}
-
-	@Override
-		protected void onDestroy() {
-			mBeemApplication.unbindBeemService();
-			super.onDestroy();
+		if (mRoster != null) {
+		    try {
+			mRoster.addConnectionListener(mRosterListener);
+		    } catch (RemoteException e) {
+			e.printStackTrace();
+		    }
 		}
-<<<<<<< local
 		callbackShowContactList();
 	    }
-	});
-	//TODO: a refaire
-	if (mSettings.getString(getString(R.string.PreferenceHostKey), "").equals(""))
-	    startActivityForResult(new Intent(ContactList.this, ContactListSettings.class), PREFERENCECHANGED);
+	});	
     }    
 
     @Override
@@ -109,8 +93,6 @@
 	mBeemApplication.unbindBeemService();
 	super.onDestroy();	
     }
-=======
->>>>>>> other
 
     private void callbackShowContactList() {
 	if (mRoster != null) {
@@ -173,22 +155,6 @@
 		mBeemApplication.stopBeemService();
 	    }
 	}
-<<<<<<< local
-    }
-
-    @Override
-    public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
-	Intent i = new Intent(ContactList.this, SendIM.class);
-	try {
-	    i.putExtra("contact", groupMap.get(groupName.get(groupPosition)).get(childPosition));
-	    startActivity(i);
-	    return true;
-	} catch (NullPointerException e) {
-	    Log.e(TAG, "Child not found", e);
-	    return false;
-	}
-=======
->>>>>>> other
     }
 
     private void buildContactList(List<Contact> listContact) {
@@ -259,7 +225,6 @@
 	}
 
 	void createDialog(Contact contact) {
-
 	    Dialog dialogContact= new ContactDialog(ContactList.this, contact);
 	    dialogContact.show();
 	}