Adds swipe to delete tab (#10355)
* No Issue - Increases tap area of close button * For #10331 - Adds swipe to delete to the tab trayfennec/production
parent
3dcd52ef7a
commit
94cd195dc7
@ -0,0 +1,17 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.tabtray
|
||||
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import mozilla.components.browser.tabstray.TabTouchCallback
|
||||
import mozilla.components.concept.tabstray.TabsTray
|
||||
import mozilla.components.support.base.observer.Observable
|
||||
|
||||
class TabsTouchHelper(observable: Observable<TabsTray.Observer>) :
|
||||
ItemTouchHelper(object : TabTouchCallback(observable) {
|
||||
override fun alphaForItemSwipe(dX: Float, distanceToAlphaMin: Int): Float {
|
||||
return 1f - 2f * Math.abs(dX) / distanceToAlphaMin
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue