Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: is it possible to disable dimming, make content above touchable, and scroll? #20

Closed
AndroidDeveloperLB opened this issue Dec 13, 2015 · 7 comments

Comments

@AndroidDeveloperLB
Copy link

I'm trying to do something like on Google Maps, where the content above the bottom sheet is touchable, there is no dimming, and I can scroll the bottom sheet till it shows its whole content , and even further if there is a lot of content.

Is it possible on this library to have this behavior ?

@Kennyc1012
Copy link
Owner

The library functions primarily as a dialog, so the request behavior isn't supported easily. The view used in Google Maps is most likely not a dialog but apart of the layout. You can wrap your view in a CollapsingView and add it to your view and manipulate it yourself.

@AndroidDeveloperLB
Copy link
Author

@Kennyc1012 Too bad.
Can you help me with this though?
I've tried doing it for a long time on other libraries, and still failed:
http://stackoverflow.com/q/34160423/878126

@Kennyc1012
Copy link
Owner

Heres the approach I would take if I were try to replicate the Google Maps app.

Activity A- The wrapping activity for the views. Would contain 2 fragments. The activity theme should extend from Theme.AppCompat.NoActionBar

Map Fragment- This is where the map view would be held and manipulated. There should NO actionbar/toolbar here

Bottomsheet Fragment- This is where the actionbar/toolbar will be. The fragment will be added with a transaction when wanting to me shown. Upon dismissing by either the back arrow or dragging, the fragment should be removed from the fragment manager.

If communication is needed between both fragments and/or with the parent activity, you can create an interface that the activity will implement and the fragments can make calls to the interface(Activity A) which can then communicate down to either or both of the fragments.

@AndroidDeveloperLB
Copy link
Author

The activity and fragments part is ok and I can already customize it, but I don't get how to use the bottom sheet itself (which is why I try out multiple libraries that support bottom sheet), and work well with its listeners.
in a POC, I've tried now using the CollapsingView inside the layout of the activity, as such:

<FrameLayout 
             android:layout_width="match_parent"
             android:layout_height="match_parent">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="some normal content behind the bottom sheet, not a part of it"/>

    <com.kennyc.bottomsheet.CollapsingView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <include layout="@layout/custom_view"/>

    </com.kennyc.bottomsheet.CollapsingView>
</FrameLayout>

The "custom_view" layout is a large one, which also includes CollapsingToolbarLayout.

Yet, the bottom sheet takes the whole screen from the beginning. Isn't there a function to tell it to take the space of a certain view within or something? Only when scrolling, it should take the whole screen...

@Kennyc1012
Copy link
Owner

The CollapsingView will wrap to the whole views total height, not partially show it. I don't think this library is a good solution for what you need, sorry.

@AndroidDeveloperLB
Copy link
Author

Too bad. Thank you for your help.
If you do know how to handle it well, please let me know.
Bottom sheet is supposed to initially show only a part of it. That's why it's also called "bottom"...

@Kennyc1012
Copy link
Owner

This can be achieved using the BottomSheetBehavior in the V23.2.0 support library described here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants