A trivial thought was born: make it possible to change styles in the application. Those. the user chose from the menu, from the list "Orange" - once, and everything became in shades of orange. Chose "Blue" - it became blue. He created several styles with different coloring. And the question arose how to organize the filling of the menu? It turned out like this:
menu.add(R.id.themesMenuGroup, R.style.AppThemeBlack, 0, R.string.AppThemeBlackName); menu.add(R.id.themesMenuGroup, R.style.AppThemeBrown, 0, R.string.AppThemeBrownName); menu.add(R.id.themesMenuGroup, R.style.AppThemeAmber, 0, R.string.AppThemeAmberName); // ------- еще много аналогичных строк выброшено для экономии места ----------- But somehow it is cumbersome. And the question was born to me, is it possible to somehow fill this menu with a list of styles?