public class AppConfig
extends java.lang.Object
AppConfig
can be used to implement feature toggling i.e. can be used to check is some
feature is flagged to be part of an application or application variant.Modifier and Type | Class and Description |
---|---|
static class |
AppConfig.Flag |
Constructor and Description |
---|
AppConfig() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isEnabled(android.content.Context context,
int flagResId)
Tests if the specified feature is enabled or not.
|
static boolean |
isEnabled(int flagResId)
Tests if the specified feature is enabled or not.
|
static boolean |
isEnabled(android.content.res.Resources resources,
int flagResId)
Tests if the specified feature is enabled or not.
|
static void |
setEnabled(int flagResId,
boolean enabled)
Sets the specified feature is enabled or disabled according to given
boolean value. |
public static boolean isEnabled(android.content.Context context, int flagResId)
context
- A Context
for accessing the flags from constant resources.flagResId
- The resource id for a constant defining a flag.boolean
value.public static boolean isEnabled(android.content.res.Resources resources, int flagResId)
resources
- A Resources
for accessing the flags from constant resources.flagResId
- The resource id for a constant defining a flag.boolean
value.public static boolean isEnabled(int flagResId)
flagResId
- The resource id for a constant defining a flag.boolean
value.public static void setEnabled(int flagResId, boolean enabled)
boolean
value.
Note that is not possible to modify a locked flag.flagResId
- The resource id for a constant defining a flag.enabled
- A boolean
value.