From 192188fd4ea318b28399c2c266da07e1ea875e6a Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 25 Feb 2016 14:04:57 +0100 Subject: [PATCH] Fixed comparison type. --- .../syncthingandroid/fragments/DeviceFragment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceFragment.java index a8b655df..a0d09038 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceFragment.java @@ -129,7 +129,7 @@ public class DeviceFragment extends Fragment implements private TextWatcher mAddressesTextWatcher = new TextWatcherAdapter() { @Override public void afterTextChanged(Editable s) { - if (!s.toString().equals(mDevice.addresses)) { + if (!s.toString().equals(displayableAddresses())) { mDeviceNeedsToUpdate = true; mDevice.addresses = persistableAddresses(s); @@ -289,7 +289,7 @@ public class DeviceFragment extends Fragment implements // Update views mIdView.setText(mDevice.deviceID); mNameView.setText((mDevice.name)); - mAddressesView.setText(TextUtils.join(" ", displayableAddresses())); + mAddressesView.setText(displayableAddresses()); mCompressionValueView.setText(Compression.fromValue(getActivity(), mDevice.compression).getTitle(getActivity())); mIntroducerView.setChecked(mDevice.introducer); @@ -406,10 +406,11 @@ public class DeviceFragment extends Fragment implements : Arrays.asList(userInput.toString().split(" ")); } - private List displayableAddresses() { - return DYNAMIC_ADDRESS.equals(mDevice.addresses) + private String displayableAddresses() { + List list = DYNAMIC_ADDRESS.equals(mDevice.addresses) ? DYNAMIC_ADDRESS : mDevice.addresses; + return TextUtils.join(" ", list); } @Override