Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Add settings to navigation drawer (#578)
Browse files Browse the repository at this point in the history
Fixes #575
  • Loading branch information
anselm92 authored and kordianbruck committed Nov 11, 2017
1 parent dacb8a1 commit 62d737f
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import de.tum.in.tumcampusapp.activities.SurveyActivity;
import de.tum.in.tumcampusapp.activities.TransportationActivity;
import de.tum.in.tumcampusapp.activities.TuitionFeesActivity;
import de.tum.in.tumcampusapp.activities.UserPreferencesActivity;

public class DrawerMenuHelper implements NavigationView.OnNavigationItemSelectedListener {

Expand All @@ -53,6 +54,10 @@ public class DrawerMenuHelper implements NavigationView.OnNavigationItemSelected

};

private static final SideNavigationItem[] APP = {
new SideNavigationItem(R.string.settings, R.drawable.ic_action_settings, UserPreferencesActivity.class, false, false)
};

private final Context mContext;

private final DrawerLayout mDrawerLayout;
Expand Down Expand Up @@ -94,6 +99,11 @@ public void populateMenu(Menu navigationMenu) {
.setIntent(new Intent(mContext, item.activity));
}
}
for(SideNavigationItem item : APP){
navigationMenu.add(item.titleRes)
.setIcon(item.iconRes)
.setIntent(new Intent(mContext, item.activity));
}
}

private static class SideNavigationItem {
Expand Down

0 comments on commit 62d737f

Please sign in to comment.