Skip to content

Commit 08e3278

Browse files
pengdevgithub-actions[bot]
authored andcommitted
Make ViewPager example tabs visible over map content (#10608)
### Summary Fixes [MAPSAND-2430](https://mapbox.atlassian.net/browse/MAPSAND-2430) - `PagerTabStrip` in the ViewPager example had no background, rendering tab text directly over map tiles — invisible on most map styles - Added a semi-transparent dark background and white text color to ensure readability ### Problem `PagerTabStrip` rendered without a background, so its text was painted directly on top of the map. On styles like globe, dark street, and satellite, the text was effectively invisible. ### Solution Added `android:background="#CC303030"` (semi-transparent dark overlay) and `android:textColor="@android:color/white"` to the `PagerTabStrip` in `activity_viewpager.xml`. ### Key Changes - **File**: `projects/maps-android/mapbox-maps-android/app/src/main/res/layout/activity_viewpager.xml` - **Before** -> **After**: No background/text color -> `#CC303030` background + white text ### Validation - [x] Tested on Pixel 6 Pro (Android 16) - [x] Tabs visible across globe, dark street, and satellite styles - [x] No crashes <img width="1440" height="3120" alt="viewpager-tabs-fix" src="https://github.com/user-attachments/assets/f7a13672-ad31-4f51-af51-cdfee636bf6d" /> cc @mapbox/maps-android GitOrigin-RevId: e20236125c03c31c3cba054c6819ab9c9866def7
1 parent d3f3604 commit 08e3278

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

app/src/main/res/layout/activity_viewpager.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
android:layout_width="match_parent"
1414
android:layout_height="wrap_content"
1515
android:layout_gravity="top"
16+
android:background="@color/semi_transparent_dark"
17+
android:textColor="@android:color/white"
1618
android:paddingBottom="4dp"
1719
android:paddingTop="4dp"/>
1820

app/src/main/res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
<color name="red">#f74e4e</color>
1111
<color name="simi_transparent_blue">#334264fb</color>
1212
<color name="black">#000000</color>
13+
<color name="semi_transparent_dark">#CC303030</color>
1314
</resources>

0 commit comments

Comments
 (0)