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:
Apply whitelisted language config with resConfigs for each flavor app/build.gradle.
Get rid of BuildType. Config still provides the DEBUG and RELEASE flags.
Get rid of BuildFlavor. No flavor-specific code anymore. Everything is mapped to feature flippers.
Other features that are not flavor- but hardware-/software-specific are still configured as fields in Feature, e.g., HLS_VIDEO and PIP.
Provide some convenient ResourcesExtensions for easier resource fetching, also from Contexts.
Cleanup string resources, e.g., remove unused, add missing translations, etc.
@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.
A pretty large refactoring, but most changes are very small and easy. Instead of having different flavor-specific feature configs in
Config
andFeatureConfig
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 (string
s andstring-array
s), but also simple flags asbool
s. If a feature is enabled can be checked withFeature.enabled("channels")
for example, no matter if this is astring
,string-array
orbool
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:
resConfigs
for each flavorapp/build.gradle
.BuildType
.Config
still provides theDEBUG
andRELEASE
flags.BuildFlavor
. No flavor-specific code anymore. Everything is mapped to feature flippers.Feature
, e.g.,HLS_VIDEO
andPIP
.ResourcesExtensions
for easier resource fetching, also fromContext
s.