Skip to content

Commit

Permalink
Merge pull request #1946 from AndBible/feature/show_number_of_results…
Browse files Browse the repository at this point in the history
…_in_search

Show number of search results in window title
  • Loading branch information
tuomas2 authored Jan 13, 2022
2 parents 582b753 + 55935bc commit 1c39531
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ class SearchResults : ListActivityBase(R.menu.empty_menu) {
getString(R.string.search_result_count, mSearchResultsHolder!!.size())
}
withContext(Dispatchers.Main) {
var resultAmount = mSearchResultsHolder?.size().toString()
if(mSearchResultsHolder?.size()?:0 > SearchControl.MAX_SEARCH_RESULTS) {
resultAmount += "+"
}
supportActionBar?.title = getString(R.string.search_with_results, resultAmount)
Toast.makeText(this@SearchResults, msg, Toast.LENGTH_SHORT).show()
}
isOk = true
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<string name="chooseBook">Document</string>
<string name="selectPassage">Passage</string>
<string name="search">Find</string>
<string name="search_with_results">Find (%s results)</string>
<string name="settings">Application preferences</string>
<string name="history">History</string>
<string name="speak">Speak</string>
Expand Down

0 comments on commit 1c39531

Please sign in to comment.