Class et layout ChangeStatus pour bart + modification des layout pour gerer le mode paysage
authorPhilippe Lago <lago_p@epitech.net>
Tue, 21 Apr 2009 14:39:00 +0200
changeset 111 d0fab932cb6e
parent 110 f9be2a11c4c1
child 112 31be3d9613ef
child 126 8754e2f19c9c
Class et layout ChangeStatus pour bart + modification des layout pour gerer le mode paysage
res/layout/changestatus.xml
res/layout/contactlistsettings.xml
res/values/strings.xml
src/com/beem/project/beem/BeemApplication.java
src/com/beem/project/beem/ui/ChangeStatus.java
--- a/res/layout/changestatus.xml	Fri Apr 17 17:56:55 2009 +0200
+++ b/res/layout/changestatus.xml	Tue Apr 21 14:39:00 2009 +0200
@@ -31,7 +31,7 @@
 	   		android:layout_weight="1"
 	   		android:text="@string/OkButton"/>
 	   		
-		<Button android:id="@+id/ChangeStatusCancel"
+		<Button android:id="@+id/ChangeStatusClear"
 	   		android:layout_width="fill_parent"
 	   		android:layout_height="fill_parent"
 	   		android:layout_weight="1"
--- a/res/layout/contactlistsettings.xml	Fri Apr 17 17:56:55 2009 +0200
+++ b/res/layout/contactlistsettings.xml	Tue Apr 21 14:39:00 2009 +0200
@@ -13,26 +13,26 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="Host/Port:"
-                android:minWidth="70dp"
+                android:minWidth="90dp"
                 />
                 
         <EditText android:id="@+id/host"
-                  android:layout_width="wrap_content"
+                  android:layout_width="fill_parent"
                   android:layout_height="wrap_content"
                   android:singleLine="true"
                   android:textSize="16sp"
                   android:autoText="false"
                   android:capitalize="none"
-                  android:minWidth="150dp"
+                  android:layout_weight="2"
                   android:scrollHorizontally="true"/>
         <EditText android:id="@+id/port"
-                  android:layout_width="wrap_content"
+                  android:layout_width="fill_parent"
                   android:layout_height="wrap_content"
                   android:singleLine="true"
                   android:textSize="16sp"
                   android:autoText="false"
-                  android:minWidth="80dp"
                   android:capitalize="none"
+                  android:layout_weight="3"
                   android:scrollHorizontally="true"/>
     </LinearLayout>
 
@@ -45,15 +45,14 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="Userid:"
-                android:minWidth="70dp"
+                android:minWidth="90dp"
                 />
         <EditText android:id="@+id/userid"
-                  android:layout_width="wrap_content"
+                  android:layout_width="fill_parent"
                   android:layout_height="wrap_content"
                   android:singleLine="true"
                   android:textSize="16sp"
                   android:autoText="false"
-                  android:minWidth="250dp"
                   android:capitalize="none"
                   android:scrollHorizontally="true"/>
     </LinearLayout>
@@ -66,23 +65,23 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="Password:"
-                android:minWidth="70dp"
+                android:minWidth="90dp"
                 />
         <EditText android:id="@+id/password"
-                  android:layout_width="wrap_content"
+                  android:layout_width="fill_parent"
                   android:layout_height="wrap_content"
                   android:singleLine="true"
                   android:password="true"
                   android:textSize="16sp"
                   android:autoText="false"
-                  android:minWidth="250dp"
                   android:capitalize="none"
                   android:scrollHorizontally="true"/>
     </LinearLayout>
 
     <Button android:id="@+id/ok"
-            android:layout_width="fill_parent"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
             android:text="OK">
         <requestFocus/>
     </Button>
--- a/res/values/strings.xml	Fri Apr 17 17:56:55 2009 +0200
+++ b/res/values/strings.xml	Tue Apr 21 14:39:00 2009 +0200
@@ -8,14 +8,19 @@
 	
 	<string name="BeemJabberID">Jabber ID</string>
 	
+	<!--  BeemApplication class -->
+	
+	<string name="BeemApplicationConnect">Connecting...</string>
+	
 	<!--  BeemService class -->
