bottom-sheet

Show entire bottom sheet with EditText above Keyboard

此生再无相见时 提交于 2019-11-30 06:32:47
问题 I'm implementing a UI where a bottom sheet will appear above the keyboard with an EditText for the user to enter a value. The problem is the View is being partially overlapped by the keyboard, covering up the bottom of the bottom sheet. Here is the Bottom Sheet and no keyboard. Here is the Bottom Sheet with the keyboard showing. What's the best method to ensure the entire Bottom Sheet is shown? Thanks. 回答1: Just reposting @jblejder from this question Keyboard hides BottomSheetDialogFragment

Scrolling issue with Bottom Sheet Android

江枫思渺然 提交于 2019-11-30 05:41:09
问题 I need the bottom sheet to stop at two positions. I have the following code for Bottom Sheet. <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <RelativeLayout android:layout_width="match_parent"

Scroll not working for multiple RecyclerView in BottomSheet

自闭症网瘾萝莉.ら 提交于 2019-11-30 05:00:20
I implemented BottomSheet using the DialogFragment approach. I have a TabLayout and ViewPager in the BottomSheet . The ViewPager is hosting 2 pages, each inflates a RecyclerView . The first(Coffee tab) RecyclerView scrolls fine. The problem I'm having now is that for the 2nd(Milk tab) the scroll is not working. Any idea how can I fix this? Thanks! You can test out with the demo project I created here: https://github.com/choongyouqi/bottomsheet ` laenger As mentioned by R. Zagórski, I described the reason for this scrolling behavior here , i.e., BottomSheetBehavior only supports one scrolling

android BottomSheet how to collapse when clicked outside?

心已入冬 提交于 2019-11-30 00:43:01
I have implemented bottomsheet behavior with NestedScrollView. And was wondering if it is possible to hide the bottomsheet view when touched outside. Finally I was able to do this, Used the following lines of code: @Override public boolean dispatchTouchEvent(MotionEvent event){ if (event.getAction() == MotionEvent.ACTION_DOWN) { if (mBottomSheetBehavior.getState()==BottomSheetBehavior.STATE_EXPANDED) { Rect outRect = new Rect(); bottomSheet.getGlobalVisibleRect(outRect); if(!outRect.contains((int)event.getRawX(), (int)event.getRawY())) mBottomSheetBehavior.setState(BottomSheetBehavior.STATE

BottomSheetDialogFragment - listen to dismissed by user event

大城市里の小女人 提交于 2019-11-30 00:39:43
问题 How can I listen to a FINAL dismissal of a BottomSheetDialogFragment ? I want to save user changes on the final dismissal only... I tried following: Method 1 This only fires, if the dialog is dismissed by swiping it down (not on back press or on touch outside) @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog d = super.onCreateDialog(savedInstanceState); d.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) {

BottomSheetDialogFragment - How to set expanded height (or min top offset)

女生的网名这么多〃 提交于 2019-11-29 20:53:35
I create a BottomSheetDialogFragment and I want to adjust it's maximum expanded height. How can I do that? I can retrieve the BottomSheetBehaviour but all I can find is a setter for the peek height but nothing for the expanded height. public class DialogMediaDetails extends BottomSheetDialogFragment { @Override public void setupDialog(Dialog dialog, int style) { super.setupDialog(dialog, style); View view = View.inflate(getContext(), R.layout.dialog_media_details, null); dialog.setContentView(view); ... View bottomSheet = dialog.findViewById(R.id.design_bottom_sheet); BottomSheetBehavior

BottomNavigationView is not full width

不想你离开。 提交于 2019-11-29 05:26:02
I am working on an Android app and implementing BottomNavigationView from the design library. I have looked at many examples and I can't figure out what is wrong with my layout. The BottomNavigationView is not displayed as full width. Another issue is the status bar color is not getting applied. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- Include

Scroll not working for multiple RecyclerView in BottomSheet

99封情书 提交于 2019-11-29 01:08:32
问题 I implemented BottomSheet using the DialogFragment approach. I have a TabLayout and ViewPager in the BottomSheet . The ViewPager is hosting 2 pages, each inflates a RecyclerView . The first(Coffee tab) RecyclerView scrolls fine. The problem I'm having now is that for the 2nd(Milk tab) the scroll is not working. Any idea how can I fix this? Thanks! You can test out with the demo project I created here: https://github.com/choongyouqi/bottomsheet` 回答1: As mentioned by R. Zagórski, I described

Android BottomSheetDialogFragment does not expand completely

て烟熏妆下的殇ゞ 提交于 2019-11-28 21:23:12
I have the following test bottom sheet implementation. When I set the peekHeight to a value less than 500, it works. After some value, any increase in peek height will not change how the bottom sheet is expanded. It Just remains there to only drag manually. How do we set the peekHeight programmatically to ensure that the bottom sheet is auto expanded to the peek height. bottom_sheet_dialog_main <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

ListView in BottomSheet

橙三吉。 提交于 2019-11-28 18:25:12
I ran into a problem where I had a simple ListView in a BottomSheet and ListView had enough items to fill the screen and scroll even more. When I scroll down, everything seems to work however when I tried to scroll back up, it was scrolling the BottomSheet itself and closing the view instead of just scrolling the ListView . I was able to find a solution after a while and since I couldn't find it anywhere here, I figured I would post it here. The solution is to extend the ListView like this: public class BottomSheetListView extends ListView { public BottomSheetListView (Context context,