merge with barbie
authorDa Risk <darisk972@gmail.com>
Wed, 22 Apr 2009 19:53:13 +0200
changeset 141 70ceaba725d4
parent 140 f36049828552 (current diff)
parent 117 40a48262a670 (diff)
child 142 f63bb1a2fa7c
merge with barbie
src/com/beem/project/beem/ui/SendIM.java
Binary file res/drawable/beem_sendim_header_1.png has changed
Binary file res/drawable/beem_sendim_textview.png has changed
--- a/res/layout/contactlistsettings.xml	Wed Apr 22 19:39:39 2009 +0200
+++ b/res/layout/contactlistsettings.xml	Wed Apr 22 19:53:13 2009 +0200
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="vertical" android:layout_width="fill_parent"
+	android:layout_height="fill_parent">
+<LinearLayout
 	android:orientation="vertical" android:layout_width="fill_parent"
 	android:layout_height="fill_parent">
 
@@ -104,4 +107,5 @@
 		<requestFocus />
 	</Button>
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
+</ScrollView>
\ No newline at end of file
--- a/res/layout/sendim.xml	Wed Apr 22 19:39:39 2009 +0200
+++ b/res/layout/sendim.xml	Wed Apr 22 19:53:13 2009 +0200
@@ -4,11 +4,10 @@
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent">
     
-    <RelativeLayout
-    	android:paddingLeft="10px"
-    	android:paddingRight="10px"
-    	android:paddingTop="10px"
-    	android:background="@color/blue_sky"
+    <LinearLayout
+    	android:paddingLeft="5px"
+    	android:paddingTop="5px"
+    	android:background="@drawable/beem_sendim_header_1"
     	android:orientation="horizontal"
 		android:layout_width="fill_parent"
 		android:layout_height="wrap_content">
@@ -17,26 +16,40 @@
     		android:layout_width="wrap_content"
     		android:layout_height="wrap_content"
 			android:src="@drawable/avatar"/>
-        
-        <TextView android:id="@+id/sendimlogin"
-        	android:layout_width="wrap_content"
-			android:layout_height="wrap_content"
-			android:layout_alignTop="@id/sendimavatar"
-			android:layout_toRightOf="@id/sendimavatar"
-        	android:hint="@string/SendIMLoginHint"/>
-    </RelativeLayout>
+			
+        <LinearLayout
+        	android:layout_width="fill_parent"
+        	android:layout_height="fill_parent"
+        	android:orientation="vertical">
+        	
+	        <TextView android:id="@+id/sendimlogin"
+	        	android:paddingLeft="15px"
+	        	android:layout_width="wrap_content"
+				android:layout_height="wrap_content"
+	        	android:hint="@string/SendIMLoginHint"/>
+	        	
+	        <TextView android:id="@+id/sendimstatus"
+	        	android:paddingLeft="20px"
+	        	android:layout_width="wrap_content"
+				android:layout_height="wrap_content"
+	        	android:hint="@string/SendIMNoStatusSet"/>
+        </LinearLayout>
+    </LinearLayout>
+    
 	<ScrollView
 		android:id="@+id/sendimscroll"
 		android:layout_width="fill_parent"
 		android:layout_height="fill_parent"
+		android:background="@drawable/beem_sendim_textview"
 		android:layout_weight="1">
 		
 		<TextView android:id="@+id/sendimlist"
-        	android:layout_width="fill_parent"
-        	android:layout_height="wrap_content"
+			android:paddingLeft="10px"
+	    	android:paddingRight="10px"
+	    	android:paddingTop="10px"
+	        android:layout_width="fill_parent"
+        	android:layout_height="fill_parent"
         	android:singleLine="false"/>
-        	<!--android:choiceMode="none"
-        	android:transcriptMode="alwaysScroll"-->
         	
     </ScrollView>
         
