Java Code Examples for org.chromium.chrome.browser.appmenu.AppMenuButtonHelper#setOnAppMenuShownListener()
The following examples show how to use
org.chromium.chrome.browser.appmenu.AppMenuButtonHelper#setOnAppMenuShownListener() .
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: ToolbarManager.java From delion with Apache License 2.0 | 6 votes |
/** * Sets the handler for any special case handling related with the menu button. * @param menuHandler The handler to be used. */ private void setMenuHandler(AppMenuHandler menuHandler) { menuHandler.addObserver(new AppMenuObserver() { @Override public void onMenuVisibilityChanged(boolean isVisible) { if (mFullscreenManager == null) return; if (isVisible) { mFullscreenMenuToken = mFullscreenManager.showControlsPersistentAndClearOldToken( mFullscreenMenuToken); } else { mFullscreenManager.hideControlsPersistent(mFullscreenMenuToken); mFullscreenMenuToken = FullscreenManager.INVALID_TOKEN; } } }); mAppMenuButtonHelper = new AppMenuButtonHelper(menuHandler); mAppMenuButtonHelper.setOnAppMenuShownListener(new Runnable() { @Override public void run() { RecordUserAction.record("MobileToolbarShowMenu"); } }); mLocationBar.setMenuButtonHelper(mAppMenuButtonHelper); }
Example 2
Source File: ToolbarManager.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * Sets the handler for any special case handling related with the menu button. * @param menuHandler The handler to be used. */ private void setMenuHandler(AppMenuHandler menuHandler) { menuHandler.addObserver(new AppMenuObserver() { @Override public void onMenuVisibilityChanged(boolean isVisible) { if (mControlsVisibilityDelegate == null) return; if (isVisible) { mFullscreenMenuToken = mControlsVisibilityDelegate.showControlsPersistentAndClearOldToken( mFullscreenMenuToken); } else { mControlsVisibilityDelegate.hideControlsPersistent(mFullscreenMenuToken); mFullscreenMenuToken = FullscreenManager.INVALID_TOKEN; } } }); mAppMenuButtonHelper = new AppMenuButtonHelper(menuHandler); mAppMenuButtonHelper.setOnAppMenuShownListener(new Runnable() { @Override public void run() { RecordUserAction.record("MobileToolbarShowMenu"); } }); mLocationBar.setMenuButtonHelper(mAppMenuButtonHelper); }
Example 3
Source File: EmptyBackgroundViewTablet.java From delion with Apache License 2.0 | 5 votes |
/** * Creates an on touch listener for the menu button using the given menu handler. * @param menuHandler The menu handler to be used for showing the pop up menu. */ public void setMenuOnTouchListener(final AppMenuHandler menuHandler) { final ImageButton menuBtn = (ImageButton) findViewById(R.id.empty_menu_button); final AppMenuButtonHelper menuPopupButtonHelper = new AppMenuButtonHelper(menuHandler); menuBtn.setOnTouchListener(menuPopupButtonHelper); menuPopupButtonHelper.setOnAppMenuShownListener(new Runnable() { @Override public void run() { RecordUserAction.record("MobileToolbarShowMenu"); } }); }
Example 4
Source File: EmptyBackgroundViewTablet.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Creates an on touch listener for the menu button using the given menu handler. * @param menuHandler The menu handler to be used for showing the pop up menu. */ public void setMenuOnTouchListener(final AppMenuHandler menuHandler) { final ImageButton menuBtn = (ImageButton) findViewById(R.id.empty_menu_button); final AppMenuButtonHelper menuPopupButtonHelper = new AppMenuButtonHelper(menuHandler); menuBtn.setOnTouchListener(menuPopupButtonHelper); menuPopupButtonHelper.setOnAppMenuShownListener(new Runnable() { @Override public void run() { RecordUserAction.record("MobileToolbarShowMenu"); } }); }
Example 5
Source File: ToolbarManager.java From 365browser with Apache License 2.0 | 5 votes |
/** * Sets the handler for any special case handling related with the menu button. * @param menuHandler The handler to be used. */ private void setMenuHandler(AppMenuHandler menuHandler) { menuHandler.addObserver(new AppMenuObserver() { @Override public void onMenuVisibilityChanged(boolean isVisible) { if (mControlsVisibilityDelegate == null) return; if (isVisible) { mFullscreenMenuToken = mControlsVisibilityDelegate.showControlsPersistentAndClearOldToken( mFullscreenMenuToken); } else { mControlsVisibilityDelegate.hideControlsPersistent(mFullscreenMenuToken); mFullscreenMenuToken = FullscreenManager.INVALID_TOKEN; } } @Override public void onMenuHighlightChanged(boolean highlighting) { mToolbar.setMenuButtonHighlight(highlighting); if (mControlsVisibilityDelegate == null) return; if (highlighting) { mFullscreenHighlightToken = mControlsVisibilityDelegate.showControlsPersistentAndClearOldToken( mFullscreenHighlightToken); } else { mControlsVisibilityDelegate.hideControlsPersistent(mFullscreenHighlightToken); mFullscreenHighlightToken = FullscreenManager.INVALID_TOKEN; } } }); mAppMenuButtonHelper = new AppMenuButtonHelper(menuHandler); mAppMenuButtonHelper.setOnAppMenuShownListener(new Runnable() { @Override public void run() { RecordUserAction.record("MobileToolbarShowMenu"); mToolbar.onMenuShown(); } }); }
Example 6
Source File: EmptyBackgroundViewTablet.java From 365browser with Apache License 2.0 | 5 votes |
/** * Creates an on touch listener for the menu button using the given menu handler. * @param menuHandler The menu handler to be used for showing the pop up menu. */ public void setMenuOnTouchListener(final AppMenuHandler menuHandler) { final ImageButton menuBtn = (ImageButton) findViewById(R.id.empty_menu_button); final AppMenuButtonHelper menuPopupButtonHelper = new AppMenuButtonHelper(menuHandler); menuBtn.setOnTouchListener(menuPopupButtonHelper); menuPopupButtonHelper.setOnAppMenuShownListener(new Runnable() { @Override public void run() { RecordUserAction.record("MobileToolbarShowMenu"); } }); }