Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

setForeground not working for wear devices using GLSurfaceView #260

Closed
tobrun opened this issue Apr 16, 2019 · 2 comments
Closed

setForeground not working for wear devices using GLSurfaceView #260

tobrun opened this issue Apr 16, 2019 · 2 comments
Labels

Comments

@tobrun
Copy link
Member

tobrun commented Apr 16, 2019

We use View.setForeground(R.color.someColor) to hide the black surface of GLSurfaceView until we have rendered the background of a style to provide a better user experience. Android wear watches however, running 8.0.0, don't draw the foreground color:

ezgif com-video-to-gif (62)

Workaround is to use a TexureView instead.

@tobrun
Copy link
Member Author

tobrun commented Aug 21, 2019

Looking more into this and I'm also able to reproduce this for TextureView but only with initial launch. Since this a wear only issue, I'm suggesting to use an overlain transparent View. With this the foreground color (issue from OP) seems to be working again.

<FrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <com.mapbox.mapboxsdk.maps.MapView
            android:id="@+id/mapView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:deviceIds="wear"
            tools:mapbox_renderTextureMode="true" />

    <View
            android:background="@android:color/transparent"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

</FrameLayout>

@zugaldia zugaldia transferred this issue from mapbox/mapbox-gl-native Mar 6, 2020
@stale stale bot added the archived label Sep 5, 2020
@stale
Copy link

stale bot commented Sep 12, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant