Android
Android copied to clipboard
ViewBinding migration (replacing kotlin synthetics)
Description
We are currently migrating to ViewBinding since Kotlin synthetics have been deprecated.
This is a great opportunity for contributors to help our Android team.
We are accepting contributions to remove kotlin synthetics usages and replace them by using ViewBinding.
Inside our codebase, we have already migrated a bunch of classes that you can use as a reference:
- Fragments: InitialFeedbackFragment, ShareOpenEndedFeedbackFragment, etc.
- Dialogs: DaxDialog
- RecyclerView.ViewHolder: AppIconsAdapter,SearchSuggestionViewHolder, BookmarkSuggestionViewHolder,
- CustomView: TabSwitcherButton
How to work on this issue
But there are still some pending migrations.
- Fragments: EmailAutofillTooltipFragment, SavedSiteDialogFragment, DefaultBrowserPage, WelcomePage, BrowserTabFragment, DownloadConfirmationFragment
- Dialogs: FireDialog
- Adapaters: BookmarksAdapter, FavoritesAdapter, BookmarkFolersAdapter, FavoritesQuickAccessAdapter, etc...
- CustomView: TrackerNetworkLeaderboardPillView
Just leave us a comment that you would like to work on the issue and what classes you will migrate. That will avoid conflicts with other contributions migrating the same classes.
Thanks!
I would like to help with all the fragment classes. Let me know!
@cmonfortep I can take up Dialogs & Adapters
CAN I WORK ON THIS ?
@droid-it sounds great
@cmonfortep I'll start with it then, thank you! Please assign it to me as well..
@droid-it done. Please use as a reference some of our migrate fragments. https://github.com/duckduckgo/Android/pull/1329 we introduced a fragment viewbinding delegate to make viewbinding in fragments easier.
@mslalith I've just noticed we still have some adapters and dialogs using kotlin synthetics: FireproofWebsitesAdapter, LocationPermissionsAdapter, and FireDialog. Could you submit a PR to migrate those pending classes?
@cmonfortep okay
Is it safe to say that this issue has been resolved ?
Do you still need help here?
Hi, I would like to work on this, there are a lot of findviewbyid files+kotlin extenstions. I would like to replace those with viewbinding.
I would like to migrate all the remaining classes.
i have started working on classes if someone is already working on something please let me know
You can work on any of the ones we haven't yet migrated (except browserTabFragment which we will refactor internally since it's too complex)
Thanks! i was bit confused about the two approaches used in the app.
Getter property
kotlin delegate
which one is recommended?
I would also also like to work on this issue , please let me know which classes i can work with i can take up EmailAutofillTooltipFragment and SavedSiteDialogFragment fragments
We will continue the migration internally. Closing the issue.