Browse Source

Refactored in Main

pull/4/head
Bastian Kohler 1 year ago
parent
commit
6100d17bd2

+ 4
- 9
app/src/main/java/com/example/ueberwachungssystem/MainActivity.java View File

@@ -21,11 +21,6 @@ import com.example.ueberwachungssystem.VideoDetection.VideoDetector;
public class MainActivity extends AppCompatActivity {

private static final int CAMERA_PERMISSION_REQUEST_CODE = 101;
private PreviewView previewView;
private TextView textView;
private ToggleButton toggleButton;
private Boolean cameraPreviewIsRunning = false;
private Boolean isPressed = false;


@Override
@@ -33,16 +28,15 @@ public class MainActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

textView = findViewById(R.id.textView);
previewView = findViewById(R.id.previewView);
toggleButton = findViewById(R.id.previewButton);
TextView textView = findViewById(R.id.textView);
PreviewView previewView = findViewById(R.id.previewView);


VideoDetector vd = new VideoDetector(this);
vd.setPreviewView(previewView);
vd.setOnDetectionListener(new VideoDetector.OnDetectionListener() {
@Override
public void onDetection(DetectionReport detectionReport) {
public void onDetection(@NonNull DetectionReport detectionReport) {
detectionReport.log("OnDetection");
textView.setText(detectionReport.toString());
}
@@ -50,6 +44,7 @@ public class MainActivity extends AppCompatActivity {
//vd.startDetection();


ToggleButton toggleButton = findViewById(R.id.previewButton);
toggleButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

Loading…
Cancel
Save