--- a/AndroidManifest.xml Wed Apr 22 00:22:58 2009 +0200
+++ b/AndroidManifest.xml Wed Apr 22 19:39:39 2009 +0200
@@ -10,7 +10,8 @@
<category android:name="android.intent.category.ACCOUNT_CREATE" />
</intent-filter>
</activity>
- <activity android:name=".ui.ContactListSettings" android:label="@string/app_name" />
+ <activity android:name=".ui.ContactListSettings"
+ android:label="@string/app_name" />
<activity android:name=".ui.SendIM" android:label="@string/app_name" />
<activity android:name=".ui.ChangeStatus" android:label="@string/app_name" />
<activity android:name=".ui.AccountCreation" android:label="@string/app_name" />
--- a/default.properties Wed Apr 22 00:22:58 2009 +0200
+++ b/default.properties Wed Apr 22 19:39:39 2009 +0200
@@ -7,6 +7,8 @@
# "build.properties", and override values to adapt the script to your
# project structure.
+# Project target.
+target=android-3
# apk configurations. This property allows creation of APK files with limited
# resources. For example, if your application contains many locales and
# you wish to release multiple smaller apks instead of a large one, you can
@@ -18,5 +20,3 @@
# apk-config-european=en,fr,it,de,es
# apk-config-northamerica=en,es
apk-configurations=
-# Project target.
-target=android-3
--- a/res/layout/contactlistsettings.xml Wed Apr 22 00:22:58 2009 +0200
+++ b/res/layout/contactlistsettings.xml Wed Apr 22 19:39:39 2009 +0200
@@ -1,88 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Host/Port:"
- android:minWidth="90dp"
- />
-
- <EditText android:id="@+id/host"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textSize="16sp"
- android:autoText="false"
- android:capitalize="none"
- android:layout_weight="2"
- android:scrollHorizontally="true"/>
- <EditText android:id="@+id/port"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textSize="16sp"
- android:autoText="false"
- android:capitalize="none"
- android:layout_weight="3"
- android:scrollHorizontally="true"/>
- </LinearLayout>
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <TextView android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:text="Server connection"
+ android:textSize="18sp" />
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:text="Host/Port:"
+ android:minWidth="90dp" android:textSize="14sp" />
+ <EditText android:id="@+id/host" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:singleLine="true"
+ android:textSize="14sp" android:autoText="false" android:capitalize="none"
+ android:layout_weight="2" android:scrollHorizontally="true" />
+ <EditText android:id="@+id/port" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:singleLine="true"
+ android:textSize="14sp" android:autoText="false" android:capitalize="none"
+ android:layout_weight="3" android:scrollHorizontally="true" />
+ </LinearLayout>
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:text="Userid:"
+ android:minWidth="90dp" android:textSize="14sp" />
+ <EditText android:id="@+id/userid" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:singleLine="true"
+ android:textSize="14sp" android:autoText="false" android:capitalize="none"
+ android:scrollHorizontally="true" />
+ </LinearLayout>
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:text="Password:"
+ android:minWidth="90dp" android:textSize="14sp" />
+ <EditText android:id="@+id/password" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:singleLine="true"
+ android:password="true" android:textSize="14sp" android:autoText="false"
+ android:capitalize="none" android:scrollHorizontally="true" />
+ </LinearLayout>
+
+ <Spinner android:id="@+id/proxy_type" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Userid:"
- android:minWidth="90dp"
- />
- <EditText android:id="@+id/userid"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textSize="16sp"
- android:autoText="false"
- android:capitalize="none"
- android:scrollHorizontally="true"/>
- </LinearLayout>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Password:"
- android:minWidth="90dp"
- />
- <EditText android:id="@+id/password"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:password="true"
- android:textSize="16sp"
- android:autoText="false"
- android:capitalize="none"
- android:scrollHorizontally="true"/>
- </LinearLayout>
+ <LinearLayout android:id="@+id/proxy_layout"
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+
+ <TextView android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:text="Proxy informations"
+ android:textSize="18sp" />
+
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:text="Host/Port:"
+ android:minWidth="90dp" android:textSize="14sp" />
+ <EditText android:id="@+id/proxy_host" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:singleLine="true"
+ android:textSize="14sp" android:autoText="false" android:capitalize="none"
+ android:layout_weight="2" android:scrollHorizontally="true" />
+ <EditText android:id="@+id/proxy_port" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:singleLine="true"
+ android:textSize="14sp" android:autoText="false" android:capitalize="none"
+ android:layout_weight="3" android:scrollHorizontally="true" />
+ </LinearLayout>
- <Button android:id="@+id/ok"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="OK">
- <requestFocus/>
- </Button>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:text="Login :"
+ android:minWidth="90dp" android:textSize="14sp" />
+ <EditText android:id="@+id/proxy_login"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:singleLine="true" android:textSize="14sp" android:autoText="false"
+ android:capitalize="none" android:scrollHorizontally="true" />
+ </LinearLayout>
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:text="Password:"
+ android:minWidth="90dp" android:textSize="14sp" />
+ <EditText android:id="@+id/proxy_pwd" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:singleLine="true"
+ android:password="true" android:textSize="14sp" android:autoText="false"
+ android:capitalize="none" android:scrollHorizontally="true" />
+ </LinearLayout>
+ </LinearLayout>
+
+ <Button android:id="@+id/ok" android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:layout_gravity="center_horizontal"
+ android:text="OK">
+ <requestFocus />
+ </Button>
+
</LinearLayout>
\ No newline at end of file
--- a/res/values/strings.xml Wed Apr 22 00:22:58 2009 +0200
+++ b/res/values/strings.xml Wed Apr 22 19:39:39 2009 +0200
@@ -22,7 +22,9 @@
<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="PreferenceJID">Jabber ID</string>
+ <string name="PreferenceLoginKey">login</string>
+ <string name="PreferencePasswordKey">password</string>
<string name="PreferencePortKey">port</string>
<string name="PreferenceProxyHost">proxy_host</string>
<string name="PreferenceProxyPort">proxy_port</string>
@@ -30,9 +32,12 @@
<string name="PreferenceProxyType">proxy_type</string>
<string name="PreferenceProxyUser">proxy_user</string>
<string name="PreferenceProxyPassword">proxy_password</string>
+ <string name="PreferenceProxyTypeNone">None</string>
<string name="PreferenceProxyTypeHttp">HTTP</string>
<string name="PreferenceProxyTypeSocks4">SOCKS4</string>
<string name="PreferenceProxyTypeSocks5">SOCKS5</string>
+ <string name="PreferenceStatus">status</string>
+ <string name="PreferenceStatusText">status_text</string>
<!-- SendIM class -->
@@ -48,7 +53,10 @@
<!-- ChangeStatus class -->
<string name="ChangeStatusText">Type here your status message :</string>
-
+
<string name="MenuAddContact">Add new contact</string>
+ <string name="ChangeStatusOk">Updating status</string>
+ <string name="ChangeStatusNoChange">Nothing to change</string>
+
</resources>
--- a/src/com/beem/project/beem/BeemService.java Wed Apr 22 00:22:58 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java Wed Apr 22 19:39:39 2009 +0200
@@ -78,6 +78,7 @@
mLogin = mSettings.getString(getString(R.string.PreferenceLoginKey), "");
mPassword = mSettings.getString(getString(R.string.PreferencePasswordKey), "");
mHost = mSettings.getString(getString(R.string.PreferenceHostKey), "");
+ // TODO penser a commenter
mHost = "10.0.2.2";
initConnectionConfig();
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
@@ -129,7 +130,7 @@
String phost = mSettings.getString(getString(R.string.PreferenceProxyHost), "");
String puser = mSettings.getString(getString(R.string.PreferenceProxyUser), "");
String ppass = mSettings.getString(getString(R.string.PreferenceProxyPassword), "");
- int pport = mSettings.getInt(getString(R.string.PreferenceProxyPort), 3128);
+ int pport = mSettings.getInt(getString(R.string.PreferenceProxyPort), 1080);
ProxyInfo.ProxyType type = ProxyType.valueOf(stype);
mProxyInfo = new ProxyInfo(type, phost, pport, puser, ppass);
mConnectionConfiguration = new ConnectionConfiguration(mHost, mProxyInfo);
--- a/src/com/beem/project/beem/ui/ChangeStatus.java Wed Apr 22 00:22:58 2009 +0200
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java Wed Apr 22 19:39:39 2009 +0200
@@ -1,26 +1,35 @@
package com.beem.project.beem.ui;
import android.app.Activity;
+
import android.content.Intent;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
+
import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.AdapterView.OnItemSelectedListener;
import com.beem.project.beem.BeemApplication;
import com.beem.project.beem.BeemService;
import com.beem.project.beem.R;
+
import com.beem.project.beem.service.aidl.IXmppFacade;
import com.beem.project.beem.utils.Status;
public class ChangeStatus extends Activity {
-
- private TextView mTextStatus;
+ private TextView mStatusText;
private Button mOk;
private Button mClear;
private Handler mHandler;
@@ -35,6 +44,10 @@
private static final int BUSY_IDX = 2;
private static final int AWAY_IDX = 3;
private static final int UNAVAILABLE_IDX = 4;
+ private SharedPreferences mSettings;
+ private ArrayAdapter<String> mAdapter;
+ private Context mContext = this;
+ private Toast mToast;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -45,16 +58,19 @@
mHandler = new Handler();
mBeemApplication = BeemApplication.getApplication(this);
- mTextStatus = (TextView) findViewById(R.id.ChangeStatusText);
+ mStatusText = (TextView) findViewById(R.id.ChangeStatusText);
mOk = (Button) findViewById(R.id.ChangeStatusOk);
mClear = (Button) findViewById(R.id.ChangeStatusClear);
mOk.setOnClickListener(mOnClickOk);
- mClear.setOnClickListener(mOnClickClear);
+ mClear.setOnClickListener(mOnClickOk);
+ mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
mSpinner = (Spinner) findViewById(R.id.ChangeStatusSpinner);
- ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, STATUS);
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- mSpinner.setAdapter(adapter);
+ mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, STATUS);
+ mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ mSpinner.setAdapter(mAdapter);
+ mToast = Toast.makeText(mContext, R.string.ChangeStatusOk, Toast.LENGTH_LONG);
+ showSettings();
}
@Override
@@ -73,44 +89,17 @@
}
});
}
-
+
@Override
protected void onDestroy() {
- super.onDestroy();
- mBeemApplication.unbindBeemService();
+ super.onDestroy();
+ mBeemApplication.unbindBeemService();
}
- private OnClickListener mOnClickOk = new OnClickListener() {
- public void onClick(View v) {
- if (v == mOk) {
- String selected = (String) mSpinner.getSelectedItem();
- if (selected != null) {
- CharSequence msg = mTextStatus.getText();
- int status = getStatusForService(selected);
- if (status == Status.CONTACT_STATUS_DISCONNECT) {
- stopService(new Intent(ChangeStatus.this, BeemService.class));
- } else
- try {
- mService.changeStatus(status, msg.toString());
-
- } catch (RemoteException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- ChangeStatus.this.finish();
- }
- } else if (v == mClear) {
- mTextStatus.setText(null);
- }
-
- };
- };
-
- private OnClickListener mOnClickClear = new OnClickListener() {
- public void onClick(View v) {
- mTextStatus.setText(null);
- };
- };
+ private void showSettings() {
+ mStatusText.setText(getPreferenceString(R.string.PreferenceStatusText));
+ mSpinner.setSelection(getPreferenceStatusIndex());
+ }
private int getStatusForService(String item) {
int res = Status.CONTACT_STATUS_AVAILABLE;
@@ -138,4 +127,53 @@
}
return res;
}
+
+ private String getPreferenceString(int id) {
+ return mSettings.getString(getString(id), "");
+ }
+
+ private int getPreferenceStatusIndex() {
+ return mSettings.getInt(getString(R.string.PreferenceStatus), 0);
+ }
+
+
+ private OnClickListener mOnClickOk = new OnClickListener() {
+
+ private boolean textHasChanged() {
+ return (!mStatusText.getText().toString().equals(getPreferenceString(R.string.PreferenceStatusText)));
+ }
+
+ private boolean statusHasChanged() {
+ return (mSettings.getInt(getString(R.string.PreferenceStatus), 0) != mSpinner.getSelectedItemPosition());
+ }
+
+ public void onClick(View v) {
+ if (v == mOk) {
+ if (textHasChanged() || statusHasChanged()) {
+ String msg = mStatusText.getText().toString();
+ int status = getStatusForService( (String) mSpinner.getSelectedItem());
+ Editor edit = mSettings.edit();
+ edit.putString(getString(R.string.PreferenceStatusText), msg);
+ edit.putInt(getString(R.string.PreferenceStatus), mSpinner.getSelectedItemPosition());
+ edit.commit();
+ if (status == Status.CONTACT_STATUS_DISCONNECT) {
+ stopService(new Intent(ChangeStatus.this, BeemService.class));
+ } else {
+ try {
+ mService.changeStatus(status, msg.toString());
+ } catch (RemoteException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ mToast.show();
+ }
+ }
+ ChangeStatus.this.finish();
+ } else if (v == mClear) {
+ mStatusText.setText(null);
+ }
+
+ }
+ };
+
}
--- a/src/com/beem/project/beem/ui/ContactListSettings.java Wed Apr 22 00:22:58 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactListSettings.java Wed Apr 22 19:39:39 2009 +0200
@@ -1,62 +1,125 @@
package com.beem.project.beem.ui;
import android.app.Activity;
+import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
+import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.AdapterView.OnItemSelectedListener;
import com.beem.project.beem.R;
public class ContactListSettings extends Activity {
public static final int CHANGE = 1;
+ private boolean mIsChanged = false;
private SharedPreferences mSettings;
+ private String[] mProxyTypeString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.contactlistsettings);
- mSettings = getSharedPreferences(
- getString(R.string.PreferenceFileName), MODE_PRIVATE);
+
+ String TypeNone = getString(R.string.PreferenceProxyTypeNone);
+ String TypeHTTP = getString(R.string.PreferenceProxyTypeHttp);
+ String TypeSocks4 = getString(R.string.PreferenceProxyTypeSocks4);
+ String TypeSocks5 = getString(R.string.PreferenceProxyTypeSocks5);
+
+ mProxyTypeString = new String[] { TypeNone, TypeHTTP, TypeSocks4, TypeSocks5 };
+ mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
+
+ Spinner sp = (Spinner) findViewById(R.id.proxy_type);
+ ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,
+ mProxyTypeString);
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ sp.setAdapter(adapter);
+ for (int i = 0; i < mProxyTypeString.length; ++i)
+ if (mProxyTypeString[i].equals(getPreferenceString(R.string.PreferenceProxyType)))
+ sp.setSelection(i);
+ sp.setOnItemSelectedListener(mProxyType);
+
showSettings();
Button ok = (Button) findViewById(R.id.ok);
ok.setOnClickListener(mOkListener);
}
- private OnClickListener mOkListener = new OnClickListener() {
- public void onClick(View v) {
- boolean b = false;
+ private OnItemSelectedListener mProxyType = new OnItemSelectedListener() {
+
+ @Override
+ public void onItemSelected(AdapterView<?> parent, View arg1, int arg2, long arg3) {
+ String value = parent.getSelectedItem().toString();
+ LinearLayout ll = (LinearLayout) findViewById(R.id.proxy_layout);
SharedPreferences.Editor editor = mSettings.edit();
+ if (value.equals(getString(R.string.PreferenceProxyTypeNone))) {
+ ll.setVisibility(LinearLayout.INVISIBLE);
+ editor.putBoolean(getString(R.string.PreferenceUseProxy), false);
+ } else {
+ ll.setVisibility(LinearLayout.VISIBLE);
+ editor.putBoolean(getString(R.string.PreferenceUseProxy), true);
+ }
+ if (!value.equals(getPreferenceString(R.string.PreferenceProxyType))) {
+ editor.putString(getString(R.string.PreferenceProxyType), value);
+ mIsChanged = true;
+ }
+ editor.commit();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> arg0) {
+ }
+
+ };
+
+ private OnClickListener mOkListener = new OnClickListener() {
+ public void onClick(View v) {
+ SharedPreferences.Editor editor = mSettings.edit();
+
if (isChanged(R.id.host, R.string.PreferenceHostKey)) {
- editor.putString(
- getString(R.string.PreferenceHostKey),
- getWidgetText(R.id.host));
- b = true;
+ editor.putString(getString(R.string.PreferenceHostKey), getWidgetText(R.id.host));
+ mIsChanged = true;
}
if (isChanged(R.id.port, R.string.PreferencePortKey)) {
- editor.putString(
- getString(R.string.PreferencePortKey),
- getWidgetText(R.id.port));
- b = true;
+ editor.putString(getString(R.string.PreferencePortKey), getWidgetText(R.id.port));
+ mIsChanged = true;
}
if (isChanged(R.id.userid, R.string.PreferenceLoginKey)) {
- editor.putString(
- getString(R.string.PreferenceLoginKey),
- getWidgetText(R.id.userid));
- b = true;
+ editor.putString(getString(R.string.PreferenceLoginKey), getWidgetText(R.id.userid));
+ mIsChanged = true;
}
if (isChanged(R.id.password, R.string.PreferencePasswordKey)) {
- editor.putString(
- getString(R.string.PreferencePasswordKey),
- getWidgetText(R.id.password));
- b = true;
+ editor.putString(getString(R.string.PreferencePasswordKey), getWidgetText(R.id.password));
+ mIsChanged = true;
}
- if (b == true) {
+ if (isChanged(R.id.proxy_host, R.string.PreferenceProxyHost)) {
+ editor.putString(getString(R.string.PreferenceProxyHost), getWidgetText(R.id.proxy_host));
+ mIsChanged = true;
+ }
+ if (Integer.parseInt(getWidgetText(R.id.proxy_port)) != mSettings.getInt(getString(R.string.PreferenceProxyPort), 1080) ) {
+ editor.putInt(getString(R.string.PreferenceProxyPort), Integer.parseInt(getWidgetText(R.id.proxy_port)));
+ mIsChanged = true;
+ }
+ if (isChanged(R.id.proxy_login, R.string.PreferenceProxyUser)) {
+ editor.putString(getString(R.string.PreferenceProxyUser), getWidgetText(R.id.proxy_login));
+ mIsChanged = true;
+ }
+ if (isChanged(R.id.proxy_pwd, R.string.PreferenceProxyPassword)) {
+ editor.putString(getString(R.string.PreferenceProxyPassword), getWidgetText(R.id.proxy_pwd));
+ mIsChanged = true;
+ }
+
+ if (mIsChanged == true) {
editor.commit();
setResult(RESULT_OK);
} else
@@ -78,6 +141,15 @@
e.setText(getPreferenceString(R.string.PreferenceLoginKey));
e = (EditText) findViewById(R.id.password);
e.setText(getPreferenceString(R.string.PreferencePasswordKey));
+
+ e = (EditText) findViewById(R.id.proxy_host);
+ e.setText(getPreferenceString(R.string.PreferenceProxyHost));
+ e = (EditText) findViewById(R.id.proxy_port);
+ e.setText(String.valueOf(mSettings.getInt(getString(R.string.PreferenceProxyPort), 1080)));
+ e = (EditText) findViewById(R.id.proxy_login);
+ e.setText(getPreferenceString(R.string.PreferenceProxyUser));
+ e = (EditText) findViewById(R.id.proxy_pwd);
+ e.setText(getPreferenceString(R.string.PreferenceProxyPassword));
}
private String getWidgetText(int id) {