-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swipe post/comment to upvote/downvote/reply/save (#1327)
* SwipeToAction composable * Swipe to downvote/upvote feature implemented with preset-based customization * Fix kotlin format * fix string resource * Do not use SwipeToAction when it is disabled * Improve scrolling experience * Increase color shift animation speed * Improve ranges * new preset: only votes * fix deltas & rename resources * SwipeToAction implemented correctly, SwipeToDismiss replaced with SwipeToDismissBox, fixed swipe ranges * Kotlin format * use ordinal of enum in AppDB instead of int * Fixed behaviour when downvotes disables/when not logged in * Fix formatting * Remove default param for enableDownVotes in SwipeToAction * Fix colors for swipe actions * Fixed lambda caching in rememberSwipeActionState * Format kotlin --------- Co-authored-by: Dessalines <[email protected]>
- Loading branch information
1 parent
fb11307
commit d71f554
Showing
19 changed files
with
1,060 additions
and
229 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,260 @@ | ||
{ | ||
"formatVersion": 1, | ||
"database": { | ||
"version": 27, | ||
"identityHash": "8e8aa32b002a7ce0d76dfb82e9309bd0", | ||
"entities": [ | ||
{ | ||
"tableName": "Account", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `current` INTEGER NOT NULL, `instance` TEXT NOT NULL, `name` TEXT NOT NULL, `jwt` TEXT NOT NULL, `default_listing_type` INTEGER NOT NULL DEFAULT 0, `default_sort_type` INTEGER NOT NULL DEFAULT 0, `verification_state` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`id`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "id", | ||
"columnName": "id", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "current", | ||
"columnName": "current", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "instance", | ||
"columnName": "instance", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "name", | ||
"columnName": "name", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "jwt", | ||
"columnName": "jwt", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "defaultListingType", | ||
"columnName": "default_listing_type", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "defaultSortType", | ||
"columnName": "default_sort_type", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "verificationState", | ||
"columnName": "verification_state", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"id" | ||
] | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
}, | ||
{ | ||
"tableName": "AppSettings", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `font_size` INTEGER NOT NULL DEFAULT 16, `theme` INTEGER NOT NULL DEFAULT 0, `theme_color` INTEGER NOT NULL DEFAULT 0, `viewed_changelog` INTEGER NOT NULL DEFAULT 0, `post_view_mode` INTEGER NOT NULL DEFAULT 0, `show_bottom_nav` INTEGER NOT NULL DEFAULT 1, `post_navigation_gesture_mode` INTEGER NOT NULL DEFAULT 0, `show_collapsed_comment_content` INTEGER NOT NULL DEFAULT 0, `show_comment_action_bar_by_default` INTEGER NOT NULL DEFAULT 1, `show_voting_arrows_in_list_view` INTEGER NOT NULL DEFAULT 1, `show_parent_comment_navigation_buttons` INTEGER NOT NULL DEFAULT 0, `navigate_parent_comments_with_volume_buttons` INTEGER NOT NULL DEFAULT 0, `use_custom_tabs` INTEGER NOT NULL DEFAULT 1, `use_private_tabs` INTEGER NOT NULL DEFAULT 0, `secure_window` INTEGER NOT NULL DEFAULT 0, `blur_nsfw` INTEGER NOT NULL DEFAULT 1, `show_text_descriptions_in_navbar` INTEGER NOT NULL DEFAULT 1, `markAsReadOnScroll` INTEGER NOT NULL DEFAULT 0, `backConfirmationMode` INTEGER NOT NULL DEFAULT 1, `show_post_link_previews` INTEGER NOT NULL DEFAULT 1, `post_actionbar_mode` INTEGER NOT NULL DEFAULT 0, `auto_play_gifs` INTEGER NOT NULL DEFAULT 0, `swipe_to_action_preset` INTEGER NOT NULL DEFAULT 1)", | ||
"fields": [ | ||
{ | ||
"fieldPath": "id", | ||
"columnName": "id", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "fontSize", | ||
"columnName": "font_size", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "16" | ||
}, | ||
{ | ||
"fieldPath": "theme", | ||
"columnName": "theme", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "themeColor", | ||
"columnName": "theme_color", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "viewedChangelog", | ||
"columnName": "viewed_changelog", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "postViewMode", | ||
"columnName": "post_view_mode", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "showBottomNav", | ||
"columnName": "show_bottom_nav", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "postNavigationGestureMode", | ||
"columnName": "post_navigation_gesture_mode", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "showCollapsedCommentContent", | ||
"columnName": "show_collapsed_comment_content", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "showCommentActionBarByDefault", | ||
"columnName": "show_comment_action_bar_by_default", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "showVotingArrowsInListView", | ||
"columnName": "show_voting_arrows_in_list_view", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "showParentCommentNavigationButtons", | ||
"columnName": "show_parent_comment_navigation_buttons", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "navigateParentCommentsWithVolumeButtons", | ||
"columnName": "navigate_parent_comments_with_volume_buttons", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "useCustomTabs", | ||
"columnName": "use_custom_tabs", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "usePrivateTabs", | ||
"columnName": "use_private_tabs", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "secureWindow", | ||
"columnName": "secure_window", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "blurNSFW", | ||
"columnName": "blur_nsfw", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "showTextDescriptionsInNavbar", | ||
"columnName": "show_text_descriptions_in_navbar", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "markAsReadOnScroll", | ||
"columnName": "markAsReadOnScroll", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "backConfirmationMode", | ||
"columnName": "backConfirmationMode", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "showPostLinkPreviews", | ||
"columnName": "show_post_link_previews", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
}, | ||
{ | ||
"fieldPath": "postActionbarMode", | ||
"columnName": "post_actionbar_mode", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "autoPlayGifs", | ||
"columnName": "auto_play_gifs", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "swipeToActionPreset", | ||
"columnName": "swipe_to_action_preset", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "1" | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": true, | ||
"columnNames": [ | ||
"id" | ||
] | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
} | ||
], | ||
"views": [], | ||
"setupQueries": [ | ||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '8e8aa32b002a7ce0d76dfb82e9309bd0')" | ||
] | ||
} | ||
} |
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.