diff --git a/OsmAnd/src/net/osmand/plus/track/DescriptionCard.java b/OsmAnd/src/net/osmand/plus/track/DescriptionCard.java index 1280a183ef..8195c8d417 100644 --- a/OsmAnd/src/net/osmand/plus/track/DescriptionCard.java +++ b/OsmAnd/src/net/osmand/plus/track/DescriptionCard.java @@ -50,7 +50,7 @@ public class DescriptionCard extends BaseCard { setupImage(imageUrl); - if (descriptionHtml == null || Algorithms.isEmpty(descriptionHtml.trim())) { + if (Algorithms.isBlank(descriptionHtml)) { showAddBtn(); } else { showDescription(title, imageUrl, descriptionHtml); @@ -73,7 +73,10 @@ public class DescriptionCard extends BaseCard { private void showDescription(final String title, final String imageUrl, final String descriptionHtml) { LinearLayout descriptionContainer = view.findViewById(R.id.description_container); + FrameLayout addBtn = view.findViewById(R.id.btn_add); + AndroidUiHelper.updateVisibility(descriptionContainer, true); + AndroidUiHelper.updateVisibility(addBtn, false); TextViewEx tvDescription = view.findViewById(R.id.description); tvDescription.setText(getFirstParagraph(descriptionHtml)); diff --git a/OsmAnd/src/net/osmand/plus/track/GpxEditDescriptionDialogFragment.java b/OsmAnd/src/net/osmand/plus/track/GpxEditDescriptionDialogFragment.java index d17cd91667..a79a392f8e 100644 --- a/OsmAnd/src/net/osmand/plus/track/GpxEditDescriptionDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/track/GpxEditDescriptionDialogFragment.java @@ -84,17 +84,12 @@ public class GpxEditDescriptionDialogFragment extends BaseOsmAndDialogFragment { return view; } - - private boolean shouldClose() { Editable editable = editableHtml.getText(); if (htmlCode == null || editable == null || editable.toString() == null) { return true; } - if (htmlCode.equals(editable.toString())) { - return true; - } - return false; + return htmlCode.equals(editable.toString()); } private void showDismissDialog() {