grote / Transportr

Free Public Transport Assistant without Ads or Tracking
https://transportr.app
GNU General Public License v3.0
1.04k stars 187 forks source link

Migrate from Kotlin synthetics to Jetpack view binding #737

Open ialokim opened 3 years ago

ialokim commented 3 years ago

See https://developer.android.com/topic/libraries/view-binding/migration and https://developer.android.com/topic/libraries/view-binding

AcharyaS97 commented 3 years ago

I've started on this!

AcharyaS97 commented 3 years ago

So I had a question about this. I want to finish this up but having issues with some of the UI pieces (PickTransportNetworkActivity, AboutActivity, AboutFragment, ContributorFragment) that rely on external dependencies for some ui binding. The ui classes in question use some of the mikepenz dependencies:

implementation 'com.mikepenz:aboutlibraries:6.2.0'
implementation "com.mikepenz:fastadapter:$fastadapterVersion"
implementation "com.mikepenz:fastadapter-commons:$fastadapterVersion"
implementation "com.mikepenz:fastadapter-extensions-expandable:5.3.4@aar"

I want to update their versions to the latest because they have been updated to support viewbinding, but I'm a little confused how to do that given the fact the project uses the gradle witness plugin. Would I need to manually update the witness file after updating the dependencies so that the checksum on each updated dependency matches what I see on the versions I update to?

grote commented 3 years ago

Run this script after bumping the dependencies: https://github.com/grote/Transportr/blob/master/update-dependency-pinning.sh

ialokim commented 3 years ago

Be aware that Mike Penz' libraries tend to introduce API breaking changes with new versions. So be sure to test thoroughly all parts of the app using these libraries...

AcharyaS97 commented 3 years ago

@grote Great thanks i'll do that.

@ialokim So then should I add automated tests for related pieces as a part of that?

AcharyaS97 commented 3 years ago

Also, where are all the variables defined that are used as placeholders for dependency versions?

ialokim commented 3 years ago

Also, where are all the variables defined that are used as placeholders for dependency versions?

Did you mean these?

AcharyaS97 commented 3 years ago

yeah. sorry i haven't forgotten about this. i've been having issues with some of the mikepenz libraries and updating those to use viewbinding.

ialokim commented 3 years ago

No problem. Would you want to continue working on it or could you push the changes you already did somewhere so someone else could take over?

AcharyaS97 commented 3 years ago

I wanted to continue working on it. When did you want me to have it in by?

ialokim commented 3 years ago

We have no deadline. I just wanted to make sure that the work that you had already done would not get lost.

I imagine that updating the mikepenz libraries is a big task. Not sure whether we could do the migration in parts, i.e., leaving the fastadapter library updates apart for now?

AcharyaS97 commented 3 years ago

Sure! I'll start committing what I have so far to a branch in my forked repository and submit and a PR for all of it when I've gotten it done. Any pieces that require bigger changes due to libraries being updated I'll leave out. Will summarize in the PR notes what I've left out!