-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from zhaozilong1988/release/v202312070022
New Features: Magnetic scroll, Flick detecting, Enhance IUITableViewDraggable
- Loading branch information
Showing
15 changed files
with
498 additions
and
266 deletions.
There are no files selected for viewing
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
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,26 @@ | ||
namespace UIKit | ||
{ | ||
/// <summary> | ||
/// Implement this if you want receive events when table view is flicked. | ||
/// </summary> | ||
public interface IUITableViewFlickable : IUITableViewInteractable | ||
{ | ||
/// <summary> | ||
/// The flick will not be triggered if flicked distance outside of this range. | ||
/// </summary> | ||
/// <returns>Flick trigger range: units/sec</returns> | ||
(float lower, float upper) FlickDistanceRangeOfTriggerFlickInTableView(UITableView tableView); | ||
/// <summary> | ||
/// The flick will not be triggered if flicked time outside of this range. | ||
/// </summary> | ||
/// <returns>Flick trigger time: sec</returns> | ||
float FlickTimeOfTriggerFlickInTableView(UITableView tableView); | ||
/// <summary> | ||
/// The flick is triggered. | ||
/// </summary> | ||
/// <param name="tableView">tableView</param> | ||
/// <param name="indexOfFlickedCell">flicked cell</param> | ||
/// <param name="direction">flicked direction</param> | ||
void TableViewOnDidFlick(UITableView tableView, int? indexOfFlickedCell, UITableViewDirection direction); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using UnityEngine; | ||
|
||
namespace UIKit | ||
{ | ||
/// <summary> | ||
/// Implement this if you want a magnetic alignment when scrolling stops. | ||
/// </summary> | ||
public interface IUITableViewMagneticAlignment | ||
{ | ||
/// <summary> | ||
/// When the scrolling speed is below this threshold, magnetic alignment will be triggered. | ||
/// </summary> | ||
/// <returns>Speed:n units/sec</returns> | ||
float SpeedOfTriggerMagneticAlignmentInTableView(UITableView tableView); | ||
/// <summary> | ||
/// The speed used during magnetic alignment completion. | ||
/// </summary> | ||
/// <returns>Speed:n units/sec</returns> | ||
float SpeedOfCompleteMagneticAlignmentInTableView(UITableView tableView); | ||
/// <summary> | ||
/// The calibration point for where the magnetic alignment will be aimed. | ||
/// </summary> | ||
/// <returns>Calibration point(Vector.zero: for top or rightmost ~ Vector.one: for bottom or leftmost)</returns> | ||
Vector2 CalibrationPointOfMagneticAlignmentInTableView(UITableView tableView); | ||
/// <summary> | ||
/// Notify when magnetic alignment state changed. | ||
/// </summary> | ||
/// <param name="tableView">tableView</param> | ||
/// <param name="ofCellIndex">Index of cell which is aimed by magnetic alignment</param> | ||
/// <param name="state">UITableViewMagneticState</param> | ||
void MagneticStateDidChangeInTableView(UITableView tableView, int ofCellIndex, UITableViewMagneticState state); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/UIKit/UITableView/IUITableViewMagneticAlignment.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.