-
-
Notifications
You must be signed in to change notification settings - Fork 158
Feature #384 calculation bookmarks #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature #384 calculation bookmarks #605
Conversation
- added Bookmark.kt - data class for individual bookmarks, same structure as History.kt - added BookmarksAdapter.kt - for building the recycler view and listeners, very similar style and structure to HistoryAdapter.kt - updated MyPreferences.kt - added bookmark constants, setters and CRUD functions
MainActivity.kt - added Bookmarks RecyclerView setup - added setSwipeTouchHelperForBookmarks() function to delete a bookmark on swipe as in history - added addBookmark() function which bookmarks a calculation - in onResume added runCatching block to refresh bookmarks layout/activity_main.xml - added RecyckerView for Bookmarks to layout/activity_main.xml, layout-land/activity_main.xml, layout-sw-720dp-land/activity_main.xml values/strings.xml - added nothing_to_bookmark and bookmarked string resources
MainActivity.kt - history/bookmarks tabs setup -> default to History tab - added showHistoryList(), showBookmarksList() functions acitivity_main.xml - changed constraint/borders to the tabs and recycler views in all three layouts strings.xml - added bookmarks tab title
MainActivity.kt - updated History/Bookmarks tabs setup, so the sliding panel recycler view is always rendered on top of the calculator buttons to resolve the late rendering of calculator buttons on collapsing activity_main.xml for every layout - added umano overlay and updated paddings strings.xml - added string resource for history tab title
MainActivity.kt - updated addBookmark() function - added bookmark button setup - added currentCalcAndResult() and updateBookmarkIcon() helpers - added updateBookmarkIcon() function call to every place where the calculation is calculated or cleared activity_main.xml - added Bookmark ImageButton - added two bookmark icons to res/drawable/
addBookmark() -> toggleBookmark() - updated the function to toggle the adding or removing of a bookmark for a calculation by clicking on the bookmark icon
MainActivity.kt - added clearBookmarks() function which builds and shows an alert modal and after confirmation deletes all saved bookmarks app_menu.xml - added Clear bookmarks item strings.xml - added strings for the clear bookmarks alert modals
BookmarksAdapter.kt - fixed incorrect grouping of calculations based on relative time to look exactly like history MainActivity.kt - sync the scrollableView with the selected tab, so either history or bookmarks recycler view activity_main.xml - updated layouts to fix the weird scrolling on weird collapsing when clicking on the last two elements in the recycler view in the bookmarks tab by using a barrier and updating constraint for the history_sliding_layout_button
MainActivity.kt - added checkEmptyBookmarksForNoBookmarksLabel() function and updated checkEmptyHistoryForNoHistoryLabel() function to check if we are currently on history or bookmarks tab and if there are no history or bookmark entries - updated showHistoryList() and showBookmarksList() functions - added checkEmptyBookmarksForNoBookmarksLabel() calls after every bookmarks list mutation/deletion activity_main.xml - added TextView element for the no bookmarks text to all three layouts strings.xml - added no bookmarks available string
|
This is a greate update. Btw, i think the bookmark button is too big, it does not fit the app design. In addition, i think we should be able to bookmark a calculation from the history section by left slide for example. |
MainActivity.kt - modified the onSwiped function in setSwipeTouchHelperForRecyclerView(), so that left swipe deletes and right swipe adds history element to bookmarks without deleting it from history strings.xml - added "Added to bookmarks" string to show on history tab after right swipe activity_maina.xml - made the bookmark icon smaller in all layouts
|
I've modified the swiping functionality on the history tab:
I've also made the bookmark icon smaller, so that it's not as distracting as before. |
|
Thanks! I will review this pull requests asap |
|
The update is good, but I see several details to fix:
|
|
Ok, so as for the details you mentioned I would like a few clarifications, so I know what to fix/change:
|
Added Functionality
Here is a short PDF file containing the aforementioned functionality with added screenshots from the app for better demonstration of the added functionality:
OpenCalc_384_bookmarks.pdf
I tried to implement it correctly across all layouts and with minimal changes to the already existing implementations, but if you find any bugs, weird behaviour or wonky/broken UI feel free to tell me.