openHPI / xikolo-android

📱 Android App of the HPI MOOC Platform
https://play.google.com/store/apps/dev?id=7185448023325736337
GNU General Public License v3.0
41 stars 15 forks source link

New Feature Config #230

Closed tobiasrohloff closed 4 years ago

tobiasrohloff commented 4 years ago

A pretty large refactoring, but most changes are very small and easy. Instead of having different flavor-specific feature configs in Config and FeatureConfig this PR replaces these with resource-based feature flippers. The defaults can be found in /app/src/main/res/values/features.xml, which every flavor can overwrite. We allow features to be directly enabled by providing the corresponding data if required (strings and string-arrays), but also simple flags as bools. If a feature is enabled can be checked with Feature.enabled("channels") for example, no matter if this is a string, string-array or bool resource.

This should help to keep the code-base much cleaner in the long-term since more and more flavors are in the pipeline. Flavors can be added/removed without touching main at all now. Everything is encapsulated in their flavor-specific source folders.

Additional stuff:

tobiasrohloff commented 4 years ago

@bengelhaupt @SanJSp I have to merge this since it blocks other emergency tasks. Feel free to review anyway, I'm happy to implement feedback also at a later point.

bengelhaupt commented 4 years ago

LGTM