diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-08-30 21:01:08 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-08-30 21:01:08 +0200 |
commit | 9542a43df80aa6863c3efedf0e486b122ad0f684 (patch) | |
tree | 7eb835e5c8b0735b0442f17b0b4272f934289289 /src/main/java/de/pixart | |
parent | e2b2d4615c403621557c65fcb98dac3e86f6119b (diff) |
make port field disabled if hostname is empty
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 9d38923da..ae33849ea 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -22,6 +22,7 @@ import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; import android.support.v7.widget.Toolbar; import android.text.Editable; +import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; import android.view.Menu; @@ -327,6 +328,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat @Override public void onTextChanged(final CharSequence s, final int start, final int before, final int count) { + updatePortLayout(); updateSaveButton(); updateInfoButtons(); } @@ -443,6 +445,11 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } } + private void updatePortLayout() { + String hostname = this.binding.hostname.getText().toString(); + this.binding.portLayout.setEnabled(!TextUtils.isEmpty(hostname)); + } + protected void updateSaveButton() { boolean accountInfoEdited = accountInfoEdited(); @@ -552,6 +559,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat final OnCheckedChangeListener OnCheckedShowConfirmPassword = new OnCheckedChangeListener() { @Override public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) { + updatePortLayout(); updateSaveButton(); updateInfoButtons(); } |