0

I have a javacameraview in my main activity. I would like to put some control buttons in front of the camera

<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.gustavo.tassio.opencvnativeandroid.Principal">

<org.opencv.android.JavaCameraView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone"
    app:show_fps="true"
    app:camera_id="any"
    android:id="@+id/cameraOpenCv"/>

JavaCameraView cameraView;
    cameraView = (JavaCameraView) findViewById(R.id.cameraOpenCv);
    cameraView.setVisibility(SurfaceView.VISIBLE);
    cameraView.setCvCameraViewListener(this);

it is like this now, just the pure image, my idea is to put the buttons on this scene

https://i.stack.imgur.com/9YKyP.jpg

Miki
  • 40,887
  • 13
  • 123
  • 202

1 Answers1

0

If you add buttons to your framelayout, they will be displayed as you wish. The views in framelayout are displayed in chronological order. When you change visibility of a subview of a framelayout, it's order does not change, all subviews that you added after it either in xll or programmatically will be drawn "above".

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307