Skip to content

Instantly share code, notes, and snippets.

View AtriTripathi's full-sized avatar
🌐
Available

Atri Tripathi AtriTripathi

🌐
Available
View GitHub Profile
@AtriTripathi
AtriTripathi / AccessingColorRes.java
Last active July 29, 2019 20:44
Android Utilities
/*
* Code snippet for accessing a random color from color resources and assigning it to a TextView while
* also maintaining backward compatibility using 'ContextCompat' class from Android Support Libraries
*/
private String[] mColorArray = {"red", "pink", "purple", "deep_purple",
"indigo", "blue", "light_blue", "cyan", "teal", "green",
"light_green", "lime", "yellow", "amber", "orange", "deep_orange",
"brown", "grey", "blue_grey", "black" };