aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorKyle Horimoto <khorimoto@gmail.com>2015-10-22 15:09:17 -0700
committerKyle Horimoto <khorimoto@gmail.com>2015-10-22 15:09:17 -0700
commiteeb409484172eb3a8ae5d5aac8acec255aeb1500 (patch)
tree80ce229e5460c45e6e7d2c31b4b65b18a170423a /app
parenta7442cdbe55769f0e0b59182920eedb39b65b662 (diff)
downloadconnectbot-eeb409484172eb3a8ae5d5aac8acec255aeb1500.tar.gz
connectbot-eeb409484172eb3a8ae5d5aac8acec255aeb1500.tar.bz2
connectbot-eeb409484172eb3a8ae5d5aac8acec255aeb1500.zip
Don't display a nickname field when protocol is 'local.'
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/org/connectbot/HostEditorFragment.java8
-rw-r--r--app/src/main/res/layout/fragment_host_editor.xml1
2 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/java/org/connectbot/HostEditorFragment.java b/app/src/main/java/org/connectbot/HostEditorFragment.java
index 392e870..fd9119e 100644
--- a/app/src/main/java/org/connectbot/HostEditorFragment.java
+++ b/app/src/main/java/org/connectbot/HostEditorFragment.java
@@ -113,6 +113,7 @@ public class HostEditorFragment extends Fragment {
private EditText mHostnameField;
private View mPortContainer;
private EditText mPortField;
+ private View mNicknameItem;
private EditText mNicknameField;
private View mColorItem;
private TextView mColorText;
@@ -259,6 +260,8 @@ public class HostEditorFragment extends Fragment {
mPortField.setText(Integer.toString(mHost.getPort()));
mPortField.addTextChangedListener(new HostTextFieldWatcher(HostDatabase.FIELD_HOST_PORT));
+ mNicknameItem = view.findViewById(R.id.nickname_item);
+
setTransportType(mHost.getProtocol(), /* setDefaultPortInModel */ false);
mNicknameField = (EditText) view.findViewById(R.id.nickname_field);
@@ -568,16 +571,19 @@ public class HostEditorFragment extends Fragment {
mHostnameContainer.setVisibility(View.VISIBLE);
mPortContainer.setVisibility(View.VISIBLE);
mExpandCollapseButton.setVisibility(View.VISIBLE);
+ mNicknameItem.setVisibility(View.VISIBLE);
} else if (Telnet.getProtocolName().equals(protocol)) {
mUsernameContainer.setVisibility(View.GONE);
mHostnameContainer.setVisibility(View.VISIBLE);
mPortContainer.setVisibility(View.VISIBLE);
mExpandCollapseButton.setVisibility(View.VISIBLE);
+ mNicknameItem.setVisibility(View.VISIBLE);
} else {
// Local protocol has only one field, so no need to show the URI parts
// container.
setUriPartsContainerExpanded(false);
- mExpandCollapseButton.setVisibility(View.INVISIBLE);
+ mExpandCollapseButton.setVisibility(View.GONE);
+ mNicknameItem.setVisibility(View.GONE);
}
}
diff --git a/app/src/main/res/layout/fragment_host_editor.xml b/app/src/main/res/layout/fragment_host_editor.xml
index faa22bc..d368d20 100644
--- a/app/src/main/res/layout/fragment_host_editor.xml
+++ b/app/src/main/res/layout/fragment_host_editor.xml
@@ -173,6 +173,7 @@
</LinearLayout>
<RelativeLayout
+ android:id="@+id/nickname_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>