private void onYearSelected(int year) { if (mSelectedYear == year) { return; } LOGD(TAG, "Year selected: " + year); VideoLibraryFragment frag = (VideoLibraryFragment) getFragmentManager() .findFragmentById(com.saarang.samples.apps.iosched.R.id.videos_fragment); if (frag == null) { LOGE(TAG, "Videos fragment not found."); return; } mSelectedYear = year; /* [ANALYTICS:EVENT] * TRIGGER: Select a year on the Years dropdown in the Video Library. * CATEGORY: 'Video Library' * ACTION: selectyear * LABEL: year (e.g. 2014, 2013, 2012) * [/ANALYTICS] */ AnalyticsManager.sendEvent("Video Library", "selectyear", String.valueOf(year), 0L); frag.setFilterAndReload(mSelectedYear, mSelectedTopic); }
private void onTopicSelected(String topic) { if (mSelectedTopic.equals(topic)) { return; } LOGD(TAG, "Topic selected: " + topic); VideoLibraryFragment frag = (VideoLibraryFragment) getFragmentManager() .findFragmentById(com.saarang.samples.apps.iosched.R.id.videos_fragment); if (frag == null) { LOGE(TAG, "Videos fragment not found."); return; } mSelectedTopic = topic; /* [ANALYTICS:EVENT] * TRIGGER: Select a topic on the topics dropdown in the Video Library. * CATEGORY: 'Video Library' * ACTION: selecttopic * LABEL: year (e.g. "Android", "Chrome", ...) * [/ANALYTICS] */ AnalyticsManager.sendEvent("Video Library", "selecttopic", topic, 0L); frag.setFilterAndReload(mSelectedYear, mSelectedTopic); }
/*@Override protected int getSelfNavDrawerItem() { return NAVDRAWER_ITEM_VIDEO_LIBRARY; } */ @Override protected void onResume() { super.onResume(); invalidateOptionsMenu(); Fragment frag = getFragmentManager() .findFragmentById(com.saarang.samples.apps.iosched.R.id.videos_fragment); if (frag != null) { // configure video fragment's top clearance to take our overlaid controls (Action Bar // and spinner box) into account. int actionBarSize = UIUtils.calculateActionBarSize(this); int filterBarSize = getResources() .getDimensionPixelSize(com.saarang.samples.apps.iosched.R.dimen.filterbar_height); mDrawShadowFrameLayout.setShadowTopOffset(actionBarSize + filterBarSize); ((VideoLibraryFragment) frag) .setContentTopClearance( actionBarSize + filterBarSize + getResources() .getDimensionPixelSize( com.saarang.samples.apps.iosched.R.dimen.explore_grid_padding)); } }