florent37 / ShapeOfView

Give a custom shape to any android view, Material Design 2 ready
Apache License 2.0
3.14k stars 398 forks source link

Elevation not working #41

Open iMJ007 opened 5 years ago

iMJ007 commented 5 years ago

The elevation on any of the view is not working. no matter if height/wifth is set to wrap_content or match_parent or a specific size. It just shows small box of shadow on top left of the view when trying to set elevation.

Here is the image as shown in android studio preview.

error

The elevation shadow is completely invisible when run on device.

florent37 commented 5 years ago

elevation often displays on view's margin

and you should use "clipToPadding=false"

Le dim. 25 nov. 2018 à 08:21, Mohammed Junaid notifications@github.com a écrit :

The elevation on any of the view is not working. no matter if height/wifth is set to wrap_content or match_parent or a specific size. It just shows small box of shadow on top left of the view when trying to set elevation.

Here is the image as shown in android studio preview.

[image: error] https://user-images.githubusercontent.com/20738000/48976639-a18bbc80-f0b0-11e8-9dd3-bc93738d692a.png

The elevation shadow is completely invisible when run on device.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/florent37/ShapeOfView/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXBG0YbVELNiNbMZpQw7XjOfAunRIks5uykTpgaJpZM4YxwH2 .

iMJ007 commented 5 years ago

elevation often displays on view's margin and you should use "clipToPadding=false" Le dim. 25 nov. 2018 à 08:21, Mohammed Junaid notifications@github.com a écrit : The elevation on any of the view is not working. no matter if height/wifth is set to wrap_content or match_parent or a specific size. It just shows small box of shadow on top left of the view when trying to set elevation. Here is the image as shown in android studio preview. [image: error] https://user-images.githubusercontent.com/20738000/48976639-a18bbc80-f0b0-11e8-9dd3-bc93738d692a.png The elevation shadow is completely invisible when run on device. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#41>, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXBG0YbVELNiNbMZpQw7XjOfAunRIks5uykTpgaJpZM4YxwH2 .

I even used clipToPadding="false" but still it shows just that small square on top and not a proper shadow and the issue is with all all shapes bubble, triangle, roundedSquare..

here's the xml code of my view


<com.github.florent37.shapeofview.shapes.BubbleView
            android:id="@+id/color_palette_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="visible"
            android:elevation="12dp"
            android:layout_below="@id/current_color_container"
            android:layout_alignStart="@id/current_color_container"
            android:layout_marginStart="-48dp"
            android:layout_marginTop="4dp"
            android:clipToPadding="false"
            app:shape_bubble_arrowPosition="top"
            app:shape_bubble_borderRadius="16dp">

            <GridLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#FFFFFF"
                android:columnCount="2"
                android:elevation="8dp"
                android:padding="16dp">
florent37 commented 5 years ago

which version are you using ?

florent37 commented 5 years ago

can you try adding layout_marginBottom & layout_marginRight on your layout please ?

iMJ007 commented 5 years ago

I am using 1.4.6

I tried layout_marginBottom & layout_marginRight but it still gives the same issue.