# HG changeset patch
# User marseille@marseille-desktop
# Date 1237584215 -3600
# Node ID 280112cd9602832f329dd935abfaf9191c54c36b
# Parent b9f4a0ef574a998479bba4999cdb41625cd0282e
Reorganisation des fichiers de linterface.
diff -r b9f4a0ef574a -r 280112cd9602 AndroidManifest.xml
--- a/AndroidManifest.xml Thu Mar 19 22:27:28 2009 +0100
+++ b/AndroidManifest.xml Fri Mar 20 22:23:35 2009 +0100
@@ -1,24 +1,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ package="com.beem.project.beem" android:versionCode="1"
+ android:versionName="1.0">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r b9f4a0ef574a -r 280112cd9602 src/com/beem/project/beem/Beem.java
--- a/src/com/beem/project/beem/Beem.java Thu Mar 19 22:27:28 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-package com.beem.project.beem;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.EditText;
-
-public class Beem extends Activity {
-
- private SharedPreferences mSettings;
-
- /**
- * Called when the activity is first created.
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
- showJID();
-
- Button btConnection = (Button) findViewById(R.id.connection);
- btConnection.setOnClickListener(new OnClickListener() {
-;
- @Override
- public void onClick(View v) {
- startActivity(new Intent(Beem.this, UIContactList.class));
- }
- });
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- super.onCreateOptionsMenu(menu);
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.account, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- SettingsDialog Dialog = new SettingsDialog(this, mSettings);
- switch (item.getItemId()) {
- case R.id.account_edit:
- Dialog.show();
- return true;
- case R.id.account_about:
- return true;
- }
- return false;
- }
-
- public void showJID() {
- EditText ejid = (EditText) findViewById(R.id.jid);
- String jid = mSettings.getString("login", "") +
- "@" + mSettings.getString("host", "") ;
- if (jid.length() == 1)
- jid = "Enter Jabber ID / Create New Account";
- ejid.setText(jid);
- }
-
-
-}
diff -r b9f4a0ef574a -r 280112cd9602 src/com/beem/project/beem/SettingsDialog.java
--- a/src/com/beem/project/beem/SettingsDialog.java Thu Mar 19 22:27:28 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-package com.beem.project.beem;
-
-import android.app.Dialog;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-
-/**
- *
- */
-public class SettingsDialog extends Dialog implements android.view.View.OnClickListener {
-
- private Beem mbeem;
- private SharedPreferences mSettings;
- public SettingsDialog(Beem beem, SharedPreferences settings) {
- super(beem);
- this.mbeem = beem;
- this.mSettings = settings;
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- setContentView(R.layout.settings);
- getWindow().setFlags(4, 4);
- setTitle("Jabber Account Settings");
- showSettings();
- Button ok = (Button) findViewById(R.id.ok);
- ok.setOnClickListener(this);
- }
-
- @Override
- public void onClick(View v) {
- SharedPreferences.Editor editor = mSettings.edit();
- Context ctx = getContext();
- editor.putString(ctx.getString(R.string.PreferenceHostKey), getWidgetText(R.id.host));
- editor.putString(ctx.getString(R.string.PreferencePortKey), getWidgetText(R.id.port));
- editor.putString(ctx.getString(R.string.PreferenceLoginKey), getWidgetText(R.id.userid));
- editor.putString(ctx.getString(R.string.PreferencePasswordKey), getWidgetText(R.id.password));
- editor.commit();
- this.mbeem.showJID();
- dismiss();
- }
-
- private void showSettings() {
- String tmp;
- EditText eHost = (EditText) findViewById(R.id.host);
- if ((tmp = mSettings.getString("host","")) != "")
- eHost.setText(tmp);
- EditText ePort = (EditText) findViewById(R.id.port);
- if ((tmp = mSettings.getString("port","")) != "")
- ePort.setText(tmp);
- EditText eLogin = (EditText) findViewById(R.id.userid);
- if ((tmp = mSettings.getString("login","")) != "")
- eLogin.setText(tmp);
- EditText ePwd = (EditText) findViewById(R.id.password);
- if ((tmp = mSettings.getString("password","")) != "")
- ePwd.setText(tmp);
- }
-
- private String getWidgetText(int id) {
- EditText widget = (EditText) this.findViewById(id);
- return widget.getText().toString();
- }
-}
diff -r b9f4a0ef574a -r 280112cd9602 src/com/beem/project/beem/UIContactList.java
--- a/src/com/beem/project/beem/UIContactList.java Thu Mar 19 22:27:28 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-package com.beem.project.beem;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.beem.project.beem.service.IXMPPFacade;
-
-import android.app.ExpandableListActivity;
-import android.content.ComponentName;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.os.Bundle;
-import android.os.IBinder;
-import android.util.Log;
-import android.widget.ExpandableListAdapter;
-import android.widget.SimpleExpandableListAdapter;
-
-public class UIContactList extends ExpandableListActivity {
-
- private IXMPPFacade mService = null;
-
- @Override
- public void onCreate(Bundle saveBundle) {
- super.onCreate(saveBundle);
- bindService(new Intent(this, BeemService.class), mConnection,
- BIND_AUTO_CREATE | BIND_DEBUG_UNBIND);
- showContactList();
- }
-
- private void showContactList() {
- ExpandableListAdapter Adapter;
- List