app/internal/window: [Android] work around flickering on ChromeOS

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-07-22 21:14:35 +02:00
parent 9ac8c80d15
commit e381ff40d6
+5
View File
@@ -12,6 +12,7 @@ import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Build;
import android.text.Editable;
@@ -56,6 +57,10 @@ public final class GioView extends SurfaceView implements Choreographer.FrameCal
// Late initialization of the Go runtime to wait for a valid context.
Gio.init(context.getApplicationContext());
// Set background color to transparent to avoid a flickering
// issue on ChromeOS.
setBackgroundColor(Color.argb(0, 0, 0, 0));
ViewConfiguration conf = ViewConfiguration.get(context);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
scrollXScale = conf.getScaledHorizontalScrollFactor();