[android] Added vertical divider to bookmark category list

This commit is contained in:
Александр Зацепин 2018-03-20 14:21:01 +03:00 committed by Arsentiy Milchakov
parent d3de8ba897
commit 324cb7b2ed
6 changed files with 18 additions and 2 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:width="1dp" android:height="1dp"/>
<solid android:color="@android:color/transparent"/>
<size android:width="@dimen/divider_width" android:height="@dimen/divider_height"/>
<solid android:color="@color/bg_window"/>
</shape>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:width="@dimen/divider_width" android:height="@dimen/divider_height"/>
<solid android:color="@color/bg_window_night"/>
</shape>

View file

@ -231,6 +231,7 @@
<dimen name="auth_dialog_facebook_btn_height">40dp</dimen>
<dimen name="divider_height">1dp</dimen>
<dimen name="divider_width">1dp</dimen>
<!-- Discovery-->
<dimen name="discovery_button_min_height">40dp</dimen>

View file

@ -229,6 +229,8 @@
<item name="ratingButtonBackground">@drawable/bg_rating_button_night</item>
<item name="android:listDivider">@drawable/list_divider_night</item>
<!-- if don't override this attribute the app will be crashed on start on Android 4.xx,
because on old prelolipop devices vector drawables don't work correctly -->
<item name="homeAsUpIndicator">@drawable/abc_ic_ab_back_mtrl_am_alpha</item>

View file

@ -18,6 +18,7 @@ import com.mapswithme.maps.bookmarks.data.BookmarkBackupController;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.dialog.EditTextDialogFragment;
import com.mapswithme.maps.widget.PlaceholderView;
import com.mapswithme.maps.widget.recycler.ItemDecoratorFactory;
import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
import com.mapswithme.maps.widget.recycler.RecyclerLongClickListener;
import com.mapswithme.util.BottomSheetHelper;
@ -84,6 +85,7 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment
}
getRecyclerView().setNestedScrollingEnabled(false);
getRecyclerView().addItemDecoration(ItemDecoratorFactory.createVerticalDefaultDecorator(getContext()));
}
private void updateResultsPlaceholder()

View file

@ -43,4 +43,10 @@ public class ItemDecoratorFactory
{
return new DividerItemDecoration(context, orientation);
}
@NonNull
public static RecyclerView.ItemDecoration createVerticalDefaultDecorator(@NonNull Context context)
{
return new DividerItemDecoration(context, DividerItemDecoration.VERTICAL);
}
}