GithubHelp home page GithubHelp logo

Comments (6)

paulnicolet avatar paulnicolet commented on May 18, 2024 2

I can't manage to make rounded corners either. Any additional insights ?

from android-mdc-theming.

paulnicolet avatar paulnicolet commented on May 18, 2024 1

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

hmoreau94 avatar hmoreau94 commented on May 18, 2024

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)
Screenshot_2020-04-10-10-55-38-376_com ricknout mdctheming

from android-mdc-theming.

ricknout avatar ricknout commented on May 18, 2024

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.

paulnicolet avatar paulnicolet commented on May 18, 2024

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.

ricknout avatar ricknout commented on May 18, 2024

@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)

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.