How to add or remove a feature - avinotec/Stundenplaner.FHE_EAH GitHub Wiki
The example feature is called "example".
features.xml
in the EAH folder:
- change
true
tofalse
in<bool name="feature_example">true</bool>
FeatureFragmentFactory.java
:
- add
case Features.FeatureId.EXAMPLE: fragment = ExampleFragment.newInstance(); break;
features.xml
in the EAH folder:
- add
<bool name="feature_example">true</bool>
Features.java
:
- add
public static boolean EXAMPLE = false
to the class Features - add
int EXAMPLE = n
to the class FeatureId and replacen
with the next higher available id
strings.xml
and de\strings.xml
:
- set the string to display in the drawer by adding
<string name="drawer_example" >Example/string>
- set the string for the english and german version of the app
FeatureProvider.java
:
- add
case Features.FeatureId.EXAMPLE: stringRes = R.string.drawer_example; break;
in loadFeatures() - add feature to drawer by adding
if(Features.EXAMPLE) { list.add(new DraweItem(Features.FeatureId.EXAMPLE, getFeatureTitle(Features.FeatureId.EXAMPLE))); }
to getFeaturedItems() andcase Features.FeatureId.EXAMPLE: stringRes = R.string.drawer_example; break;
to getFeatureTitle()
DrawerAdapter.java
:
- if wanted, add a separator line under the name of the feature in the drawer by adding
|| FeatureProvider.getFeatureTitle(Features.FeatureId.EXAMPLE).equals(label)
to the if-clause