Set solid color background drawable with TextureView

This commit is contained in:
artdeell 2022-11-18 09:48:12 +03:00
parent 2041834e6f
commit b81c7c4303

View File

@ -14,6 +14,8 @@ import android.app.*;
import android.content.*;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.*;
import android.util.*;
import android.view.*;
@ -85,8 +87,8 @@ public class MainActivity extends BaseActivity {
CallbackBridge.addGrabListener(minecraftGLView);
// Enabling this on TextureView results in a broken white result
if(PREF_USE_ALTERNATE_SURFACE)
getWindow().setBackgroundDrawable(null);
if(PREF_USE_ALTERNATE_SURFACE) getWindow().setBackgroundDrawable(null);
else getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
// Set the sustained performance mode for available APIs
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)