Last active
August 29, 2015 13:56
-
-
Save furkantektas/9018804 to your computer and use it in GitHub Desktop.
This is a TypefaceSpan with shadow.
This file contains hidden or 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
| import android.text.TextPaint; | |
| import android.text.style.TypefaceSpan; | |
| /** | |
| * Created by Furkan Tektas on 15.02.2014. | |
| */ | |
| public class ShadowedTypefaceSpan extends TypefaceSpan { | |
| private float radius; | |
| private float dx; | |
| private float dy; | |
| private int color; | |
| public ShadowedTypefaceSpan(String family, float radius, float dx, float dy, int color) { | |
| super(family); | |
| this.radius = radius; | |
| this.dx = dx; | |
| this.dy = dy; | |
| this.color = color; | |
| } | |
| @Override | |
| public void updateDrawState(TextPaint ds) { | |
| super.updateDrawState(ds); | |
| ds.setShadowLayer(radius, dx, dy, color); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment