Coder Social home page Coder Social logo

Comments (7)

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

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.

from bottomsheetmenu.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 29, 2024

@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

from bottomsheetmenu.

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

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.

from bottomsheetmenu.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 29, 2024

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...

from bottomsheetmenu.

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

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.

from bottomsheetmenu.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 29, 2024

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"...

from bottomsheetmenu.

Kennyc1012 avatar Kennyc1012 commented on July 29, 2024

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

from bottomsheetmenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.