Comments (10)
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.
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.
OK, I have a solution. Had to modify the backdrop behavior to adjust for the shadows. Will post a PR.
from custombottomsheetbehavior.
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.
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.
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.
Looks like a nice app! It seems it's not available in my country but the screenshots look cool!
from custombottomsheetbehavior.
I'm closing the ready issues. Did you commit this one?
from custombottomsheetbehavior.
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.
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)
- NullPointerException at 288 line in BottomSheetBehaviorGoogleMapsLike HOT 20
- How to prevent STATE_COLLAPSED and STATE_HIDDEN? HOT 3
- main status bar color HOT 2
- crash with compile sdk version HOT 6
- The view is not associated with BottomSheetBehaviorGoogleMapsLike
- FATAL error on Viewdragger helper HOT 1
- How do I change MargedAppBarLayout's TitleTextColor?
- to vit001: How do I use your CustomBottomSheetBehavior custom lib (with your own viewpager)? HOT 4
- Parallax effect and Merged AppBar problems HOT 7
- Wrong behavior when the keyboard is shown
- What to do if PeekHeight > ToolbarHeight + StatusBarHeight
- crash with sdk 28 HOT 2
- Backdrop View is not showing properly in some cases, it doesn't animate to Anchor point.
- Header card should completely hide behind Toolbar
- Use in Kotlin has an error
- how to add custom view Toolbar when set STATE_EXPANDED
- Anchor Point state is not proper when it is set to 156dp
- Disable dragging on BackdropBottomSheetBehavior
- Clashing in defaultState attribute naming with ConstraintLayout 2.0 HOT 2
- Could not find com.mahc.custombottomsheetbehavior:googlemaps-like:0.9.4. in Gradle 7.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from custombottomsheetbehavior.