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

How can you set the shadow center location? #33

Closed
agramian opened this issue Nov 12, 2015 · 3 comments
Closed

How can you set the shadow center location? #33

agramian opened this issue Nov 12, 2015 · 3 comments
Assignees

Comments

@agramian
Copy link

Currently the shadow is drawn slightly offset from the center of the ImageView so that the shadow is visibly thicker on the bottom than the top. Is it possible to center the shadow so that it is even all the way around the image?

@Rainer-Lang
Copy link

+1

@Leonid-Kiev
Copy link

Leonid-Kiev commented Oct 18, 2016

seems you can only extend this View and change the drawShadow method:

private void drawShadow(float shadowRadius, int shadowColor) {
        this.shadowRadius = shadowRadius;
        this.shadowColor = shadowColor;
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
            setLayerType(LAYER_TYPE_SOFTWARE, paintBorder);
        }
        paintBorder.setShadowLayer(shadowRadius, 0.0f, 0.0f, shadowColor);
    }

@lopspower
Copy link
Owner

Fix in 271b47d
You can now set shadowGravity with setShadowGravity method or with civ_shadow_gravity (center, top, bottom, start or end)

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

No branches or pull requests

4 participants