commit 038ac9a43462d7854d2e0b51794d1c8be25ae793
Author: koutsoub <koutsoub@gmail.com>
Date:   Wed Dec 21 15:21:28 2011 +0200

    source formatting

diff --git a/src/com/rackspacecloud/android/CreatePasswordActivity.java b/src/com/rackspacecloud/android/CreatePasswordActivity.java
index 428e805..85de7b4 100644
--- a/src/com/rackspacecloud/android/CreatePasswordActivity.java
+++ b/src/com/rackspacecloud/android/CreatePasswordActivity.java
@@ -32,8 +32,7 @@ public class CreatePasswordActivity extends GaActivity {
 	private void restoreState(Bundle state) {
 		if (state != null && state.containsKey("isChecked")) {
 			isChecked = state.getBoolean("isChecked");
-		}
-		else{
+		} else {
 			isChecked = hadPassword();
 		}
 		setUpWidgets();
@@ -49,7 +48,7 @@ public class CreatePasswordActivity extends GaActivity {
 		setUpCheckBox();
 		passwordText = (EditText) findViewById(R.id.password_edittext);
 		confirmText = (EditText) findViewById(R.id.confirm_edittext);
-		if(!passwordCheckBox.isChecked()){
+		if (!passwordCheckBox.isChecked()) {
 			passwordText.setEnabled(false);
 			confirmText.setEnabled(false);
 		}
@@ -72,11 +71,9 @@ public class CreatePasswordActivity extends GaActivity {
 		});
 	}
 
-
 	/*
-	 * sets up submit button to deal with each
-	 * case of starting having/not having a password
-	 * and ending with having/not having a password
+	 * sets up submit button to deal with each case of starting having/not
+	 * having a password and ending with having/not having a password
 	 */
 	private void setUpSubmit() {
 		submitPassword = (Button) findViewById(R.id.create_password_button);
@@ -89,18 +86,18 @@ public class CreatePasswordActivity extends GaActivity {
 				// didnt have password before and does now
 				else if (!hadPassword() && willHavePassword()) {
 					if (passwordsMatch()) {
-						if(validInputs()){
-							pwManager.changePassword(passwordText.getText().toString());
+						if (validInputs()) {
+							pwManager.changePassword(passwordText.getText()
+									.toString());
 							showToast("Password has been enabled.");
 							finish();
-						}
-						else{
+						} else {
 							showAlert("Missing Field",
-							"Password and confirmation are required.");
+									"Password and confirmation are required.");
 						}
 					} else {
 						showAlert("Passwords must match",
-						"Password and confirmation did not match. Try again.");
+								"Password and confirmation did not match. Try again.");
 					}
 				} else if (hadPassword()) {
 					showDialog(R.id.create_password_button);
@@ -111,89 +108,94 @@ public class CreatePasswordActivity extends GaActivity {
 	}
 
 	/*
-	 * handles the case where the was a password before
-	 * the user will need to enter the old password
-	 * in order to make any changes
+	 * handles the case where the was a password before the user will need to
+	 * enter the old password in order to make any changes
 	 */
 	@Override
 	protected Dialog onCreateDialog(int id) {
 		switch (id) {
-		case R.id.create_password_button:		
+		case R.id.create_password_button:
 			final EditText input = new EditText(this);
 			input.setInputType(android.text.InputType.TYPE_CLASS_TEXT
 					| android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD);
 			input.setText("");
 			input.setMaxWidth(10);
 			return new AlertDialog.Builder(CreatePasswordActivity.this)
-			.setIcon(R.drawable.alert_dialog_icon)
-			.setView(input)
-			.setTitle("Verification Required")
-			.setMessage("Enter your old password: ")
-			.setPositiveButton("Submit",
-					new DialogInterface.OnClickListener() {
-				public void onClick(DialogInterface dialog,
-						int whichButton) {
-					// had password before and doesnt now
-					if (!willHavePassword()) {
-						if (pwManager.verifyEnteredPassword(input.getText().toString())) {
-							pwManager.turnOffPassword();
-							showToast("Password has been disabled.");
-							finish();
-						} else {
-							showAlert("Problem with password",
-							"The entered password was incorrect");
-							passwordCheckBox.setChecked(true);
-							passwordText.setEnabled(true);
-							confirmText.setEnabled(true);
-						}
-					}
-					// had a password and still has one
-					else {
-						if (pwManager.verifyEnteredPassword(input.getText().toString())) {
-							if (passwordsMatch()) {
-								if(validInputs()){
-									pwManager.changePassword(passwordText.getText().toString());
-									showToast("Password has been changed.");
-									finish();
+					.setIcon(R.drawable.alert_dialog_icon)
+					.setView(input)
+					.setTitle("Verification Required")
+					.setMessage("Enter your old password: ")
+					.setPositiveButton("Submit",
+							new DialogInterface.OnClickListener() {
+								public void onClick(DialogInterface dialog,
+										int whichButton) {
+									// had password before and doesnt now
+									if (!willHavePassword()) {
+										if (pwManager
+												.verifyEnteredPassword(input
+														.getText().toString())) {
+											pwManager.turnOffPassword();
+											showToast("Password has been disabled.");
+											finish();
+										} else {
+											showAlert("Problem with password",
+													"The entered password was incorrect");
+											passwordCheckBox.setChecked(true);
+											passwordText.setEnabled(true);
+											confirmText.setEnabled(true);
+										}
+									}
+									// had a password and still has one
+									else {
+										if (pwManager
+												.verifyEnteredPassword(input
+														.getText().toString())) {
+											if (passwordsMatch()) {
+												if (validInputs()) {
+													pwManager
+															.changePassword(passwordText
+																	.getText()
+																	.toString());
+													showToast("Password has been changed.");
+													finish();
+												} else {
+													showAlert("Missing Field",
+															"Password and confirmation are required.");
+												}
+											} else {
+												showAlert(
+														"Passwords must match",
+														"Password and confirmation did not match. Try again.");
+											}
+
+										} else {
+											showAlert("Problem with password",
+													"The entered password was incorrect");
+											passwordCheckBox.setChecked(true);
+											passwordText.setEnabled(true);
+											confirmText.setEnabled(true);
+										}
+									}
 								}
-								else{
-									showAlert("Missing Field",
-									"Password and confirmation are required.");
+							})
+					.setNegativeButton("Cancel",
+							new DialogInterface.OnClickListener() {
+								public void onClick(DialogInterface dialog,
+										int whichButton) {
+									removeDialog(R.id.create_password_button);
+									// passwordCheckBox.setChecked(true);
 								}
-							} else {
-								showAlert("Passwords must match",
-								"Password and confirmation did not match. Try again.");
-							}
-
-						} else {
-							showAlert("Problem with password",
-							"The entered password was incorrect");
-							passwordCheckBox.setChecked(true);
-							passwordText.setEnabled(true);
-							confirmText.setEnabled(true);
-						}
-					}
-				}
-			})
-			.setNegativeButton("Cancel",
-					new DialogInterface.OnClickListener() {
-				public void onClick(DialogInterface dialog,
-						int whichButton) {
-					removeDialog(R.id.create_password_button);
-					//passwordCheckBox.setChecked(true);
-				}
-			}).create();
+							}).create();
 		}
 		return null;
 	}
 
-
 	/*
 	 * must ensure that the passwords are the same before you can submit
 	 */
 	private boolean passwordsMatch() {
 		return passwordText.getText().toString()
-		.equals(confirmText.getText().toString());
+				.equals(confirmText.getText().toString());
 	}
 
 	private boolean willHavePassword() {
@@ -201,20 +203,18 @@ public class CreatePasswordActivity extends GaActivity {
 	}
 
 	/*
-	 * returns true if application required a 
-	 * password before current edit
+	 * returns true if application required a password before current edit
 	 */
-	private boolean hadPassword(){
+	private boolean hadPassword() {
 		return pwManager.hasPassword();
 	}
 
 	/*
-	 * checks that when the user submits
-	 * the password fields are not empty
+	 * checks that when the user submits the password fields are not empty
 	 */
-	private boolean validInputs(){
-		return !passwordText.getText().toString().equals("") 
-		|| !confirmText.getText().toString().equals("");
+	private boolean validInputs() {
+		return !passwordText.getText().toString().equals("")
+				|| !confirmText.getText().toString().equals("");
 	}
 
 	private void showToast(String message) {
