From 372e35c46b48855342c23d727cced436866bbe4d Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 2 Dec 2020 14:28:31 +0200 Subject: [PATCH] Bottom sheet should scroll outside the screen, bottom sheets behavior with keyboard Bottom sheet should scroll outside the screen Check keyboard doesn't show after open If the bottom sheet contains "text field" taping on it will show the keyboard, bottom sheet main buttons should be above the keyboard. --- OsmAnd/res/layout/bottom_sheet_menu_base.xml | 3 ++- OsmAnd/res/layout/send_gpx_fragment.xml | 2 ++ .../dialogs/SendGpxBottomSheetFragment.java | 24 +++++++------------ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_menu_base.xml b/OsmAnd/res/layout/bottom_sheet_menu_base.xml index cb4716cf00..4d62622dd6 100644 --- a/OsmAnd/res/layout/bottom_sheet_menu_base.xml +++ b/OsmAnd/res/layout/bottom_sheet_menu_base.xml @@ -8,7 +8,8 @@ + android:layout_height="0dp" + android:layout_weight="1"> contentHeight) { - scrollView.getLayoutParams().height = contentHeight; + if (contentHeightPrevious != contentHeight && activity != null) { + if (viewHeight + shadowHeight < contentHeight) { + AndroidUtils.setBackground(getView(), getPortraitBg(activity)); } else { - scrollView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT; + AndroidUtils.setBackground(getView(), getColoredBg(activity)); } scrollView.requestLayout(); - int delay = Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP ? 300 : 1000; - scrollView.postDelayed(new Runnable() { - public void run() { - scrollView.scrollTo(0, scrollView.getHeight()); - } - }, delay); - contentHeightPrevious = contentHeight; } } };