5package org.qtproject.qt.android;
7import android.annotation.SuppressLint;
8import android.content.Context;
9import android.graphics.SurfaceTexture;
10import android.view.Surface;
11import android.view.TextureView;
13@SuppressLint(
"ViewConstructor")
14class QtTextureView extends TextureView implements TextureView.SurfaceTextureListener
17 private boolean m_staysOnTop;
18 private Surface m_surface;
24 setFocusableInTouchMode(
false);
25 m_surfaceCallback = surfaceCallback;
26 setSurfaceTextureListener(
this);
28 setSurfaceTexture(
new SurfaceTexture(
false));
32 public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture,
int width,
int height) {
33 m_surface =
new Surface(surfaceTexture);
34 m_surfaceCallback.onSurfaceChanged(m_surface);
38 public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture,
int width,
int height) {
39 m_surface =
new Surface(surfaceTexture);
40 m_surfaceCallback.onSurfaceChanged(m_surface);
44 public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
45 m_surfaceCallback.onSurfaceChanged(
null);
50 public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
static const QString context()