bottom-sheet

how to get bottomSheet to open from the top?

冷暖自知 提交于 2019-12-04 03:15:51
I'm opening a NestedScrollView in my app and so far it opens from the bottom of the screen. How do I make it open from the top? I tried removing the following line: app:layout_behavior="android.support.design.widget.BottomSheetBehavior" But the app crashes with the following error: The view is not associated with BottomSheetBehavior Is there a way to open the bottom sheet from the top of the screen? Here is my activity: ViewPager mainViewPager; private BottomSheetBehavior mBottomSheetBehavior; int switcher = 1; View menuPopupView; @Override protected void onCreate(Bundle savedInstanceState) {

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

我的梦境 提交于 2019-12-04 03:15:20
How can the background be dimmed just like it is shown here ? I've set it up normally using the CoordinatorLayout and the BottomSheetBehavior . 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 = View.inflate(getContext(), R.layout.my_custom_view, null); dialog.setContentView(view); behavior =

Unexpected namespace prefix “app” found for tag RelativeLayout - Android?

六月ゝ 毕业季﹏ 提交于 2019-12-04 00:59:30
I need to use BottomSheetBehavior with ScrollView but it says to me : Unexpected namespace prefix "app" found for tag RelativeLayout app:behavior_hideable="true" app:behavior_peekHeight="80dp" Here is 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:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk

Scrolling is not working with CoordinatorLayout + parallax image + BottomSheetLayout

人盡茶涼 提交于 2019-12-03 23:50:57
Introduction I have an activity, which implements a common pattern with parallax header image and scrolling content using CoordinatorLayout , AppBarLayout and CollapsingToolbarLayout . My xml layout looks like this: <android.support.design.widget.CoordinatorLayout android:fitsSystemWindows="true" android:layout_height="match_parent" android:layout_width="match_parent"> <android.support.design.widget.AppBarLayout android:fitsSystemWindows="true" android:id="@+id/appbar" android:layout_height="wrap_content" android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay">

BottomSheetBehavior with two RecyclerView

醉酒当歌 提交于 2019-12-03 17:13:58
I got two RecyclerView inside a LinearLayout with a BottomSheetBehavior. When you click on a item inside the first RecyclerView (with a grid) the RecyclerView is set to Gone and an the second RecyclerView (with a list) is shown. When the second Recycler is shown you cant slide the BottomSheet up and down instead the List is scrolling even in Expanded State. If the First Recycler is up everything is fine. Is there a way to make the BottomSheet to slide up and down again? <LinearLayout android:id="@+id/sliding_layout_container" android:layout_width="match_parent" android:layout_height="match

How can BottomSheetBehavior, AppBarLayout.ScrollingViewBehavior, and AppBarLayout.Behavior work together in unison?

不想你离开。 提交于 2019-12-03 16:27:19
In the GIF below you'll see I'm having trouble coordinating (heh) an AppBarLayout , containing a CollapsingToolbarLayout , and a Persistent BottomSheet in such a way that they play nicely together Goal: Have the fragment contents , seen above in turquoise ( #26999f ), remain above, yet scroll behind, the BottomSheet, seen above in dark green (#12783e) , while also respecting the AppBarLayout and its Behavior Again, as you can see from the GIF I'm close; the fragment contents is using a custom layout_behavior , MyScrollingViewBehavior , which extends AppBarLayout.ScrollingViewBehavior In the

Customizing Persistent Bottom Sheet STATE_EXPANDED height or offset

泄露秘密 提交于 2019-12-03 14:47:01
问题 Like the titles said, is there anyway to customize the size/height/offset of the official bottomSheet (Support library 23.x.x) when it is in STATE_EXPANDED state? There is a class BottomSheetBehavior but I can't find anything about height or offset. What I want is get a similar behavior like Google Maps: 回答1: After digging on Android code and searching I got it: You can do it modifying default BottomSheetBehavior adding one more stat with following steps: Create a Java class and extend it

Why am I able to click “behind” the bottomsheet in Android?

北城以北 提交于 2019-12-03 10:46:12
I have a BottomSheet in my Activity. I'm calling behavior.setState(BottomSheetBehavior.STATE_EXPANDED); to show the bottom sheet and it works fine, but the problem I have is that I can somehow click on the empty space of my bottom sheet to trigger onClick event of a view that is behind the bottom sheet. Is there a way to prevent this from happening? A simple solution is to add the android:clickable=true attribute to the layout that you are using for your bottom sheet. That way it will capture all clicks, and not let them bleed through. You do not have to set an onClick method for it, as you

RecyclerView (horizontal) nested in BottomSheet preventing vertical scrolling

岁酱吖の 提交于 2019-12-03 06:53:23
问题 I have a RecyclerView using a LinearLayoutManager with HORIZONTAL orientation, nested inside a FrameLayout using the BottomSheet Behavior . When attempting to drag vertically across the RecyclerView , the BottomSheet doesn't respond to the drag event. Presumably this is because vertical scrolling is disabled for a LayoutManager with horizontal orientation. I've tried overriding LinearLayoutManager.canScrollVertically() and returning true. This sort of works.. If you drag vertically in a very

How to handle issues of the new bottom sheet of the support/design library?

ぃ、小莉子 提交于 2019-12-03 05:13:41
问题 Background I've used a modified version of bottom-sheet library (here, based on this library, also wrote about it here), in order to have a nice transition between collapsed (AKA "peeked") state and expanded state. The library had its issues, but in general I've fixed them all. The problem Recently we've found that after going back from all ad-networks screens, back to one that has a bottom sheet, the bottom sheet gets into a weird state of being expanded. I've decided that it's time to try