+	
 	<string name="BeemServiceDescription">Use the Beem Service</string>
 	<string name="BeemServiceCreated">BeemService Created</string>
 	<string name="BeemServiceDestroyed">BeemService destroyed</string>
 
 	<!--  Preferences informations -->
+	
 	<string name="PreferenceFileName">Beem</string>
-	
 	<string name="PreferenceHostKey">host</string>
 	<string name="PreferenceJID">Jabber ID</string><string name="PreferenceLoginKey">login</string><string name="PreferencePasswordKey">password</string>
 	<string name="PreferencePortKey">port</string>
@@ -30,6 +35,7 @@
 	<string name="PreferenceProxyTypeSocks5">SOCKS5</string>
 
 	<!--  SendIM class -->
+
 	<string name="SendIMSays"> says :\n</string>
 	<string name="SendIMYouSay">You say :\n</string>
 	<string name="SendIMToSendHint">Tip text here</string>
@@ -40,6 +46,7 @@
 	<string name="SendIMNoStatusSet">No status set</string>
 	
 	<!--  ChangeStatus class -->
+
 	<string name="ChangeStatusText">Type here your status message :</string>
 
 </resources>
--- a/src/com/beem/project/beem/BeemApplication.java	Fri Apr 17 17:56:55 2009 +0200
+++ b/src/com/beem/project/beem/BeemApplication.java	Tue Apr 21 14:39:00 2009 +0200
@@ -95,8 +95,8 @@
 	mBeemApp.mActivity = activity;
 	mBeemApp.mProgressDialog = new ProgressDialog(activity);
 	mBeemApp.mProgressDialog.setTitle("Beem");
-	mBeemApp.mProgressDialog.setIcon(R.drawable.logo);
-	mBeemApp.mProgressDialog.setMessage("Connexion en cours");
+	//mBeemApp.mProgressDialog.setIcon(R.drawable.logo);
+	mBeemApp.mProgressDialog.setMessage("Connecting...");
 	mBeemApp.mApplicationContext = activity.getApplication();
 	mBeemApp.mPrivateResources = activity.getResources();
 	mBeemApp.onCreate();
@@ -215,8 +215,8 @@
 	 */
 	@Override
 	public void connectionClosedOnError() throws RemoteException {
-	    mBeemApp.mProgressDialog.setMessage("Connexion closed on error");
-	    Log.e(TAG,"onnectionClosedOnError");
+	    mBeemApp.mProgressDialog.setMessage("Connection closed on error");
+	    Log.e(TAG,"ConnectionClosedOnError");
 	    // TODO afficher une notification et reafficher le progress dialog
 	}
 
--- a/src/com/beem/project/beem/ui/ChangeStatus.java	Fri Apr 17 17:56:55 2009 +0200
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java	Tue Apr 21 14:39:00 2009 +0200
@@ -1,14 +1,21 @@
 package com.beem.project.beem.ui;
 
-import com.beem.project.beem.R;
-
 import android.app.Activity;
 import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
 import android.widget.ArrayAdapter;
+import android.widget.Button;
 import android.widget.Spinner;
+import android.widget.TextView;
+
+import com.beem.project.beem.R;
 
 public class ChangeStatus extends Activity {
     
+    private TextView mTextStatus;
+    private Button mOk;
+    private Button mClear;
     private static final String[] mStatus = {"Available for chat", "Available", "Busy", "Away",
 	"Unavailable", "Disconnected"};
     
@@ -18,10 +25,29 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.changestatus);
         
+        mTextStatus = (TextView) findViewById(R.id.ChangeStatusText);
+        mOk = (Button) findViewById(R.id.ChangeStatusOk);
+        mClear = (Button) findViewById(R.id.ChangeStatusClear);
+        mOk.setOnClickListener(mOnClickOk);
+        mClear.setOnClickListener(mOnClickClear);
+        
+        
         Spinner s1 = (Spinner) findViewById(R.id.ChangeStatusSpinner);
         ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_spinner_item, mStatus);
         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
         s1.setAdapter(adapter);
     }
+    
+    private OnClickListener mOnClickOk = new OnClickListener() {
+	public void onClick(View v) {
+
+	};
+    };
+    
+    private OnClickListener mOnClickClear = new OnClickListener() {
+	public void onClick(View v) {
+	    mTextStatus.setText(null);
+	};
+    };
 }