From 27dd3423754914ca884140b41fbd4cd3e9960645 Mon Sep 17 00:00:00 2001 From: cepprice Date: Wed, 27 Jan 2021 15:48:10 +0500 Subject: [PATCH] Small edit and fix --- OsmAnd/src/net/osmand/plus/track/DescriptionCard.java | 5 ++++- .../plus/track/GpxEditDescriptionDialogFragment.java | 7 +------ 2 files changed, 5 insertions(+), 7 deletions(-) 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() {