Coder Social home page Coder Social logo

Comments (10)

miguelhincapie avatar miguelhincapie commented on May 12, 2024

What about this:

<View
            android:id="@+id/oferta_shadow"
            android:layout_width="match_parent"
            android:layout_height="@dimen/ofert_shadow_height"
            android:background="@drawable/shadow"/>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <gradient
        android:startColor="#997e7e7e"
        android:endColor="#0000"
        android:type="linear"
        android:angle="90"> <!-- Change this value to have the correct shadow angle, must be multiple from 45 -->
    </gradient>

</shape>

using that view upper inside the bottomsheet content

from custombottomsheetbehavior.

vit001 avatar vit001 commented on May 12, 2024

Good thinking! The problem I ran into is that the viewpager with parallax photos shows underneath the shadow when the bottomsheet is collapsed, and setting a margin on the viewpager seems to get ignored ...

from custombottomsheetbehavior.

vit001 avatar vit001 commented on May 12, 2024

OK, I have a solution. Had to modify the backdrop behavior to adjust for the shadows. Will post a PR.

from custombottomsheetbehavior.

deividas717 avatar deividas717 commented on May 12, 2024

You can also do this

  <android.support.design.widget.CoordinatorLayout
      android:id="@+id/coordinatorlayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

    <View
        android:id="@+id/bottom_sheet_shadow"
        app:layout_anchor="@+id/bottom_sheet"
        android:layout_width="match_parent"
        android:layout_height="24dp"
        android:background="@drawable/bottom_sheet_shadow" />

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:behavior_peekHeight="@dimen/bottom_sheet_peek_height"
        android:id="@+id/bottom_sheet"
        app:layout_behavior="com.BottomSheetBehaviorGoogleMapsLike"
        app:anchorPoint="@dimen/anchor_point"
        app:behavior_hideable="true"
        android:fitsSystemWindows="true">

        <include
            android:id="@+id/content"
            layout="@layout/bottom_sheet_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>

from custombottomsheetbehavior.

vit001 avatar vit001 commented on May 12, 2024

That works! Much easier than what I had in mind! (Which involved adding the shadow to the scrollview and then having to offset the backdrop).

from custombottomsheetbehavior.

miguelhincapie avatar miguelhincapie commented on May 12, 2024

yeah @deiauk that is what I was talking about :D
by the way I'm feeling a little bad cuz I can't help you guys much on those days xD. I'm in the release of a big app that use this lib (https://play.google.com/store/apps/details?id=co.com.spyspot)

from custombottomsheetbehavior.

vit001 avatar vit001 commented on May 12, 2024

Looks like a nice app! It seems it's not available in my country but the screenshots look cool!

from custombottomsheetbehavior.

miguelhincapie avatar miguelhincapie commented on May 12, 2024

I'm closing the ready issues. Did you commit this one?

from custombottomsheetbehavior.

vit001 avatar vit001 commented on May 12, 2024

No, did not commit - do you want me to? By the way, adding a shadow requires a making a change to MergedAppBar partialBackgroundHeight to factor in the shadow height.

from custombottomsheetbehavior.

miguelhincapie avatar miguelhincapie commented on May 12, 2024

But what about if I don't wanna use shadow? do you have thought in a easy way to turn on/off this new effect?. I'm asking it because if you review the issues, there is one related to ignore one step. After that question I though... damn, I would developed it giving the option to choose what points I want to use, I mean (hidden, followed by collpsed, followed by anchor and then expanded... or just ignore one of them and jump to the next one).

from custombottomsheetbehavior.

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.