From e309f9173ded71be10c0f7301417fdb71d62bc2f Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 5 Jan 2018 16:03:19 +0200 Subject: [PATCH] Set peek height for 2/3 of the screen height; close the menu after touch outside; calibrate the behavior --- ...ntext_menu_actions_bottom_sheet_dialog.xml | 2 +- ...ionalActionsBottomSheetDialogFragment.java | 20 ++++++++++++++++--- .../tools/ExtendedBottomSheetBehavior.java | 10 ++-------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/OsmAnd/res/layout/fragment_context_menu_actions_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_context_menu_actions_bottom_sheet_dialog.xml index 1d61901d03..ed3110ecc5 100644 --- a/OsmAnd/res/layout/fragment_context_menu_actions_bottom_sheet_dialog.xml +++ b/OsmAnd/res/layout/fragment_context_menu_actions_bottom_sheet_dialog.xml @@ -7,6 +7,7 @@ android:orientation="vertical"> @@ -17,7 +18,6 @@ android:layout_height="wrap_content" android:background="?attr/bg_color" app:behavior_hideable="true" - app:behavior_peekHeight="300dp" app:layout_behavior="net.osmand.plus.widgets.tools.ExtendedBottomSheetBehavior"> extends CoordinatorLayo top = mParentHeight; targetState = STATE_HIDDEN; } else if (mLastNestedScrollDy == 0) { - int currentTop = child.getTop(); - if (Math.abs(currentTop - mMinOffset) < Math.abs(currentTop - mMaxOffset)) { - top = mMinOffset; - targetState = STATE_EXPANDED; - } else { - top = mMaxOffset; - targetState = STATE_COLLAPSED; - } + top = child.getTop(); + targetState = STATE_MANUALLY_MOVED; } else { if (Math.abs(getYVelocity()) > MIN_VELOCITY_FOR_SLIDE) { top = mMaxOffset;