Closed AltNico closed 3 years ago
Same happens after swapping the from and to location twice on my phone after upgrading to Android 10, crDroid/LineageOS.
Unfortunately, I was unable to reproduce both issues on an emulator with stock Android 10 though.
Strangly enough, I know this had happened before on a Samsung device with Android 7.1.1, but today this is not reproducible anymore either.
@grote Do you have any ideas on where to look for the problem here?
Edit: In my case, this location swapping issue only happens seldomly with some stops and with others not...
I was able to tackle down the swap problem to this line: https://github.com/grote/Transportr/blob/7b1866e15ae3cb26a31bb69195bc80dcf51c30c1/app/src/main/java/de/grobox/transportr/locations/LocationView.kt#L128
Therefore it does happen consistently on all devices, but only with stations where the name's lengths differ in one. I'll push a fix in some minutes.
The initially reported problem seems to be a different one though, as "Hauptbahnhof, Frankfurt (Main)" and "Hauptbahnhof, Mainz" do not differ by one. I'm still unable to reproduce this issue with different emulators or real devices.
I suspect the problem to be linked to viewState saving and reloading, perhaps in LocationView
https://github.com/grote/Transportr/blob/7b1866e15ae3cb26a31bb69195bc80dcf51c30c1/app/src/main/java/de/grobox/transportr/locations/LocationView.kt#L146-L175 or in DirectionsFragment
https://github.com/grote/Transportr/blob/7b1866e15ae3cb26a31bb69195bc80dcf51c30c1/app/src/main/java/de/grobox/transportr/trips/search/DirectionsFragment.kt#L151-L169
Perhaps also a problem with Proguard and serializing WrapLocation
s?
@AltNico Does this only happen with the "From" field, or also sometimes with the "To" field?
Edit: Indeed I was now able to reproduce the empty "From" field in the situation described above on a release
build (but still not with debug
).
To Reproduce
Expected behavior
Actual behavior
Versions
Logcat output
Here's the output of adb logcat:
Command as per this Stackoverflow answer.