Skip to content
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

fix: After coming back from result detail, search result come back to the top, not current position #1150 #1183

Merged
merged 1 commit into from
Mar 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_search_results.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</LinearLayout>

<androidx.core.widget.NestedScrollView
android:id="@+id/searchResultsNestedScrollView"
Copy link
Member

Choose a reason for hiding this comment

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

Can you please explain, how defining an id solve the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liveHarshit Well, in short, this is Android View State Storing Mechanism (to retain an amount of information/state if we provide it an id). So for instance, if you're having an EditText and some text in it, I believe the text is also retained after screen rotation if we provide it with an id.

So this is also the way current EventsFragment restoring its position after coming back from EventDetailsFragment.

android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
Expand Down