Java Code Examples for android.widget.ExpandableListView#setOnCreateContextMenuListener()
The following examples show how to use
android.widget.ExpandableListView#setOnCreateContextMenuListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecentTabsPage.java From delion with Apache License 2.0 | 6 votes |
/** * Constructor returns an instance of RecentTabsPage. * * @param activity The activity this view belongs to. * @param recentTabsManager The RecentTabsManager which provides the model data. */ public RecentTabsPage(Activity activity, RecentTabsManager recentTabsManager) { mActivity = activity; mRecentTabsManager = recentTabsManager; mTitle = activity.getResources().getString(R.string.recent_tabs); mThemeColor = ApiCompatibilityUtils.getColor( activity.getResources(), R.color.default_primary_color); mRecentTabsManager.setUpdatedCallback(this); LayoutInflater inflater = LayoutInflater.from(activity); mView = (ViewGroup) inflater.inflate(R.layout.recent_tabs_page, null); mListView = (ExpandableListView) mView.findViewById(R.id.odp_listview); mAdapter = buildAdapter(activity, recentTabsManager); mListView.setAdapter(mAdapter); mListView.setOnChildClickListener(this); mListView.setGroupIndicator(null); mListView.setOnGroupCollapseListener(this); mListView.setOnGroupExpandListener(this); mListView.setOnCreateContextMenuListener(this); mView.addOnAttachStateChangeListener(this); ApplicationStatus.registerStateListenerForActivity(this, activity); // {@link #mInForeground} will be updated once the view is attached to the window. onUpdated(); }
Example 2
Source File: RecentTabsPage.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * Constructor returns an instance of RecentTabsPage. * * @param activity The activity this view belongs to. * @param recentTabsManager The RecentTabsManager which provides the model data. */ public RecentTabsPage(Activity activity, RecentTabsManager recentTabsManager) { mActivity = activity; mRecentTabsManager = recentTabsManager; mTitle = activity.getResources().getString(R.string.recent_tabs); mThemeColor = ApiCompatibilityUtils.getColor( activity.getResources(), R.color.default_primary_color); mRecentTabsManager.setUpdatedCallback(this); LayoutInflater inflater = LayoutInflater.from(activity); mView = (ViewGroup) inflater.inflate(R.layout.recent_tabs_page, null); mListView = (ExpandableListView) mView.findViewById(R.id.odp_listview); mAdapter = buildAdapter(activity, recentTabsManager); mListView.setAdapter(mAdapter); mListView.setOnChildClickListener(this); mListView.setGroupIndicator(null); mListView.setOnGroupCollapseListener(this); mListView.setOnGroupExpandListener(this); mListView.setOnCreateContextMenuListener(this); mView.addOnAttachStateChangeListener(this); ApplicationStatus.registerStateListenerForActivity(this, activity); // {@link #mInForeground} will be updated once the view is attached to the window. onUpdated(); }
Example 3
Source File: RecentTabsPage.java From 365browser with Apache License 2.0 | 5 votes |
/** * Constructor returns an instance of RecentTabsPage. * * @param activity The activity this view belongs to. * @param recentTabsManager The RecentTabsManager which provides the model data. */ public RecentTabsPage(ChromeActivity activity, RecentTabsManager recentTabsManager) { mActivity = activity; mRecentTabsManager = recentTabsManager; mTitle = activity.getResources().getString(R.string.recent_tabs); mThemeColor = ApiCompatibilityUtils.getColor( activity.getResources(), R.color.default_primary_color); mRecentTabsManager.setUpdatedCallback(this); LayoutInflater inflater = LayoutInflater.from(activity); mView = (ViewGroup) inflater.inflate(R.layout.recent_tabs_page, null); mListView = (ExpandableListView) mView.findViewById(R.id.odp_listview); mAdapter = new RecentTabsRowAdapter(activity, recentTabsManager); mListView.setAdapter(mAdapter); mListView.setOnChildClickListener(this); mListView.setGroupIndicator(null); mListView.setOnGroupCollapseListener(this); mListView.setOnGroupExpandListener(this); mListView.setOnCreateContextMenuListener(this); mView.addOnAttachStateChangeListener(this); ApplicationStatus.registerStateListenerForActivity(this, activity); // {@link #mInForeground} will be updated once the view is attached to the window. if (activity.getBottomSheet() != null) { View recentTabsRoot = mView.findViewById(R.id.recent_tabs_root); ApiCompatibilityUtils.setPaddingRelative(recentTabsRoot, ApiCompatibilityUtils.getPaddingStart(recentTabsRoot), 0, ApiCompatibilityUtils.getPaddingEnd(recentTabsRoot), activity.getResources().getDimensionPixelSize( R.dimen.bottom_control_container_height)); } onUpdated(); }