-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(MD-3347): add drage select for ios * fix: rubber band the selection box * chore: fix lint * fix: resize only when width > 0 * fix: selection interaction * fix: use contain * Update ios/SelectionBand.swift Co-authored-by: Luc Gruska <luc.gruska@qlik.com> * fix: resolve comments Co-authored-by: Vittorio Cellucci <vel@qlik.com> Co-authored-by: Luc Gruska <luc.gruska@qlik.com>
- Loading branch information
1 parent
3b91f88
commit 33eb89e
Showing
14 changed files
with
499 additions
and
113 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// DragBox.swift | ||
// react-native-simple-grid | ||
// | ||
// Created by Vittorio Cellucci on 2022-10-13. | ||
// | ||
|
||
import Foundation | ||
|
||
class DragBox: UIView { | ||
|
||
override func draw(_ rect: CGRect) { | ||
|
||
guard let context = UIGraphicsGetCurrentContext() else {return} | ||
|
||
context.setFillColor(self.backgroundColor?.cgColor ?? UIColor.black.cgColor) | ||
context.fill(rect) | ||
// draw two thin grabbers | ||
// center rect | ||
let width = rect.width * 0.5 | ||
let x = (rect.width - width) / 2.0 | ||
let g = CGRect(origin: CGPoint(x: x, y: rect.height - 4 ), size: CGSize(width: width, height: 1)) | ||
context.setFillColor(UIColor.white.withAlphaComponent(0.5).cgColor) | ||
context.fill(g) | ||
context.fill(g.offsetBy(dx: 0, dy: -2)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.