Switching to-do types
Now if we pull the drawer down from the top edge of the screen and swipe from right to left, we switch to a different to-do item as shown in the following image, which in effect displays a new navigation item:
If we pull the drawer back to the top, it has the effect of setting the navigation item to the current selection. This happens using the onItemSelected
method of the WearableActionDrawer.OnMenuItemClickListener
class implemented by the TodosActivity
activity:
@Override public void onItemSelected(int position) { Log.d(TAG, "WearableNavigationDrawerAdapter.onItemSelected(): " + position); mSelectedTodoItemType = todoItemTypes.get(position); String selectedTodoImage = mSelectedTodoItemType.getBackgroundImage(); int drawableId = getResources().getIdentifier(selectedTodoImage, "drawable", getPackageName()); mTodoItemTypeFragment.updateFragment(mSelectedTodoItemType); }
Here is what we see:
Pulling from bottom to top, we see the menu items such...