mapbox / mapbox/mapbox-navigation-android
Mapview starts flicker in Viewpager2 when activate tab
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
**Android API:**
**Mapbox Navigation SDK version:**
implementation("com.mapbox.maps:android:10.14.1")
implementation("com.mapbox.mapboxsdk:mapbox-sdk-turf:6.12.0")
implementation("com.mapbox.plugin:maps-animation:10.15.0-rc.1")
implementation("com.mapbox.plugin:maps-compass:10.15.0-rc.1")
implementation("com.mapbox.plugin:maps-logo:10.15.0-rc.1")
implementation("com.mapbox.plugin:maps-scalebar:10.15.0-rc.1")
### Steps to trigger behavior
1. Using Viewpager2 with Fragment I have three tab in single activity one tab is map. When i tap or activate map fragment then mapview starts flickering. Same xml file which contains map is used at another fragment at different place there is no flicker issue.
2. When i set width of mapview to 500dp then it is working fine. It causes issue when width is match_parent
### Expected behavior
1. When activate tab then map should not flicker in match_parent width
### Actual behavior
3. When i activate tab map starts flickering and when i come back from side fragment in same activity then it is not flickering
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the flicker with MapView inside an Android ViewPager2 Fragment using match_parent width and the listed Mapbox SDK versions; compare it with the 500dp case and the other fragment where the same XML works. Trace the MapView/ViewPager2 lifecycle and layout behavior, then verify that activating the map tab no longer flickers while preserving the match_parent layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100