Make swipe-for-details RTL-safe.
This commit is contained in:
parent
596206557f
commit
92ef507810
|
@ -20,7 +20,7 @@ class SlideOffAnimatedTransition: NSObject, UIViewControllerAnimatedTransitionin
|
|||
}
|
||||
|
||||
let width = containerView.frame.width
|
||||
let offsetLeft = fromView.frame.offsetBy(dx: -width, dy: 0)
|
||||
let offsetFrame = fromView.frame.offsetBy(dx: (containerView.isRTL() ? +width : -width), dy: 0)
|
||||
toView.frame = fromView.frame
|
||||
|
||||
fromView.layer.shadowRadius = 15.0
|
||||
|
@ -29,7 +29,7 @@ class SlideOffAnimatedTransition: NSObject, UIViewControllerAnimatedTransitionin
|
|||
|
||||
containerView.insertSubview(toView, belowSubview: fromView)
|
||||
UIView.animate(withDuration: transitionDuration(using: transitionContext), delay:0, options: .curveLinear, animations: {
|
||||
fromView.frame = offsetLeft
|
||||
fromView.frame = offsetFrame
|
||||
|
||||
toView.layer.opacity = 1.0
|
||||
fromView.layer.shadowOpacity = 0.1
|
||||
|
|
|
@ -4211,8 +4211,9 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
{
|
||||
self.currentShowMessageDetailsPanGesture = gestureRecognizer;
|
||||
|
||||
const CGFloat leftTranslation = -1 * [gestureRecognizer translationInView:self.view].x;
|
||||
const CGFloat ratioComplete = Clamp(leftTranslation / self.view.frame.size.width, 0, 1);
|
||||
const CGFloat swipeTranslation
|
||||
= ([gestureRecognizer translationInView:self.view].x * (self.view.isRTL ? +1.f : -1.f));
|
||||
const CGFloat ratioComplete = Clamp(swipeTranslation / self.view.frame.size.width, 0, 1);
|
||||
|
||||
switch (gestureRecognizer.state) {
|
||||
case UIGestureRecognizerStateBegan: {
|
||||
|
|
Loading…
Reference in New Issue