bottom-sheet

Setting maximum expanded height for bottomsheet dynamically

雨燕双飞 提交于 2019-12-10 11:34:08
问题 How to set maximum expanded height in android support design bottom sheet? The question is an extension to the above question, i want to set the max expanded height of the sheet but dynamically according to the screen size. I have tried setting new layout params to the view implementing bottomsheet behaviour but it does nothing good. 回答1: Finally found it, This question troubled me a lot with no solution reported anywhere, and the answer lies in the behavior itself. The minimum offset is the

Replicate keyboard like layout upward push in bottom sheet

筅森魡賤 提交于 2019-12-10 10:58:42
问题 Is there any way to manually push up layout (scrollview or recyclerview or whole activity) when bottom sheet opens just like android keyboard does? Or you can say that i want to make a minimal keyboard in form of a bottom sheet(which isn't using any editable view) 回答1: 100% working formula Use this in onCreateDialog in BottomSheetFragment KeyboardUtil(getActivity(), view); or For fragment use new KeyboardUtil(this, findViewById(R.id.fragment_container)); by using this Util class https:/

How to change the default height of bottomsheet dialog fragment?

百般思念 提交于 2019-12-10 03:50:12
问题 While using bottomsheet dialog fragment it set default height for bottomsheet dialog. In my application I want to set 80% height for bottomsheet dialog. How can I set 80% height to bottomsheet dialog? 回答1: Try this following code. super.setupDialog(dialog, style); View contentView = View.inflate(getContext(), R.layout.activity_device_nfclocation, null); DisplayMetrics displayMetrics = getActivity().getResources().getDisplayMetrics(); int width = displayMetrics.widthPixels; int height =

How to dim background when using the BottomSheet from the support library?

送分小仙女□ 提交于 2019-12-09 16:38:00
问题 How can the background be dimmed just like it is shown here? I've set it up normally using the CoordinatorLayout and the BottomSheetBehavior . 回答1: This will simply show a bottom sheet. public class MyBottomSheet extends BottomSheetDialogFragment { private static final String TAG = "MyBottomSheet"; @NonNull @Override public Dialog onCreateDialog(final Bundle savedInstanceState) { final BottomSheetDialog dialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState); final View view =

Prevent BottomSheetDialogFragment covering navigation bar

醉酒当歌 提交于 2019-12-09 04:13:09
问题 I'm using really naive code to show a bottom sheet dialog fragment: class LogoutBottomSheetFragment : BottomSheetDialogFragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val view = inflater.inflate(R.layout.view_image_source_chooser, container, false) return view } } This is how I called this dialog: LogoutBottomSheetFragment().show(supportFragmentManager, "logout") But I get this horrible shown in the image below. How

Android Bottom Sheet Layout XML

谁说我不能喝 提交于 2019-12-08 08:14:29
问题 Hello there I am trying to implement a simple Android Bottom sheet and my used xml is as follow! MY 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:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <LinearLayout android:layout_width="match_parent"

How to reproduce iOS 11 maps bottom sheet with React Native

久未见 提交于 2019-12-07 18:50:59
问题 Can anyone tell me how I can mimic the bottom sheet in the new maps app in iOS 11? In android you can use a "BottomSheet", which mimics this behaviour, but I could not find anything like that for iOS. Is that a simple scroll view with a content inset? So that the search bar is at the bottom? I am fairly new to iOS programming so if someone could help me creating this layout that would be highly appreciated. This is what I mean by "bottom sheet": 回答1: I see this is old an question but for

Setting maximum expanded height for bottomsheet dynamically

痞子三分冷 提交于 2019-12-07 08:37:22
How to set maximum expanded height in android support design bottom sheet? The question is an extension to the above question, i want to set the max expanded height of the sheet but dynamically according to the screen size. I have tried setting new layout params to the view implementing bottomsheet behaviour but it does nothing good. Finally found it, This question troubled me a lot with no solution reported anywhere, and the answer lies in the behavior itself. The minimum offset is the max value upto which the bottomsheet should move and we set the lower cap of the value to our desired height

Persistent BottomSheet Below Fragment Contents?

血红的双手。 提交于 2019-12-07 08:19:09
问题 Using a Persistent BottomSheet, within a CoordinatorLayout, how can one prevent the BottomSheet from covering other user interface elements when the BottomSheet is in its COLLAPSED aka peeked state? I've successfully added a BottomSheet to my Navigation Drawer & Fragment based application; however, as mentioned above, the BottomSheet covers user interface elements within my fragment container when it's either COLLAPSED or EXPANDED Covering part of the fragment is ok when the BottomSheet is

Replicate keyboard like layout upward push in bottom sheet

我们两清 提交于 2019-12-06 14:10:56
Is there any way to manually push up layout (scrollview or recyclerview or whole activity) when bottom sheet opens just like android keyboard does? Or you can say that i want to make a minimal keyboard in form of a bottom sheet(which isn't using any editable view) 100% working formula Use this in onCreateDialog in BottomSheetFragment KeyboardUtil(getActivity(), view); or For fragment use new KeyboardUtil(this, findViewById(R.id.fragment_container)); by using this Util class https://github.com/mikepenz/MaterialDrawer/blob/aa9136fb4f5b3a80460fe5f47213985026d20c88/library/src/main/java/com