use of org.chromium.chrome.browser.appmenu.AppMenuButtonHelper in project AndroidChromium by JackyAndroid.
the class EmptyBackgroundViewTablet method setMenuOnTouchListener.
/**
* 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");
}
});
}
use of org.chromium.chrome.browser.appmenu.AppMenuButtonHelper in project AndroidChromium by JackyAndroid.
the class ToolbarManager method setMenuHandler.
/**
* 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);
}
Aggregations