Skip to content

Commit

Permalink
Merge pull request #19 from ngageoint/develop
Browse files Browse the repository at this point in the history
Hide signup
  • Loading branch information
newmanw committed Dec 4, 2015
2 parents 209289c + a51fcfd commit 4b56ca1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
18 changes: 8 additions & 10 deletions mage/src/main/java/mil/nga/giat/mage/login/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,16 @@ public void togglePassword(View v) {
}

private void configureLogin() {
boolean noServer = StringUtils.isEmpty(mServerURL.getText());
findViewById(R.id.login_form).setVisibility(noServer ? View.GONE : View.VISIBLE);
findViewById(R.id.server_configuration).setVisibility(noServer ? View.VISIBLE : View.GONE);

PreferenceHelper preferenceHelper = PreferenceHelper.getInstance(getApplicationContext());

boolean noServer = StringUtils.isEmpty(mServerURL.getText());
boolean localAuthentication = preferenceHelper.containsLocalAuthentication();
boolean googleAuthentication = preferenceHelper.containsGoogleAuthentication();

if (localAuthentication && googleAuthentication) {
findViewById(R.id.or).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.or).setVisibility(View.GONE);
}
findViewById(R.id.login_form).setVisibility(noServer ? View.GONE : View.VISIBLE);
findViewById(R.id.server_configuration).setVisibility(noServer ? View.VISIBLE : View.GONE);
findViewById(R.id.or).setVisibility(localAuthentication && googleAuthentication ? View.VISIBLE : View.GONE);
findViewById(R.id.sign_up).setVisibility(localAuthentication || googleAuthentication ? View.VISIBLE : View.GONE);

if (localAuthentication) {
Button localButton = (Button) findViewById(R.id.local_login_button);
Expand Down Expand Up @@ -332,7 +329,8 @@ public void onClick(View view) {
@Override
public boolean apply(Exception e) {
if (e == null) {
mServerURL.setText(serverURL);
getServerUrlText().setText(serverURL);
getServerUrlText().setError(null);
mLoginButton.setEnabled(true);
serverEditText.setError(null);
alertDialog.dismiss();
Expand Down
1 change: 1 addition & 0 deletions mage/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
</LinearLayout>

<LinearLayout
android:id="@+id/sign_up"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="40dip"
Expand Down

0 comments on commit 4b56ca1

Please sign in to comment.