Skip to content

Commit

Permalink
Considering RTL for velocity too
Browse files Browse the repository at this point in the history
  • Loading branch information
fermoya committed Jul 20, 2022
1 parent 6f9c413 commit 4ddc04c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Example/SwiftUIPagerExample/he.lproj/LaunchScreen.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion Sources/SwiftUIPager/PagerContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ extension Pager.PagerContent {

var dragResult: (page: Int, increment: Int) {
let currentPage = self.currentPage(sensitivity: sensitivity.value)
let velocity = -self.draggingVelocity
let velocity = -self.draggingVelocity * (Locale.current.isRightToLeft ? -1 : 1)

guard allowsMultiplePagination else {
var newPage = currentPage
Expand Down

2 comments on commit 4ddc04c

@metin-atalay
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Dear,
I do not want to use Locale.current. I want to set this manually. How can I do?

@metin-atalay
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language of the phone and the language of my application may be different so I have to give this param from outside.

Please sign in to comment.