Skip to content

fix: Retain searchview state in SearchFragment #1756

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

Merged
merged 1 commit into from
May 14, 2019
Merged

fix: Retain searchview state in SearchFragment #1756

merged 1 commit into from
May 14, 2019

Conversation

anhanh11001
Copy link
Contributor

Detail:

  • Retain search query in SearchFragment and require focus when making search on screen rotation

Fixes: #862

Screenshots for the change:
ezgif-4-41d82fe2dbf4

@auto-label auto-label bot added the fix label May 12, 2019
@@ -127,11 +128,22 @@ class SearchFragment : Fragment() {
rootView.fabSearch.setOnClickListener {
queryListener.onQueryTextSubmit(searchView.query.toString())
}

if (searchViewModel.isQuerying) {
Handler().post {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a memory leak btw

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addiegupta thanks for the warning, I will take a look at that. Initially I user this because there were some problems on rendering the view of the action bar. Will fix this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anhanh11001 😂😂 Wrong Aditya

Detail:

Retain search query in SearchFragment and require focus when making search on screen rotation
Fixes: #862
@anhanh11001
Copy link
Contributor Author

updated. please review @liveHarshit

@iamareebjamal iamareebjamal merged commit 86242f2 into fossasia:development May 14, 2019
@anhanh11001 anhanh11001 deleted the 862_search_view_rotate branch June 20, 2019 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SearchView closes and data lost on rotation in search fragment.
3 participants