Comments (6)
I can't manage to make rounded corners either. Any additional insights ?
from android-mdc-theming.
@ricknout, thanks for your reply ! In my case the bottom sheet is used as a container, and I do some fragment transactions to change its content when navigating, then I might need different background colors depending on the content fragment.
But that's ok, I will use the bottom sheet backgroundTint
as a workaround 😉
Thanks again !
from android-mdc-theming.
Have been trying for a while as well and can't figure it out ... Please give us some help. I downloaded your project, updated style.xml to
<style name="AppShapeAppearance.LargeComponent" parent="ShapeAppearance.MaterialComponents.LargeComponent"> <item name="cornerFamily">rounded</item> <item name="cornerRadius">14dp</item> </style>
The result is that the Standard Bottom Sheet has no effect on its radius whatsoever (cf. screenshot)
from android-mdc-theming.
In order for me to help diagnose the problem(s), I will need to see some code from the layout.
My suspicion is that the style="?attr/bottomSheetStyle
line is missing, eg:
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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">
...
<FrameLayout
android:id="@+id/bottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="?attr/bottomSheetStyle"
app:layout_behavior="@string/bottom_sheet_behavior">
<!-- Bottom sheet contents -->
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
from android-mdc-theming.
Hey @ricknout
After some investigation, I have found that the bottom sheet corners are rounded, but the content is not clipped to its bounds, which covers the sheet completely, and hide the rounded corner.
Here is a toy layout as an example:
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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">
...
<FrameLayout
android:id="@+id/bottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="?attr/bottomSheetStyle"
app:layout_behavior="@string/bottom_sheet_behavior">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"/>
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
In this example, what I get is a completely black bottom sheet, with no rounded corner. Whereas if I set the inner view background to transaparent
, I can see the rounded corners.
Any idea how to clip the content ? I have been trying to play with clipChildren
without success.
Maybe I'm juste misusing it, and we are always supposed to have a transparent content ?
Thank you very much for your help,
Paul.
from android-mdc-theming.
@paulnicolet unfortunately I don't think that's possible. However, if you're going to have a view that fills the whole bottom sheet with a color, why not rather use app:backgroundTint="@android:color/black"
on the bottom sheet itself (i.e. FrameLayout
in this case)?
from android-mdc-theming.
Related Issues (8)
- Bug on "chips" sample: the EditText doesn't allow to remove the chip right away HOT 7
- Question: is it possible to use ExtendedFloatingActionButton to have a progress bar within? HOT 2
- Request: add sample for using ExtendedFloatingActionButton HOT 2
- Question: is it possible to use a theme based on OS settings? HOT 6
- Question: is BottomSheetDialogFragment shown small on landscape, on purpose? HOT 4
- UI bug in Scrolling demo HOT 1
- Can the chips have dynamic text other than "ChipDrawable"?
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 android-mdc-theming.