Search in sources :

Example 1 with ProjectIconView

use of org.odk.collect.android.projects.ProjectIconView in project collect by opendatakit.

the class MainMenuActivity method onPrepareOptionsMenu.

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    final MenuItem projectsMenuItem = menu.findItem(R.id.projects);
    ProjectIconView projectIconView = (ProjectIconView) projectsMenuItem.getActionView();
    projectIconView.setProject(currentProjectViewModel.getCurrentProject().getValue());
    projectIconView.setOnClickListener(v -> onOptionsItemSelected(projectsMenuItem));
    projectIconView.setContentDescription(getString(R.string.projects));
    return super.onPrepareOptionsMenu(menu);
}
Also used : ProjectIconView(org.odk.collect.android.projects.ProjectIconView) MenuItem(android.view.MenuItem)

Aggregations

MenuItem (android.view.MenuItem)1 ProjectIconView (org.odk.collect.android.projects.ProjectIconView)1