For TextView android

<TextView
// some attributes
android:shadowColor="#YourHexColorHere"
android:shadowDx="10"
android:shadowDy="10"
android:shadowRadius="7"/>

// set font style
// same as this article: https://davidng94.wordpress.com/2016/01/02/use-your-custom-font-in-android/
Typeface typeFace = Typeface.createFromAsset(
getAssets(), "YourFontNameHere");
textView.setTypeface(typeFace);

// set gradient color
Shader shader = new LinearGradient(
0, 0, 0, textView.getTextSize(),
Color.BLUE, Color.RED,
Shader.TileMode.CLAMP);
textView.getPaint().getShader(shader);
// set pattern background
Bitmap bmp = BitmapFactory.decodeResource(
getResources(),
R.drawable.yourImageInDrawableHere);
Shader shader = new BitmapShader(
bmp,
Shader.TileMode.REPEAT,
Shader.TileMode.REPEAT);
textView.getPaint().getShader(shader);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s