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); setupImage(imageUrl);
if (descriptionHtml == null || Algorithms.isEmpty(descriptionHtml.trim())) { if (Algorithms.isBlank(descriptionHtml)) {
showAddBtn(); showAddBtn();
} else { } else {
showDescription(title, imageUrl, descriptionHtml); 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) { private void showDescription(final String title, final String imageUrl, final String descriptionHtml) {
LinearLayout descriptionContainer = view.findViewById(R.id.description_container); LinearLayout descriptionContainer = view.findViewById(R.id.description_container);
FrameLayout addBtn = view.findViewById(R.id.btn_add);
AndroidUiHelper.updateVisibility(descriptionContainer, true); AndroidUiHelper.updateVisibility(descriptionContainer, true);
AndroidUiHelper.updateVisibility(addBtn, false);
TextViewEx tvDescription = view.findViewById(R.id.description); TextViewEx tvDescription = view.findViewById(R.id.description);
tvDescription.setText(getFirstParagraph(descriptionHtml)); tvDescription.setText(getFirstParagraph(descriptionHtml));

View file

@ -84,17 +84,12 @@ public class GpxEditDescriptionDialogFragment extends BaseOsmAndDialogFragment {
return view; return view;
} }
private boolean shouldClose() { private boolean shouldClose() {
Editable editable = editableHtml.getText(); Editable editable = editableHtml.getText();
if (htmlCode == null || editable == null || editable.toString() == null) { if (htmlCode == null || editable == null || editable.toString() == null) {
return true; return true;
} }
if (htmlCode.equals(editable.toString())) { return htmlCode.equals(editable.toString());
return true;
}
return false;
} }
private void showDismissDialog() { private void showDismissDialog() {