Change peek height for additional options menu

This commit is contained in:
Alexander Sytnyk 2018-01-15 17:14:20 +02:00
parent 3b5ce64fed
commit 8ac88af402
3 changed files with 5 additions and 5 deletions

View file

@ -183,4 +183,6 @@
<dimen name="grid_menu_item_width">180dp</dimen> <dimen name="grid_menu_item_width">180dp</dimen>
<dimen name="grid_menu_item_bottom_top_margin">24dp</dimen> <dimen name="grid_menu_item_bottom_top_margin">24dp</dimen>
<dimen name="grid_menu_item_sides_margin">60dp</dimen> <dimen name="grid_menu_item_sides_margin">60dp</dimen>
<dimen name="bottom_sheet_menu_peek_height">300dp</dimen>
</resources> </resources>

View file

@ -256,4 +256,6 @@
<dimen name="grid_menu_item_width">120dp</dimen> <dimen name="grid_menu_item_width">120dp</dimen>
<dimen name="grid_menu_item_bottom_top_margin">16dp</dimen> <dimen name="grid_menu_item_bottom_top_margin">16dp</dimen>
<dimen name="grid_menu_item_sides_margin">40dp</dimen> <dimen name="grid_menu_item_sides_margin">40dp</dimen>
<dimen name="bottom_sheet_menu_peek_height">200dp</dimen>
</resources> </resources>

View file

@ -114,7 +114,7 @@ public class AdditionalActionsBottomSheetDialogFragment extends net.osmand.plus.
} }
ExtendedBottomSheetBehavior behavior = ExtendedBottomSheetBehavior.from(scrollView); ExtendedBottomSheetBehavior behavior = ExtendedBottomSheetBehavior.from(scrollView);
behavior.setPeekHeight(getPeekHeight()); behavior.setPeekHeight(getResources().getDimensionPixelSize(R.dimen.bottom_sheet_menu_peek_height));
behavior.setBottomSheetCallback(new BottomSheetCallback() { behavior.setBottomSheetCallback(new BottomSheetCallback() {
@Override @Override
public void onStateChanged(@NonNull View bottomSheet, int newState) { public void onStateChanged(@NonNull View bottomSheet, int newState) {
@ -185,10 +185,6 @@ public class AdditionalActionsBottomSheetDialogFragment extends net.osmand.plus.
return R.id.third_item_container; return R.id.third_item_container;
} }
private int getPeekHeight() {
return (availableScreenH * 2 / 3) - getResources().getDimensionPixelSize(R.dimen.bottom_sheet_cancel_button_height);
}
public interface ContextMenuItemClickListener { public interface ContextMenuItemClickListener {
void onItemClick(int position); void onItemClick(int position);
} }