Skip to content

4664: Moved AdvanceQueryFragment to ViewBinding #5091

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

Conversation

bosankus
Copy link
Contributor

Fixes #4664

What changes did you make and why?

  • Issue: As per the information provided and work request on the ticket above, AdvanceQueryFragment.kt is currently using findViewById which is tedious and not needed, and can cause runtime crashes.
  • Solution: Hence migration was done by replacing findViewById with viewbinding, which is always null safe, type-safe and supports both Java and Kotlin.

@bosankus
Copy link
Contributor Author

Hi @nicolas-raoul Can you approve this too ?

@nicolas-raoul nicolas-raoul merged commit cc24caa into commons-app:master Oct 29, 2022
@nicolas-raoul
Copy link
Member

Oops that seems to make unit tests fail, would you mind fixing the unit test?

fr.free.nrw.commons.nearby.AdvanceQueryFragmentUnitTests > testOnViewCreated FAILED
    java.lang.Exception at AndroidTestEnvironment.java:538
        Caused by: java.lang.NullPointerException at AdvanceQueryFragmentUnitTests.kt:110

@bosankus bosankus deleted the moved-advance-query-fragment-to-viewbinding branch October 29, 2022 17:14
@nicolas-raoul
Copy link
Member

@bosankus Did you get a chance to check the unit tests, maybe?

@bosankus
Copy link
Contributor Author

@nicolas-raoul have not. let me check on this. And update here.

@nicolas-raoul
Copy link
Member

Great, thanks a lot! :-)

@bosankus bosankus restored the moved-advance-query-fragment-to-viewbinding branch November 23, 2022 18:50
@bosankus bosankus deleted the moved-advance-query-fragment-to-viewbinding branch December 18, 2022 03:48
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.

Kotlin Android Extensions & Butterknife are deprecated
2 participants