Skip to content

Commit

Permalink
Issue #14: Formatting techniques in DisableAccountLoginConfirmation c…
Browse files Browse the repository at this point in the history
…lass
  • Loading branch information
joao18araujo committed May 3, 2016
1 parent d2f44d2 commit 4dafafe
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
/**
* A simple {@link Fragment} subclass.
*/
public class DisableAccountLoginConfirmation extends android.support.v4.app.Fragment implements View.OnClickListener {
public class DisableAccountLoginConfirmation extends android.support.v4.app.Fragment
implements View.OnClickListener {

private Activity homePage;

Expand All @@ -37,12 +38,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
// Inflate the layout for this fragment

homePage = getActivity();
View loginView = inflater.inflate(R.layout.fragment_disable_account_login_confirmation, container, false);
View loginView = inflater.inflate(R.layout.fragment_disable_account_login_confirmation,
container, false);

Button backButton = (Button) loginView.findViewById(R.id.button_back_id);
backButton.setOnClickListener(this);

Button disableButton = (Button) loginView.findViewById(R.id.button_disable_account_confirmation_id);
Button disableButton = (Button) loginView
.findViewById(R.id.button_disable_account_confirmation_id);
disableButton.setOnClickListener(this);

return loginView;
Expand All @@ -54,11 +57,13 @@ public void onClick(View view) {

FragmentActivity activity = this.getActivity();
FragmentManager fragmentManager = activity.getSupportFragmentManager();

switch (view.getId()) {
case R.id.button_back_id:
returnToConfigurationOptions(fragmentManager);
RemoveUserVIewMessages.showWelcomeBackMessage(activity.getBaseContext());
return;

break;

case R.id.button_disable_account_confirmation_id:
if(isLoginConfirmationValid()) {
Expand Down Expand Up @@ -108,11 +113,13 @@ private boolean isLoginConfirmationValid() {
} else {
passwordField.requestFocus();
passwordField.setError(loginValidation.getInvalidPasswordMessage());

isLoginConfirmationValid = false;
}
} else {
usernameField.requestFocus();
usernameField.setError(loginValidation.getInvalidUsernameMessage());

isLoginConfirmationValid = false;
}
return isLoginConfirmationValid;
Expand Down

0 comments on commit 4dafafe

Please sign in to comment.