rodrigosimoesrosa / circle_drawable_shadow.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
xml version = » 1.0 » encoding = » utf-8 » ?> |
layer-list xmlns : android = » http://schemas.android.com/apk/res/android » > |
Shadow —> |
item > |
shape android : shape = » oval » > |
padding |
android : bottom = » 1dp « |
android : left = » 1dp « |
android : right = » 1dp « |
android : top = » 1dp »/> |
solid android : color = » #00CCCCCC »/> |
shape > |
item > |
item > |
shape android : shape = » oval » > |
padding |
android : bottom = » 1dp « |
android : left = » 1dp « |
android : right = » 1dp « |
android : top = » 1dp »/> |
solid android : color = » #10CCCCCC »/> |
shape > |
item > |
item > |
shape android : shape = » oval » > |
padding |
android : bottom = » 1dp « |
android : left = » 1dp « |
android : right = » 1dp « |
android : top = » 1dp »/> |
solid android : color = » #20CCCCCC »/> |
shape > |
item > |
item > |
shape android : shape = » oval » > |
padding |
android : bottom = » 1dp « |
android : left = » 1dp « |
android : right = » 1dp « |
android : top = » 1dp »/> |
solid android : color = » #30CCCCCC »/> |
shape > |
item > |
item > |
shape android : shape = » oval » > |
padding |
android : bottom = » 1dp « |
android : left = » 1dp « |
android : right = » 1dp « |
android : top = » 1dp »/> |
solid android : color = » #50CCCCCC »/> |
shape > |
item > |
Background —> |
item > |
shape |
android : shape = » oval » > |
solid android : color = » @android:color/white »/> |
shape > |
item > |
layer-list > |
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Shape with shadow android
This library draw android view shadow by ShadowLayer. You may don’t like the CardView’s black shadow which we can’t change it’s color. Same to CardView wrap content and set shadow radius. You can change shadow color, foreground color and corner radius everywhere. Because the shadow is draw in the view. So you must add space to draw the shadow. The ShadowView add one param shadowMargin which must be set before you add shadow radius to the view.
Caveat: Margin In UI
= layout_margin + shadow_margin(Add by ShadowView)
H | H | H |
---|---|---|
Change Radius | Change foreground | Change Corners |
Change shadow color | Change shadow margin | Demo |
About
Deprecated because of the performance not fine. Android custom shadow view, can replace your CardView
Источник
Shape with shadow android
Give a custom shape to any android view Useful for Material Design 2
the old package com.github.florent37 has been replaced by io.github.florent37
What you can do with Shape Of View :
Use implemented shapes
ShapeOfView disable the background property of your view, please specify a child with a background to enable it
ShapeOfView came with pre-created shapes :
Dotted Edges with Cut Corners
All shapes methods can be animated
For example, you can animate a RoundRect corner :
Create you own shape
You can use custom shape to cut your view
Using Drawable (no elevation)
Using Path (with elevation)
This method generates also a shadow path (with Lollipop elevation API 21+)
Wrap your view with a ShapeOfView
Then generate a path in your code :
In some case you have to specify requiresBitmap = true to enable ShapeOfView to draw the shape inside a bitmap before clipping your view. It will be less efficient but can make your custom shape work.
Feel free to fork this project, and add customs shapes
Then make a merge-request after updated the README with a sample of your shape, including a preview
1.4.5 Removed DiagonalView’s Direction : if diagonalAngle > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT
1.4.5 Removed ArcView’s ArcDirection : CROP_OUTSIDE if arcHeight > 0, CROP_INSIDE if arcHeight shape_
1.0.6 Updated roundrect implementation
1.0.5 Enable hardware acceleration after clip view
1.0.4 Added PolygonView
1.0.2 Added StarView
1.0.1 Added BubbleView
Ed Sheeran, for the name of this project and his awesome songs
Источник