Feature: Save contents of the search box between searches - #213
Feature: Save contents of the search box between searches#213podzolelements wants to merge 11 commits into
Conversation
|
|
||
| private EditText searchField; | ||
|
|
||
| private static final StringBuffer previousSearch = new StringBuffer(); |
There was a problem hiding this comment.
Why StringBuffer? Please check differences with StringBuilder
There was a problem hiding this comment.
As far as I can tell the StringBuffer is a thread-safe StringBuilder (at the cost of a bit of performance; for practical purposes I don't think it matters if this test is to be believed) and I wasn't sure how this would interplay with the callbacks and wanted to play it safe. I've since changed it to a StringBuilder
|
@podzolelements some suggestions from AI: 1.
|
|
@podzolelements please also use https://github.com/max-kammerer/orion-viewer/blob/master/docs/architecture.md. Feel free to ask any questions |
|
|
@podzolelements Thank you for changes! I've made second round of review, new field in SearchDialog looks redundant - it could be simply read from temp options, and writed back on changes. Property type could be simple |
|
I had the field to reduce the verbosity of |
|
@podzolelements Cool! What about adding simple UI test for new feature? You can use ZoomTest as example or other espresso tests in same folder. |
While doing some testing on my EPUB fork, I found if you close out of the search box, the searched text does not get preserved; behavior inconsistent from most applications I've used. This means if you want to search for the same string of text multiple times (either between closing the search box or across different documents), you must retype out the search every time you open the search box.
This PR introduces this search-saving functionality, which can be disabled in the settings if desired.
Additionally, I changed it so pressing the enter button in the search box performs the same action as hitting the
>next search button, as currently it doesn't do anything other than close the keyboard.Before
before.webm
After
after.webm
Setting toggle is under
Application Settings > Controls and Behavior > Default Behavior, and is enabled by default:Some notes: