Skip to content

Commit 4b56ca1

Browse files
committed
Merge pull request #19 from ngageoint/develop
Hide signup
2 parents 209289c + a51fcfd commit 4b56ca1

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

mage/src/main/java/mil/nga/giat/mage/login/LoginActivity.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,16 @@ public void togglePassword(View v) {
212212
}
213213

214214
private void configureLogin() {
215-
boolean noServer = StringUtils.isEmpty(mServerURL.getText());
216-
findViewById(R.id.login_form).setVisibility(noServer ? View.GONE : View.VISIBLE);
217-
findViewById(R.id.server_configuration).setVisibility(noServer ? View.VISIBLE : View.GONE);
218-
219215
PreferenceHelper preferenceHelper = PreferenceHelper.getInstance(getApplicationContext());
216+
217+
boolean noServer = StringUtils.isEmpty(mServerURL.getText());
220218
boolean localAuthentication = preferenceHelper.containsLocalAuthentication();
221219
boolean googleAuthentication = preferenceHelper.containsGoogleAuthentication();
222220

223-
if (localAuthentication && googleAuthentication) {
224-
findViewById(R.id.or).setVisibility(View.VISIBLE);
225-
} else {
226-
findViewById(R.id.or).setVisibility(View.GONE);
227-
}
221+
findViewById(R.id.login_form).setVisibility(noServer ? View.GONE : View.VISIBLE);
222+
findViewById(R.id.server_configuration).setVisibility(noServer ? View.VISIBLE : View.GONE);
223+
findViewById(R.id.or).setVisibility(localAuthentication && googleAuthentication ? View.VISIBLE : View.GONE);
224+
findViewById(R.id.sign_up).setVisibility(localAuthentication || googleAuthentication ? View.VISIBLE : View.GONE);
228225

229226
if (localAuthentication) {
230227
Button localButton = (Button) findViewById(R.id.local_login_button);
@@ -332,7 +329,8 @@ public void onClick(View view) {
332329
@Override
333330
public boolean apply(Exception e) {
334331
if (e == null) {
335-
mServerURL.setText(serverURL);
332+
getServerUrlText().setText(serverURL);
333+
getServerUrlText().setError(null);
336334
mLoginButton.setEnabled(true);
337335
serverEditText.setError(null);
338336
alertDialog.dismiss();

mage/src/main/res/layout/activity_login.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
</LinearLayout>
201201

202202
<LinearLayout
203+
android:id="@+id/sign_up"
203204
android:layout_width="match_parent"
204205
android:layout_height="match_parent"
205206
android:layout_marginTop="40dip"

0 commit comments

Comments
 (0)