-
Notifications
You must be signed in to change notification settings - Fork 158
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
Refactor track details components to use org.envirocar.map
module
#1005
Refactor track details components to use org.envirocar.map
module
#1005
Conversation
org.envirocar.app/src/org/envirocar/app/views/trackdetails/MapExpandedActivity.java
Show resolved
Hide resolved
The migrated code appears to be working properly with
Unfortunately, other views which are still dependent on Mapbox v9 directly are crashing due to this. The workaround resolves the compile time issue, but crashes on runtime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an issue with reinstantiating a MapView, which occurs in the TrackListRemoteCardFragment:
FATAL EXCEPTION: main
Process: org.envirocar.app.debug, PID: 15112
java.lang.IllegalStateException: MapView is already initialized with a different MapProvider.
at org.envirocar.map.MapView.getController(MapView.kt:56)
at org.envirocar.app.views.tracklist.AbstractTrackListCardAdapter.setupMapView(AbstractTrackListCardAdapter.kt:185)
at org.envirocar.app.views.tracklist.AbstractTrackListCardAdapter.bindTrackCardViewHolder(AbstractTrackListCardAdapter.kt:103)
at org.envirocar.app.views.tracklist.AbstractTrackListCardAdapter.onBindViewHolder(AbstractTrackListCardAdapter.kt:92)
at org.envirocar.app.views.tracklist.AbstractTrackListCardAdapter.onBindViewHolder(AbstractTrackListCardAdapter.kt:24)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7747)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7847)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6646)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6917)
at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288)
at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345)
at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361)
at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368)
at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
The error occurs, when scrolling throuh the track list. I would expect that the same issue will occur in the TrackListLocalCardFragment, too.
Is it really necessary to throw an error here, when a MapView has been already instantiated. I would say to do nothing in this case or what could go wrong? Maybe just log a warning about it, but do not throw an error.
What do you think?
This pull-request refactors the track details views to utilize the newly introduced map module:
org.envirocar.map
Module #1003The referenced views now use
org.envirocar.map
module instead of Mapbox v9 directly. A substantial part of implementation (primarily the files including any map related code) has been migrated to Kotlin.