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

Migrate RecentSearch from java to kt #5993

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

neeldoshii
Copy link
Contributor

@neeldoshii neeldoshii commented Dec 4, 2024

recentSearches
)
binding.recentSearchesList.adapter = adapter
binding.recentSearchesList.setOnItemClickListener { _, _, position, _ ->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussion:
Just a followup feature suggestion while using the app. What if we add swipe right, swipe left action on the item to delete particular item?

https://github.com/user-attachments/assets/e9138df6-0340-4330-989f-7a24a080a6af
~ Similar to like this deleting the item by performing swipe action.

Copy link
Member

Choose a reason for hiding this comment

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

That would be a nice extra indeed.
Great to implement if it is short and maintainable. :-)

@neeldoshii neeldoshii changed the title Migrate Feedback module from Java to Kt Migrate RecentSearch from java to kt Dec 4, 2024
@neeldoshii
Copy link
Contributor Author

Hi @psh, can you help me in fixing the null pointer? 😊🫡

@psh
Copy link
Collaborator

psh commented Dec 5, 2024

Hi @psh, can you help me in fixing the null pointer? 😊🫡

It looks like the test setup is bypassing the normal fragment lifecycle. Normally Android would have called onCreateView() before onResume(), the binding would then have been created. Since it's null the "!!" in

private val binding get() = _binding!!

is throwing the exception.

Take a look at ContributionsListFragmentUnitTests and MoreBottomSheetLoggedOutFragmentUnitTests - they both use Google's FragmentScenario to set up their respective fragments under test, and the scenario let's you walk the fragment through its correct lifecycle steps.

@neeldoshii
Copy link
Contributor Author

Will fix this by next week. Taking a break due to university exams.

@neeldoshii neeldoshii marked this pull request as draft December 11, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants