CircleView icon indicating copy to clipboard operation
CircleView copied to clipboard

Add shadow with offset

Open lucasharada opened this issue 8 years ago • 3 comments

Is it possible to add a shadow with a customizable offset, instead of a homogeneous shadow centered in the center of the CircleView?

I tried defining a drawable as background, but it didn't work at all:

<com.github.pavlospt.CircleView
...
android:layout_width="192dp"
android:layout_height="192dp"
android:background="@drawable/circle_shadow"
...
/>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:bottom="0dp"
        android:left="192dp"
        android:right="0dp"
        android:top="192dp">
        <shape android:shape="oval">
            <solid android:color="#bdbdbd" />
        </shape>
    </item>
</layer-list>

lucasharada avatar Aug 10 '17 18:08 lucasharada

Hello, having a drawable as background didn't work because you would need to draw that in Canvas since this is a custom View component. Currently, I do not have the time to develop that feature. PRs are always welcome :)

pavlospt avatar Aug 10 '17 18:08 pavlospt

Thanks for the quick response.

Do you have any general guide to develop it? I'll try to make it work and, if successful, I'll make a PR.

lucasharada avatar Aug 10 '17 19:08 lucasharada

Well, I haven't really dived that much into custom Views, so i am afraid that I can not provide a guide :/

pavlospt avatar Aug 10 '17 19:08 pavlospt