--- a/src/com/beem/project/beem/ui/SendIM.java	Wed Apr 22 19:39:39 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java	Wed Apr 22 19:53:13 2009 +0200
@@ -35,11 +35,8 @@
 
 public class SendIM extends Activity implements OnClickListener, OnKeyListener {
     private EditText mToSend;
-    // private ArrayList<String> mMessages = new ArrayList<String>();
-    // private ArrayAdapter<String> mAdapter;
     private SendIMDialogSmiley mSmyDialog;
     private SharedPreferences mSet;
-    private SharedPreferences mGlobalSettings;
     private BeemApplication mBeemApplication;
     private Handler mHandler;
     private IXmppFacade mService = null;
@@ -76,25 +73,24 @@
 	mToSend = (EditText) findViewById(R.id.userText);
 	mSet = getSharedPreferences("lol", MODE_PRIVATE);
 	mSmyDialog = new SendIMDialogSmiley(this, mSet);
-	mGlobalSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
-	/*
-	 * mAdapter = new ArrayAdapter<String>(this, R.layout.messagelist, mMessages); setListAdapter(mAdapter);
-	 */
-
 	mToSend.setOnClickListener(this);
 	mToSend.setOnKeyListener(this);
 	mLogin = (TextView) findViewById(R.id.sendimlogin);
+	mContact = getIntent().getParcelableExtra("contact");
+	setViewHeader();
 	mText = (TextView) findViewById(R.id.sendimlist);
 	mScrolling = (ScrollView) findViewById(R.id.sendimscroll);
     }
 
     private void setViewHeader() {
-	String status = mContact.getMsgState();
-	if (status == null)
-	    status = getString(R.string.SendIMNoStatusSet);
-	else
-	    status = mContact.getMsgState();
-	mLogin.setText(mContact.getJID() + "\n" + status);
+	mLogin = (TextView) findViewById(R.id.sendimlogin);
+	mLogin.setText(mContact.getJID());
+	TextView status = (TextView) findViewById(R.id.sendimstatus);
+	status.setTextSize(12);
+	mLogin.setTextColor(getResources().getColor(R.color.white));
+	String statmsg = mContact.getMsgState();
+	if (statmsg != null)
+	    status.setText(statmsg);
     }
 
     @Override
@@ -123,6 +119,7 @@
 		    mChat = mChatManager.createChat(mContact, mMessageListener);
 		    String text = mChat.getLastMessages();
 		    if (!"".equals(text)) {
+			mText.append(mContact.getJID() + " " + getString(R.string.SendIMSays));
 			mText.append(text);
 			mChat.clearLastMessages();
 		    }
@@ -137,11 +134,11 @@
 
     @Override
     protected void onStop() {
-        // TODO Auto-generated method stub
-        super.onStop();
-        mBeemApplication.unbindBeemService();
+	// TODO Auto-generated method stub
+	super.onStop();
+	mBeemApplication.unbindBeemService();
     }
-    
+
     @Override
     protected void onDestroy() {
 	super.onDestroy();
@@ -207,8 +204,9 @@
     }
 
     /**
-     * Callback for menu creation.
-     * @param menu the menu created
+     * Callback for menu creation. <<<<<<< local
+     * @param menu the menu created =======
+     * @param menu The created menu >>>>>>> other
      * @return true on success, false otherwise
      */
     @Override
@@ -235,7 +233,6 @@
 	@Override
 	public void chatCreated(IChat chat, boolean locally) throws RemoteException {
 	    Log.i("LOG", "chatCreated");
-
 	}
 
     }
@@ -244,13 +241,9 @@
 
 	@Override
 	public void processMessage(IChat chat, Message msg) throws RemoteException {
-	    Log.i("LOG", "processMessage");
-	    /*
-	     * mAdapter.add(mContact.getJID() + " " + getString(R.string.SendIMSays) + msg.getBody());
-	     */
+
 	    if (chat != mChat)
 		return;
-
 	    final Message m = msg;
 	    mHandler.post(new Runnable() {