Search in sources :

Example 1 with ProviderNavDrawerItem

use of butter.droid.ui.main.navigation.NavigationDrawerFragment.ProviderNavDrawerItem in project butter-android by butterproject.

the class NavigationDrawerPresenterImpl method getNavigationItems.

private List<NavigationDrawerFragment.AbsNavDrawerItem> getNavigationItems() {
    List<AbsNavDrawerItem> navItems = new ArrayList<>();
    navItems.add(new HeaderNavDrawerItem());
    ProviderWrapper[] providers = providerManager.getProviders();
    for (int i = 0; i < providers.length; i++) {
        final ProviderWrapper provider = providers[i];
        navItems.add(new ProviderNavDrawerItem(provider.getDisplayName(), provider.getIcon(), i));
    }
    navItems.add(new ScreenNavDrawerItem(R.string.preferences, R.drawable.ic_nav_settings, PreferencesActivity.class));
    navItems.get(selectedPosition).setSelected(true);
    return navItems;
}
Also used : AbsNavDrawerItem(butter.droid.ui.main.navigation.NavigationDrawerFragment.AbsNavDrawerItem) ProviderNavDrawerItem(butter.droid.ui.main.navigation.NavigationDrawerFragment.ProviderNavDrawerItem) PreferencesActivity(butter.droid.ui.preferences.PreferencesActivity) ArrayList(java.util.ArrayList) HeaderNavDrawerItem(butter.droid.ui.main.navigation.NavigationDrawerFragment.HeaderNavDrawerItem) ScreenNavDrawerItem(butter.droid.ui.main.navigation.NavigationDrawerFragment.ScreenNavDrawerItem) ProviderWrapper(butter.droid.base.manager.internal.provider.model.ProviderWrapper)

Aggregations

ProviderWrapper (butter.droid.base.manager.internal.provider.model.ProviderWrapper)1 AbsNavDrawerItem (butter.droid.ui.main.navigation.NavigationDrawerFragment.AbsNavDrawerItem)1 HeaderNavDrawerItem (butter.droid.ui.main.navigation.NavigationDrawerFragment.HeaderNavDrawerItem)1 ProviderNavDrawerItem (butter.droid.ui.main.navigation.NavigationDrawerFragment.ProviderNavDrawerItem)1 ScreenNavDrawerItem (butter.droid.ui.main.navigation.NavigationDrawerFragment.ScreenNavDrawerItem)1 PreferencesActivity (butter.droid.ui.preferences.PreferencesActivity)1 ArrayList (java.util.ArrayList)1