What is a recommended Android utility class collection?
- by Sebastian Roth
I often find myself writing very similar code across projects. And more often than not, I copy stuff over from old projects.
Things like:
Create images with round corners
read density into a static variable & re-use. 4 lines..
disable / hide multiple views / remote views at once. Example:
}
public static void disableViews(RemoteViews views, int... ids) {
for (int id : ids) {
views.setInt(id, SET_VISIBILITY, View.GONE);
}
}
public static void showViews(RemoteViews views, int... ids) {
for (int id : ids) {
views.setInt(id, SET_VISIBILITY, View.VISIBLE);
}
}
I'd love to package these kind of functions into 1 letter / 2 letter class names, i.e. V.showViews(RemoteViews views, int... ids) would be easy to write & remember I hope.
I'm searching for Github recommendations, links and if nothing is found, I perhaps will start a small project on github to collect.