diff --git a/android/res/layout/item_category_description.xml b/android/res/layout/item_category_description.xml index f5af0053a7..5ffc1614c1 100644 --- a/android/res/layout/item_category_description.xml +++ b/android/res/layout/item_category_description.xml @@ -1,42 +1,47 @@ - + + - - - - + android:textAppearance="@style/MwmTextAppearance.Body2.Primary" + app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + \ No newline at end of file diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 8ca524011e..16724002c6 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -648,7 +648,8 @@ Subway map is unavailable This list is empty To add a bookmark, tap a place on the map and then tap the star icon - …more + …More + Less Export file List Settings Delete list diff --git a/android/src/app/organicmaps/bookmarks/BookmarkListAdapter.java b/android/src/app/organicmaps/bookmarks/BookmarkListAdapter.java index a4054ada88..d716113534 100644 --- a/android/src/app/organicmaps/bookmarks/BookmarkListAdapter.java +++ b/android/src/app/organicmaps/bookmarks/BookmarkListAdapter.java @@ -428,7 +428,14 @@ public class BookmarkListAdapter extends RecyclerView.Adapter + { + onMoreButtonClicked(moreBtn, text); + })); break; } @@ -513,4 +520,30 @@ public class BookmarkListAdapter extends RecyclerView.Adapter { + int lineCount = text.getLineCount(); + if(lineCount > 2) + { + text.setMaxLines(2); + moreBtn.setVisibility(View.VISIBLE); + } + else + moreBtn.setVisibility(View.GONE); + }); + } + + private void onMoreButtonClicked(TextView moreBtn, TextView text){ + if(text.getMaxLines() == 2) + { + text.setMaxLines(Integer.MAX_VALUE); + moreBtn.setText(R.string.category_desc_less); + } + else + { + text.setMaxLines(2); + moreBtn.setText(R.string.category_desc_more); + } + } }