mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 764812 - Only close tabs is dragged to the left or right edge of the tab. r=mfinkle
This commit is contained in:
parent
c7221b4636
commit
6991562d16
@ -328,11 +328,12 @@ public class TabsTray extends LinearLayout
|
||||
|
||||
// if the user was dragging horizontally, check to see if we should close the tab
|
||||
if (dir == DragDirection.HORIZONTAL) {
|
||||
|
||||
int finalPos = 0;
|
||||
if ((start.x > mList.getWidth()/2 && e.getX() < mList.getWidth()/2)) {
|
||||
// if the swipe started on the left and ended in the right 1/4 of the tray
|
||||
// or vice versa, close the tab
|
||||
if ((start.x > mList.getWidth() / 2 && e.getX() < mList.getWidth() / 4)) {
|
||||
finalPos = -1 * mView.getWidth();
|
||||
} else if (start.x < mList.getWidth()/2 && e.getX() > mList.getWidth()/2) {
|
||||
} else if (start.x < mList.getWidth() / 2 && e.getX() > mList.getWidth() * (3 / 4)) {
|
||||
finalPos = mView.getWidth();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user