--- a/src/com/beem/project/beem/ui/Login.java Sun Aug 09 23:42:22 2009 +0200
+++ b/src/com/beem/project/beem/ui/Login.java Sun Aug 09 23:58:06 2009 +0200
@@ -37,15 +37,15 @@
SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
}
- private final Handler connectionHandler = new Handler();
- private ProgressDialog progressDialog = null;
+ private final Handler mConnectionHandler = new Handler();
+ private ProgressDialog mProgressDialog = null;
private boolean mIsConnected = false;
private final ServiceConnection mServConn = new BeemServiceConnection();
- private IXmppFacade xmppFacade = null;
+ private IXmppFacade mXmppFacade = null;
- private SharedPreferences settings = null;
- private boolean isConfigured = false;
+ private SharedPreferences mSettings = null;
+ private boolean mIsConfigured = false;
private Button mButtonLogin = null;
@@ -71,7 +71,7 @@
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- settings = getSharedPreferences(getString(R.string.settings_filename), MODE_PRIVATE);
+ mSettings = getSharedPreferences(getString(R.string.settings_filename), MODE_PRIVATE);
setContentView(R.layout.login);
Button button = (Button) findViewById(R.id.log_as_settings);
button.setOnClickListener(new OnClickListener() {
@@ -91,13 +91,13 @@
}
});
- progressDialog = new ProgressDialog(this);
+ mProgressDialog = new ProgressDialog(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
- if (isConfigured && (mIsConnected || xmppFacade == null)) {
+ if (mIsConfigured && (mIsConnected || mXmppFacade == null)) {
unbindService(mServConn);
}
}
@@ -109,9 +109,9 @@
public void onStart() {
super.onStart();
Log.e("LOGIN", "BINDSERVICE");
- isConfigured = settings.getBoolean(getString(R.string.PreferenceIsConfigured), false);
+ mIsConfigured = mSettings.getBoolean(getString(R.string.PreferenceIsConfigured), false);
- if (isConfigured)
+ if (mIsConfigured)
bindService(Login.SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
else
mButtonLogin.setEnabled(false);
@@ -130,7 +130,7 @@
@Override
public void run() {
- progressDialog.setMessage(mErrorMsg);
+ mProgressDialog.setMessage(mErrorMsg);
}
}
@@ -139,10 +139,10 @@
public void connectionClosed() throws RemoteException {
Log.e("Login", "CONNECTIONCLOSED");
mIsConnected = false;
- if (xmppFacade != null) {
+ if (mXmppFacade != null) {
Login.this.unbindService(mServConn);
Login.this.stopService(SERVICE_INTENT);
- xmppFacade = null;
+ mXmppFacade = null;
}
}
@@ -156,18 +156,18 @@
public void connectionFailed(String errorMsg) throws RemoteException {
Log.e("Login", "CONNECTIONFAILLED");
mIsConnected = false;
- if (xmppFacade != null) {
+ if (mXmppFacade != null) {
Login.this.unbindService(mServConn);
Login.this.stopService(SERVICE_INTENT);
- xmppFacade = null;
+ mXmppFacade = null;
}
- connectionHandler.post(new ErrorRunnable(errorMsg));
+ mConnectionHandler.post(new ErrorRunnable(errorMsg));
dismissProgressDialog();
showToast(errorMsg);
}
private void showToast(final String errorMsg) {
- connectionHandler.post(new Runnable() {
+ mConnectionHandler.post(new Runnable() {
@Override
public void run() {
Toast.makeText(Login.this, errorMsg, Toast.LENGTH_LONG).show();
@@ -178,11 +178,11 @@
}
private void dismissProgressDialog() {
- connectionHandler.post(new Runnable() {
+ mConnectionHandler.post(new Runnable() {
@Override
public void run() {
- progressDialog.dismiss();
+ mProgressDialog.dismiss();
}
});
}
@@ -192,7 +192,7 @@
mIsConnected = true;
dismissProgressDialog();
Log.i(getString(R.string.login_tag), "Connected.");
- xmppFacade.changeStatus(Status.CONTACT_STATUS_AVAILABLE, null);
+ mXmppFacade.changeStatus(Status.CONTACT_STATUS_AVAILABLE, null);
startActivity(new Intent(Login.this, ContactList.class));
finish();
}
@@ -220,17 +220,17 @@
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mIsConnected = true;
- xmppFacade = IXmppFacade.Stub.asInterface(service);
+ mXmppFacade = IXmppFacade.Stub.asInterface(service);
try {
- xmppConnection = xmppFacade.createConnection();
+ xmppConnection = mXmppFacade.createConnection();
xmppConnection.addConnectionListener(new BeemConnectionListener());
if (!xmppConnection.isAuthentificated()) {
- connectionHandler.post(new Runnable() {
+ mConnectionHandler.post(new Runnable() {
@Override
public void run() {
- progressDialog.setMessage(getString(R.string.login_login_progress));
- progressDialog.show();
+ mProgressDialog.setMessage(getString(R.string.login_login_progress));
+ mProgressDialog.show();
}
});
Login.this.startService(Login.SERVICE_INTENT);
@@ -246,7 +246,7 @@
@Override
public void onServiceDisconnected(ComponentName name) {
mIsConnected = false;
- xmppFacade = null;
+ mXmppFacade = null;
}
}
--- a/src/com/beem/project/beem/ui/SendIM.java Sun Aug 09 23:42:22 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java Sun Aug 09 23:58:06 2009 +0200
@@ -66,7 +66,7 @@
private char mSpeak;
private final ServiceConnection mServConn = new BeemServiceConnection();
- private IXmppFacade xmppFacade;
+ private IXmppFacade mXmppFacade;
public IRoster mRoster;
private TextView mStatusText;
@@ -260,13 +260,13 @@
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
- xmppFacade = IXmppFacade.Stub.asInterface(service);
+ mXmppFacade = IXmppFacade.Stub.asInterface(service);
try {
if (mChatManager == null) {
- mChatManager = xmppFacade.getChatManager();
+ mChatManager = mXmppFacade.getChatManager();
mChatManager.addChatCreationListener(mChatManagerListener);
}
- mRoster = xmppFacade.getRoster();
+ mRoster = mXmppFacade.getRoster();
if (mRoster != null) {
mRoster.addRosterListener(mBeemRosterListener);
// mContact.setStatus(mRoster.getPresence(mContact.getJID()));
@@ -283,7 +283,7 @@
@Override
public void onServiceDisconnected(ComponentName name) {
- xmppFacade = null;
+ mXmppFacade = null;
try {
mRoster.removeRosterListener(mBeemRosterListener);
} catch (RemoteException e) {