What is the recommended collection of Android utility classes?

I often find that I write very similar project code. And most often I copy material from old projects.

Things like:

  • Create images with round corners
  • read density into a static variable and reuse. 4 lines ..
  • disable / hide multiple views / deleted 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 would like to compose these functions in a 1-letter / 2-letter class name, i.e. V.showViews(RemoteViews views, int... ids) would be easy to write and remember, I hope.

I am looking for Github recommendations and links, and if nothing is found, I might start a small github build project.

+4
source share
1 answer

You can take a look at https://github.com/kaeppler/droid-fu , it might be worth exploring and eventually expanding it. This is a service environment not only for presentations, but also for other aspects.

+3
source

Source: https://habr.com/ru/post/1333643/


All Articles