create RainbowSpan effect

public class RainbowSpan extends CharacterStyle implements UpdateAppearance { private final int colors; public RainbowSpan(Context context) { colors = new int{ Color.parseColor("#FF0033"), Color.parseColor("#FF8000"), Color.parseColor("#FFE600"), Color.parseColor("#1AB34D"), Color.parseColor("#1A66FF"), Color.parseColor("#801AB3") }; } @Override public…

Android xml rectangle border

Simple xml code for rectangle border with transparent background: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="2dp" /> <stroke android:width="2px" android:color="@color/white" /> </shape>

Android xml drop shadow

Simple xml code for shape drop shadow: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="@android:color/transparent" android:endColor="#88333333" android:angle="90"/> </shape>