Skip to content

Commit

Permalink
Add: User Configurable Swipe To Paginate Threshold User Preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivamAmin committed Apr 7, 2024
1 parent 706afdb commit 2d70a29
Show file tree
Hide file tree
Showing 11 changed files with 3,096 additions and 5 deletions.
3 changes: 3 additions & 0 deletions API/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public async Task<ActionResult<UserPreferencesDto>> UpdatePreferences(UserPrefer
existingPreferences.BookReaderFontSize = preferencesDto.BookReaderFontSize;
existingPreferences.BookReaderTapToPaginate = preferencesDto.BookReaderTapToPaginate;
existingPreferences.BookReaderSwipeToPaginate = preferencesDto.BookReaderSwipeToPaginate;
existingPreferences.BookReaderScrollThreshold = preferencesDto.BookReaderScrollThreshold;
existingPreferences.BookReaderDistanceThreshold = preferencesDto.BookReaderDistanceThreshold;
existingPreferences.BookReaderSpeedThreshold = preferencesDto.BookReaderSpeedThreshold;
existingPreferences.BookReaderReadingDirection = preferencesDto.BookReaderReadingDirection;
existingPreferences.BookReaderWritingStyle = preferencesDto.BookReaderWritingStyle;
existingPreferences.BookThemeName = preferencesDto.BookReaderThemeName;
Expand Down
12 changes: 12 additions & 0 deletions API/DTOs/UserPreferencesDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ public class UserPreferencesDto
[Required]
public bool BookReaderSwipeToPaginate { get; set; }
/// <summary>
/// Book Reader Option: Sets scroll threshold for swipe pagination
/// </summary>
public int BookReaderScrollThreshold { get; set; } = 30;
/// <summary>
/// Book Reader Option: Sets distance threshold for swipe pagination
/// </summary>
public int BookReaderDistanceThreshold { get; set; } = 30;
/// <summary>
/// Book Reader Option: Sets speed threshold for swipe pagination
/// </summary>
public double BookReaderSpeedThreshold { get; set; } = 50;
/// <summary>
/// Book Reader Option: What direction should the next/prev page buttons go
/// </summary>
[Required]
Expand Down
Loading

0 comments on commit 2d70a29

Please sign in to comment.