Small edit and fix

This commit is contained in:
cepprice 2021-01-27 15:48:10 +05:00
parent b249fdbab6
commit 27dd342375
2 changed files with 5 additions and 7 deletions

View file

@ -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));

View file

@ -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() {