From 5239aa23ea80a44d49a05d05266140897b4b6116 Mon Sep 17 00:00:00 2001 From: velichkomarija Date: Tue, 13 Oct 2020 19:25:55 +0300 Subject: [PATCH] [android] Change the separator in categories. The correct indentation from the category name is specified. --- android/res/layout/item_bookmark_category.xml | 1 + android/res/values/dimens.xml | 1 + .../maps/bookmarks/BaseBookmarkCategoriesFragment.java | 2 +- android/src/com/mapswithme/maps/bookmarks/Holders.java | 2 +- .../maps/widget/recycler/DividerItemDecorationWithPadding.java | 3 ++- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/android/res/layout/item_bookmark_category.xml b/android/res/layout/item_bookmark_category.xml index c4fd2b581f..4998043c3e 100644 --- a/android/res/layout/item_bookmark_category.xml +++ b/android/res/layout/item_bookmark_category.xml @@ -11,6 +11,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" + android:minWidth="@dimen/bookmark_category_checkbox_width" android:layout_marginStart="@dimen/margin_half_plus" android:layout_marginEnd="@dimen/margin_base_plus" /> 60dp 68dp 56dp + 36dp 508dp diff --git a/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java b/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java index 76e3dfdcc0..4ca7c0924e 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java +++ b/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java @@ -101,7 +101,7 @@ public abstract class BaseBookmarkCategoriesFragment extends BaseMwmRecyclerFrag rw.setNestedScrollingEnabled(false); RecyclerView.ItemDecoration decor = ItemDecoratorFactory - .createVerticalDefaultDecorator(getContext()); + .createDecoratorWithPadding(getContext()); rw.addItemDecoration(decor); mCatalogListener = new CatalogListenerDecorator(createCatalogListener(), this); mCategoriesAdapterObserver = new CategoriesAdapterObserver(this); diff --git a/android/src/com/mapswithme/maps/bookmarks/Holders.java b/android/src/com/mapswithme/maps/bookmarks/Holders.java index b49359f569..7b9683479e 100644 --- a/android/src/com/mapswithme/maps/bookmarks/Holders.java +++ b/android/src/com/mapswithme/maps/bookmarks/Holders.java @@ -26,7 +26,7 @@ import com.mapswithme.util.UiUtils; public class Holders { - static class GeneralViewHolder extends RecyclerView.ViewHolder + public static class GeneralViewHolder extends RecyclerView.ViewHolder { @NonNull private final TextView mText; diff --git a/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecorationWithPadding.java b/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecorationWithPadding.java index d34ab86a4b..75f1c86113 100644 --- a/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecorationWithPadding.java +++ b/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecorationWithPadding.java @@ -48,7 +48,8 @@ public class DividerItemDecorationWithPadding extends RecyclerView.ItemDecoratio if (viewHolder instanceof Holders.SectionViewHolder || viewHolder instanceof Holders.HeaderViewHolder || viewHolderNext instanceof Holders.SectionViewHolder - || viewHolderNext instanceof Holders.HeaderViewHolder) + || viewHolderNext instanceof Holders.HeaderViewHolder + || viewHolderNext instanceof Holders.GeneralViewHolder) mDivider.setBounds(0, top, right, bottom); else if (i == childCount - 1) mDivider.setBounds(0, top - dividerHeight, right, bottom);