зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1155819 - Set anchor as back button for tablets. r=ally
--HG-- extra : rebase_source : 0e877a56a15b14b4cc35c4a6744e17666b745b02
This commit is contained in:
Родитель
b91d35ed33
Коммит
58d0b4eaf4
|
@ -127,6 +127,11 @@ abstract class BrowserToolbarTabletBase extends BrowserToolbar {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getDoorHangerAnchor() {
|
||||
return backButton;
|
||||
}
|
||||
|
||||
protected boolean canDoBack(final Tab tab) {
|
||||
return (tab.canDoBack() && !isEditing());
|
||||
}
|
||||
|
|
|
@ -100,11 +100,15 @@ public abstract class AnchoredPopup extends PopupWindow {
|
|||
return;
|
||||
}
|
||||
|
||||
// If the anchor is null or out of the window bounds, just show the popup at the top of the
|
||||
// root view.
|
||||
final boolean validAnchor = (mAnchor != null) && (anchorLocation[1] > 0);
|
||||
final View anchor = validAnchor ? mAnchor : decorView;
|
||||
if (HardwareUtils.isTablet()) {
|
||||
showAsDropDown(mAnchor, 0, 0);
|
||||
} else {
|
||||
// If the anchor is null or out of the window bounds, just show the popup at the top of the
|
||||
// root view.
|
||||
final boolean validAnchor = (mAnchor != null) && (anchorLocation[1] > 0);
|
||||
final View anchor = validAnchor ? mAnchor : decorView;
|
||||
|
||||
showAtLocation(anchor, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, offsetY);
|
||||
showAtLocation(anchor, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче