Skip to content

Commit b165cae

Browse files
author
Daniel Dahan
committed
removed FABMenu double hittest issue
1 parent f5c1d6e commit b165cae

File tree

5 files changed

+59
-6
lines changed

5 files changed

+59
-6
lines changed

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

Sources/iOS/FABMenu.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ public protocol FABMenuDelegate {
181181

182182
@objc(FABMenu)
183183
open class FABMenu: View {
184+
/// A flag to avoid the double tap.
185+
fileprivate var shouldAvoidHitTest = false
186+
187+
184188
/// A reference to the SpringAnimation object.
185189
internal let spring = SpringAnimation()
186190

@@ -438,7 +442,10 @@ extension FABMenu {
438442
for v in subviews {
439443
let p = v.convert(point, from: self)
440444
if v.bounds.contains(p) {
441-
delegate?.fabMenu?(fabMenu: self, tappedAt: point, isOutside: false)
445+
if !shouldAvoidHitTest {
446+
delegate?.fabMenu?(fabMenu: self, tappedAt: point, isOutside: false)
447+
}
448+
shouldAvoidHitTest = !shouldAvoidHitTest
442449
return v.hitTest(p, with: event)
443450
}
444451
}

Sources/iOS/PulseAnimation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public struct Pulse {
121121
let h = view.bounds.height
122122

123123
Motion.disable { [
124-
n = w < h ? w : h,
124+
n = .center == animation ? w < h ? w : h : w < h ? h : w,
125125
bounds = layer.bounds,
126126
animation = animation,
127127
color = color,

Sources/iOS/SearchBarController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public enum SearchBarAlignment: Int {
3636
case bottom
3737
}
3838

39-
public extension UIViewController {
39+
extension UIViewController {
4040
/**
4141
A convenience property that provides access to the SearchBarController.
4242
This is the recommended method of accessing the SearchBarController
4343
through child UIViewControllers.
4444
*/
45-
var searchBarController: SearchBarController? {
45+
public var searchBarController: SearchBarController? {
4646
return traverseViewControllerHierarchyForClassType()
4747
}
4848
}

Sources/iOS/ToolbarController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public enum ToolbarAlignment: Int {
3636
case bottom
3737
}
3838

39-
public extension UIViewController {
39+
extension UIViewController {
4040
/**
4141
A convenience property that provides access to the ToolbarController.
4242
This is the recommended method of accessing the ToolbarController
4343
through child UIViewControllers.
4444
*/
45-
var toolbarController: ToolbarController? {
45+
public var toolbarController: ToolbarController? {
4646
return traverseViewControllerHierarchyForClassType()
4747
}
4848
}

0 commit comments

Comments
 (0)