android.view.TextureView.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中android.view.TextureView.<init>()方法的一些代码示例,展示了TextureView.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextureView.<init>()方法的具体详情如下:
包路径:android.view.TextureView
类名称:TextureView
方法名:<init>

TextureView.<init>介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

super.onCreate(savedInstanceState);
mTextureView = new TextureView(this);
mTextureView.setSurfaceTextureListener(this);

代码示例来源:origin: journeyapps/zxing-android-embedded

private void setupSurfaceView() {
  if(useTextureView) {
    textureView = new TextureView(getContext());
    textureView.setSurfaceTextureListener(surfaceTextureListener());
    addView(textureView);
  } else {
    surfaceView = new SurfaceView(getContext());
    surfaceView.getHolder().addCallback(surfaceCallback);
    addView(surfaceView);
  }
}

代码示例来源:origin: nekocode/CameraFilter

void setupCameraPreviewView() {
  renderer = new CameraRenderer(this);
  textureView = new TextureView(this);
  container.addView(textureView);
  textureView.setSurfaceTextureListener(renderer);
  // Show original frame when touch the view
  textureView.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
      switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
          renderer.setSelectedFilter(R.id.filter0);
          break;
        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_CANCEL:
          renderer.setSelectedFilter(filterId);
          break;
      }
      return true;
    }
  });
  textureView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
    @Override
    public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
      renderer.onSurfaceTextureSizeChanged(null, v.getWidth(), v.getHeight());
    }
  });
}

代码示例来源:origin: google/ExoPlayer

switch (surfaceType) {
 case SURFACE_TYPE_TEXTURE_VIEW:
  surfaceView = new TextureView(context);
  break;
 case SURFACE_TYPE_MONO360_VIEW:

代码示例来源:origin: fanbaoying/FBYIDCardRecognition-Android

public Camera2Control(Context activity) {
  this.context = activity;
  textureView = new TextureView(activity);
}

代码示例来源:origin: stackoverflow.com

protected void onCreate(Bundle savedInstanceState)
{
  super.onCreate(savedInstanceState);
  ResetData();
  _camPreview = new CameraPreview();

  TextureView texView = new TextureView(this);
  _camPreview.Init(texView);

  UnityPlayer.currentActivity.addContentView(texView, new FrameLayout.LayoutParams(400, 400));
}

代码示例来源:origin: stackoverflow.com

protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_camera);

  mPreferences = getSharedPreferences("CurrentUser", MODE_PRIVATE);

  RelativeLayout RL = (RelativeLayout) getWindow().getDecorView().findViewById(android.R.id.content);
  mTextureView = new TextureView(this);
  mTextureView.setSurfaceTextureListener(this);
  RL.addView(mTextureView);
}

代码示例来源:origin: huyongli/TigerVideo

/**
 * 创建一个TextureView
 * 此处单独写成一个方法可以方便后续自定义扩展TextureView
 *
 * @return
 */
protected TextureView newTextureView() {
  return new TextureView(getContext());
}

代码示例来源:origin: fanbaoying/FBYIDCardRecognition-Android

private void setupDisplayView() {
  final TextureView textureView = new TextureView(context);
  previewView.textureView = textureView;
  previewView.setTextureView(textureView);
  displayView = previewView;
  textureView.setSurfaceTextureListener(surfaceTextureListener);
}

代码示例来源:origin: chengzichen/KrGallery

public CameraView(Context context, boolean frontface) {
  super(context, null);
  isFrontface = frontface;
  textureView = new TextureView(context);
  textureView.setSurfaceTextureListener(this);
  addView(textureView);
  focusAreaSize = AndroidUtilities.dp(96);
  outerPaint.setColor(0xffffffff);
  outerPaint.setStyle(Paint.Style.STROKE);
  outerPaint.setStrokeWidth(AndroidUtilities.dp(2));
  innerPaint.setColor(0x7fffffff);
}

代码示例来源:origin: WangShuo1143368701/VideoView

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_camera_texture);
  myTexture = new TextureView(this);
  myTexture.setSurfaceTextureListener(this);
  setContentView(myTexture);
}

代码示例来源:origin: easemob/livestream_demo_android

private void initPreviewTextureView() {
  if (mTexturePreview == null) {
    mTexturePreview = new TextureView(getContext());
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    params.gravity = Gravity.CENTER;
    this.removeAllViews();
    this.addView(mTexturePreview);
    mTexturePreview.setKeepScreenOn(true);
    mTexturePreview.setSurfaceTextureListener(this);
  }
}

代码示例来源:origin: klinker24/Android-SimpleVideoView

new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
textureView = new TextureView(getContext());
textureView.setLayoutParams(surfaceViewParams);
addView(textureView, 0);

代码示例来源:origin: stackoverflow.com

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myTexture = new TextureView(this);
myTexture.setSurfaceTextureListener(this);
setContentView(myTexture);

代码示例来源:origin: rtoshiro/FullscreenVideoView

this.textureView = new TextureView(this.context);
this.textureView.setSurfaceTextureListener(this);

代码示例来源:origin: Tastenkunst/brfv4_android_examples

mTextureView = new TextureView(getContext());
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(PREVIEW_WIDTH, PREVIEW_HEIGHT);
layoutParams.gravity = Gravity.LEFT | Gravity.TOP;

代码示例来源:origin: NodeMedia/NodeMediaClient-Android

public void setRenderType(RenderType renderType) {
  if (mCurrentRenderType == renderType)
    return;
  if (mCurrentRenderType == SURFACEVIEW) {
    SurfaceView sv = (SurfaceView) renderView;
    sv.getHolder().removeCallback(this);
    removeView(renderView);
    renderView = null;
  } else if (mCurrentRenderType == TEXTUREVIEW) {
    TextureView tv = (TextureView) renderView;
    tv.setSurfaceTextureListener(null);
    removeView(renderView);
    renderView = null;
  }
  if (renderType == SURFACEVIEW) {
    SurfaceView sv = new SurfaceView(mContext);
    sv.getHolder().addCallback(this);
    sv.setLayoutParams(deflp);
    renderView = sv;
    addView(renderView);
  } else if (renderType == TEXTUREVIEW) {
    TextureView tv = new TextureView(mContext);
    tv.setSurfaceTextureListener(this);
    tv.setLayoutParams(deflp);
    renderView = tv;
    addView(renderView);
  }
  mCurrentRenderType = renderType;
}

代码示例来源:origin: stackoverflow.com

final TextureView tv = new TextureView(MainActivity.this);

代码示例来源:origin: nekocode/MusicVisualization

final TextureView textureView = new TextureView(this);
mContainerView.addView(textureView);
textureView.setSurfaceTextureListener(mRender = new VisualizerRenderer(this, captureSize / 2));

代码示例来源:origin: Affectiva/affdexme-android

textureView = new TextureView(getActivity());
textureView.setVisibility(View.GONE);
textureView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));

相关文章