private void loadTrackList(int viewType, String selectTrackId) { if (mDetailFragment != null && mViewType != viewType) { getSupportFragmentManager().beginTransaction().remove(mDetailFragment).commit(); mDetailFragment = null; } mViewType = viewType; if (selectTrackId != null) { mTracksDropdownFragment.loadTrackList(viewType, selectTrackId); } else { mTracksDropdownFragment.loadTrackList(viewType); } updateDetailBackground(); }
@Override public boolean onNavigationItemSelected(int itemPosition, long itemId) { loadTrackList(itemPosition); // itemPosition == view type if (!mInitialTabSelect) { onTrackSelected(mTracksDropdownFragment.getSelectedTrackId()); mSlidingPaneLayout.openPane(); } return true; }
@Override public void onTrackNameAvailable(String trackId, String trackName) { String trackType = null; switch (mViewType) { case TracksDropdownFragment.VIEW_TYPE_SESSIONS: trackType = getString(R.string.title_sessions); break; case TracksDropdownFragment.VIEW_TYPE_OFFICE_HOURS: trackType = getString(R.string.title_office_hours); break; case TracksDropdownFragment.VIEW_TYPE_SANDBOX: trackType = getString(R.string.title_sandbox); break; } EasyTracker.getTracker().sendView(trackType + ": " + getTitle()); LOGD("Tracker", trackType + ": " + mTracksDropdownFragment.getTrackName()); }