Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shadow with offset #21

Open
lucasharada opened this issue Aug 10, 2017 · 3 comments
Open

Add shadow with offset #21

lucasharada opened this issue Aug 10, 2017 · 3 comments

Comments

@lucasharada
Copy link

lucasharada commented Aug 10, 2017

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>
@pavlospt
Copy link
Owner

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

@lucasharada
Copy link
Author

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.

@pavlospt
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants