Compare commits
15
Commits
bef5d03494
..
lm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81c3542654 | ||
|
|
d33ab299ab | ||
|
|
8a5d720685 | ||
|
|
90aea5b1bc | ||
|
|
8a357e0d26 | ||
|
|
83268c763b | ||
|
|
3d02d8d4c0 | ||
|
|
cafe763c4a | ||
|
|
2cff334056 | ||
|
|
6c4905d0e7 | ||
|
|
402b73e4bd | ||
|
|
9e5b669986 | ||
|
|
8275d8bd5a | ||
|
|
4999f1b998 | ||
|
|
620528302e |
No files matched your search
@@ -0,0 +1,3 @@
|
||||
Sensor als Service einrichten, der aus Activity heraus gestartet werden kann.
|
||||
Stichwort: Intent
|
||||
Siehe Skript Teil 1
|
||||
@@ -36,13 +36,4 @@ dependencies {
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
|
||||
// Required for CameraX
|
||||
def camerax_version = "1.2.2"
|
||||
implementation "androidx.camera:camera-core:${camerax_version}"
|
||||
implementation "androidx.camera:camera-camera2:${camerax_version}"
|
||||
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
|
||||
implementation "androidx.camera:camera-video:${camerax_version}"
|
||||
implementation "androidx.camera:camera-view:${camerax_version}"
|
||||
implementation "androidx.camera:camera-extensions:${camerax_version}"
|
||||
}
|
||||
@@ -2,9 +2,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-feature android:name="android.hardware.camera"/>
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.example.ueberwachungssystem.Detection;
|
||||
|
||||
import static java.lang.Math.sqrt;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
|
||||
|
||||
/**
|
||||
* Accelerometer inherits some methods from abstract Detector class (more info there)
|
||||
*
|
||||
*
|
||||
* USE FROM MAIN ACTIVITY:
|
||||
*
|
||||
* Accelerometer beschleunigungssensor = new Accelerometer(this);
|
||||
* onCreate:
|
||||
* //Accelerometer Setup
|
||||
* beschleunigungssensor = new Accelerometer(this, logger, textViewLog); //logger and textview only for debugging necessary
|
||||
* beschleunigungssensor.getSensor();
|
||||
*
|
||||
* //Starting Detection:
|
||||
* beschleunigungssensor.startDetection();
|
||||
* //Stopping Detection: also recommended at onPause to avoid unnecessary battery consumption
|
||||
* beschleunigungssensor.stopDetection();
|
||||
*
|
||||
* */
|
||||
|
||||
public class Accelerometer extends Detector implements SensorEventListener {
|
||||
|
||||
public SensorManager sensorManager;
|
||||
private static final int sensorType = Sensor.TYPE_LINEAR_ACCELERATION;
|
||||
private Sensor accelerometer;
|
||||
private Context context;
|
||||
boolean alarm = false;
|
||||
//Preallocate memory for the data of each axis of the acceleration sensor
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float betrag; //Betrag aller drei Achsen sqrt(x*x + y*y + z*z)
|
||||
private DetectionReport detectionReport;
|
||||
|
||||
// In constructor pass Activity, Context and TextView from MainActivity in Accelerometer class
|
||||
public Accelerometer(Context context){
|
||||
super(context); //von Detektor
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void getSensor(){
|
||||
sensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
|
||||
if(sensorManager.getSensorList(sensorType).size()==0) {
|
||||
accelerometer = null;
|
||||
}
|
||||
else {
|
||||
accelerometer = sensorManager.getSensorList(sensorType).get(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSensorChanged(SensorEvent event) {
|
||||
try {
|
||||
checkAlarm(event);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void checkAlarm (SensorEvent event) throws InterruptedException {
|
||||
x = event.values[0];
|
||||
y = event.values[1];
|
||||
z = event.values[2];
|
||||
betrag = (float) sqrt(x*x + y*y + z*z);
|
||||
float threshold = 1.5F;
|
||||
|
||||
if (!alarm) {
|
||||
if (betrag > threshold) {
|
||||
alarm = true;
|
||||
detectionReport = new DetectionReport("Accelerometer1", "Bewegung", betrag);
|
||||
reportViolation("Accelo1", "Bewegung", betrag);
|
||||
}
|
||||
} else {
|
||||
if (betrag < threshold) {
|
||||
alarm = false;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startDetection() {
|
||||
// entspricht void start()
|
||||
//getSensor();
|
||||
if (accelerometer != null) {
|
||||
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_GAME);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopDetection() {
|
||||
// entspricht void stop()
|
||||
sensorManager.unregisterListener(this, accelerometer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.example.ueberwachungssystem.Detection;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
/** Detection Report Class */
|
||||
public class DetectionReport {
|
||||
public String timeStamp;
|
||||
public String detectionType;
|
||||
public float detectedValue;
|
||||
public String detectorID;
|
||||
|
||||
public DetectionReport(String detectorID, String detectionType, float detectedAmplitude) {
|
||||
this.timeStamp = String.valueOf(Calendar.getInstance().getTime());
|
||||
this.detectionType = detectionType;
|
||||
this.detectedValue = detectedAmplitude;
|
||||
this.detectorID = detectorID;
|
||||
}
|
||||
|
||||
|
||||
/** Get Detection Report in String format */
|
||||
public String toString() {
|
||||
String time = "Time: " + "[" + this.timeStamp + "]";
|
||||
String type = "Type: " + "[" + this.detectionType + "]";
|
||||
String value = "Value: " + "[" + this.detectedValue + "]";
|
||||
String id = "ID: " + "[" + this.detectorID + "]";
|
||||
|
||||
return String.join("\t", time, type, value, id);
|
||||
}
|
||||
|
||||
/** Debug Report */
|
||||
public void log(String tag) {
|
||||
Log.d(tag, this.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.example.ueberwachungssystem.Detection;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
|
||||
abstract public class Detector {
|
||||
private OnDetectionListener listener;
|
||||
|
||||
/** Constructor - takes context of current activity */
|
||||
public Detector(Context context) {};
|
||||
|
||||
|
||||
/** On Detection Listener - runs when violation is reported */
|
||||
public interface OnDetectionListener {
|
||||
void onDetection(@NonNull DetectionReport detectionReport);
|
||||
}
|
||||
public void setOnDetectionListener(@NonNull OnDetectionListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
|
||||
/** Triggers onDetectionListener - call this to trigger violation/alarm */
|
||||
public void reportViolation(String detectorID, String detectionType, float amplitude) {
|
||||
if (listener != null) {
|
||||
DetectionReport detectionReport = new DetectionReport(detectorID, detectionType, amplitude);
|
||||
listener.onDetection(detectionReport);
|
||||
} else {
|
||||
throw new IllegalStateException("No listener set for violation reporting");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Starts Detection (abstract method: needs to be overridden in child class) */
|
||||
public abstract void startDetection();
|
||||
|
||||
/** Stops Detection (abstract method: needs to be overridden in child class) */
|
||||
public abstract void stopDetection();
|
||||
}
|
||||
@@ -2,125 +2,71 @@ package com.example.ueberwachungssystem;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.camera.core.Camera;
|
||||
import androidx.camera.core.CameraSelector;
|
||||
import androidx.camera.core.Preview;
|
||||
import androidx.camera.lifecycle.ProcessCameraProvider;
|
||||
import androidx.camera.view.PreviewView;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.camera.core.ExperimentalGetImage;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.example.ueberwachungssystem.Detection.Accelerometer;
|
||||
import com.example.ueberwachungssystem.Detection.DetectionReport;
|
||||
import com.example.ueberwachungssystem.Detection.Detector;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
@ExperimentalGetImage
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private static final int CAMERA_PERMISSION_REQUEST_CODE = 101;
|
||||
private PreviewView previewView;
|
||||
private TextView textView;
|
||||
private Button previewButton;
|
||||
private Boolean cameraPreviewIsRunning = false;
|
||||
private Boolean isPressed = false;
|
||||
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private Accelerometer beschleunigungssensor;
|
||||
private TextView textViewLog;
|
||||
private Button button1;
|
||||
ToggleButton toggleButton1;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setTitle(this.getClass().getSimpleName());
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
textView = findViewById(R.id.textView);
|
||||
previewView = findViewById(R.id.previewView);
|
||||
previewButton = findViewById(R.id.previewButton);
|
||||
|
||||
toggleButton1 = findViewById(R.id.toggleButton1); //togglebutton um Detektion zu steuern
|
||||
toggleButton1.setOnClickListener(this);
|
||||
|
||||
VideoDetector vd = new VideoDetector(this);
|
||||
vd.setPreviewView(previewView);
|
||||
vd.startDetection();
|
||||
//Button to clear Log while Debugging
|
||||
button1 = (Button) findViewById(R.id.button1);
|
||||
button1.setOnClickListener(this);
|
||||
|
||||
previewButton.setOnClickListener(new View.OnClickListener() {
|
||||
//Accelerometer Setup
|
||||
beschleunigungssensor = new Accelerometer(this); //logger and textview only for debugging necessary
|
||||
beschleunigungssensor.getSensor();
|
||||
beschleunigungssensor.setOnDetectionListener(new Detector.OnDetectionListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getCameraAccess();
|
||||
if (isCameraAccessAllowed() && !isPressed)
|
||||
{
|
||||
vd.stopDetection();
|
||||
isPressed = true;
|
||||
}
|
||||
else if (isCameraAccessAllowed() && isPressed) {
|
||||
vd.startDetection();
|
||||
isPressed = false;
|
||||
}
|
||||
public void onDetection(@NonNull DetectionReport detectionReport) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isCameraAccessAllowed() {
|
||||
return ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
private void getCameraAccess() {
|
||||
if (!isCameraAccessAllowed())
|
||||
ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.CAMERA}, CAMERA_PERMISSION_REQUEST_CODE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
beschleunigungssensor.stopDetection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(v == toggleButton1) {
|
||||
if (toggleButton1.isChecked()) {
|
||||
beschleunigungssensor.startDetection();
|
||||
|
||||
if (requestCode == CAMERA_PERMISSION_REQUEST_CODE && grantResults.length > 0) {
|
||||
boolean cameraRights = grantResults[0] == PackageManager.PERMISSION_GRANTED;
|
||||
if (cameraRights) {
|
||||
Toast.makeText(this, "camera permission granted", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toast.makeText(this, "camera permission denied", Toast.LENGTH_LONG).show();
|
||||
beschleunigungssensor.stopDetection();
|
||||
}
|
||||
} else if (v == button1) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void previewCamera() {
|
||||
// Request Camera Access
|
||||
getCameraAccess();
|
||||
// Return when Camera Access not allowed or Camera Preview is running
|
||||
if (!isCameraAccessAllowed() || cameraPreviewIsRunning)
|
||||
return;
|
||||
// Camera Preview is running
|
||||
cameraPreviewIsRunning = true;
|
||||
// Request Camera Provider
|
||||
final ListenableFuture<ProcessCameraProvider> cameraProviderFuture = ProcessCameraProvider.getInstance(this);
|
||||
//Check for Camera availability
|
||||
cameraProviderFuture.addListener(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
ProcessCameraProvider cameraProvider = cameraProviderFuture.get();
|
||||
bindPreview(cameraProvider);
|
||||
} catch (ExecutionException | InterruptedException e) {
|
||||
// No errors need to be handled for this Future. This should never be reached.
|
||||
}
|
||||
}
|
||||
},ContextCompat.getMainExecutor(this));
|
||||
}
|
||||
|
||||
private void bindPreview(@NonNull ProcessCameraProvider cameraProvider) {
|
||||
// Create Preview
|
||||
Preview preview = new Preview.Builder().build();
|
||||
// Specify which Camera to use
|
||||
CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing(CameraSelector.LENS_FACING_BACK).build();
|
||||
// Connect Preview to PreviewView
|
||||
preview.setSurfaceProvider(previewView.getSurfaceProvider());
|
||||
Camera camera = cameraProvider.bindToLifecycle((LifecycleOwner)this, cameraSelector, preview);
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
package com.example.ueberwachungssystem;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.ImageFormat;
|
||||
import android.media.Image;
|
||||
import android.util.Log;
|
||||
import android.util.Size;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.camera.core.CameraSelector;
|
||||
import androidx.camera.core.ExperimentalGetImage;
|
||||
import androidx.camera.core.ImageAnalysis;
|
||||
import androidx.camera.core.ImageProxy;
|
||||
import androidx.camera.core.Preview;
|
||||
import androidx.camera.lifecycle.ProcessCameraProvider;
|
||||
import androidx.camera.view.PreviewView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
@ExperimentalGetImage
|
||||
public class VideoDetector {
|
||||
// Calling Activity
|
||||
private final Context context;
|
||||
// Camera Provider
|
||||
private ProcessCameraProvider cameraProvider;
|
||||
private Boolean isDetectionRunning = false;
|
||||
// Preview Camera Image
|
||||
private PreviewView previewView = null;
|
||||
// Check Violation
|
||||
private final float DELTA_LUMINOSITY_THRESHOLD = 10f;
|
||||
private float lastLuminosity = 0f;
|
||||
private Boolean isViolated = false;
|
||||
|
||||
|
||||
/** Constructor */
|
||||
public VideoDetector(Context context) { this.context = context; }
|
||||
|
||||
|
||||
|
||||
/** Return State of Video Detector */
|
||||
public Boolean isRunning() { return isDetectionRunning; }
|
||||
|
||||
/** Return the status of Violation */
|
||||
public boolean getViolationStatus()
|
||||
{
|
||||
return isViolated;
|
||||
}
|
||||
|
||||
/** Starts Video Detection */
|
||||
public void startDetection() {
|
||||
isDetectionRunning = true;
|
||||
// Request Camera Provider
|
||||
final ListenableFuture<ProcessCameraProvider> cameraProviderFuture = ProcessCameraProvider.getInstance(context);
|
||||
//Check for Camera availability
|
||||
cameraProviderFuture.addListener(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
cameraProvider = cameraProviderFuture.get();
|
||||
bindLuminosityAnalysis(cameraProvider);
|
||||
} catch (ExecutionException | InterruptedException e) {
|
||||
// No errors need to be handled for this Future. This should never be reached.
|
||||
}
|
||||
}
|
||||
},ContextCompat.getMainExecutor(context));
|
||||
}
|
||||
|
||||
/** Stops Video Detection */
|
||||
public void stopDetection() {
|
||||
cameraProvider.unbindAll();
|
||||
isDetectionRunning = false;
|
||||
}
|
||||
|
||||
/** Set PreviewView to show Image */
|
||||
public void setPreviewView(PreviewView previewView) {
|
||||
this.previewView = previewView;
|
||||
}
|
||||
|
||||
/** Binds the Luminosity Analyzer (configure and run Analysis) */
|
||||
private void bindLuminosityAnalysis(@NonNull ProcessCameraProvider cameraProvider) {
|
||||
// Configure and create Image Analysis
|
||||
ImageAnalysis.Builder builder = new ImageAnalysis.Builder();
|
||||
builder.setTargetResolution(new Size(640, 480));
|
||||
builder.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST);
|
||||
ImageAnalysis imageAnalysis = builder.build();
|
||||
|
||||
// Set Analyzer
|
||||
imageAnalysis.setAnalyzer(ContextCompat.getMainExecutor(context), new ImageAnalysis.Analyzer() {
|
||||
@Override
|
||||
public void analyze(@NonNull ImageProxy imageProxy) {
|
||||
if (imageProxy.getFormat() == ImageFormat.YUV_420_888) {
|
||||
Image image = imageProxy.getImage();
|
||||
assert image != null;
|
||||
|
||||
// Analyze frame
|
||||
float luminosity = calculateLuminosity(image);
|
||||
Log.d("Video Detector", String.valueOf(luminosity));
|
||||
if (luminosity != 0)
|
||||
checkForViolation(luminosity, lastLuminosity);
|
||||
lastLuminosity = luminosity;
|
||||
}
|
||||
imageProxy.close();
|
||||
}
|
||||
});
|
||||
// Create Preview
|
||||
Preview preview = new Preview.Builder().build();
|
||||
// Specify which Camera to use
|
||||
CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing(CameraSelector.LENS_FACING_BACK).build();
|
||||
// Update PreviewView if set
|
||||
if (previewView != null)
|
||||
preview.setSurfaceProvider(previewView.getSurfaceProvider());
|
||||
|
||||
cameraProvider.bindToLifecycle((LifecycleOwner) context, cameraSelector, imageAnalysis, preview);
|
||||
}
|
||||
|
||||
/** Return Luminosity from Image */
|
||||
private float calculateLuminosity (Image image) {
|
||||
int width = image.getWidth();
|
||||
int height = image.getHeight();
|
||||
|
||||
Image.Plane[] planes = image.getPlanes();
|
||||
ByteBuffer luminosityBuffer = planes[0].getBuffer();
|
||||
|
||||
int yRowStride = image.getPlanes()[0].getRowStride();
|
||||
int yPixelStride = image.getPlanes()[0].getPixelStride();
|
||||
|
||||
int luminosity;
|
||||
float sum = 0;
|
||||
|
||||
for (int y = 0; y < height; ++y) {
|
||||
for (int x = 0; x < width; x++) {
|
||||
int index = (y * yRowStride) + (x * yPixelStride);
|
||||
luminosity = (luminosityBuffer.get(index) & 0xff);
|
||||
sum += luminosity;
|
||||
}
|
||||
}
|
||||
return sum / (width * height);
|
||||
}
|
||||
|
||||
/** Check if delta Luminosity exceeds threshold */
|
||||
private void checkForViolation(float luminosity, float previousLuminosity) {
|
||||
float deltaLuminosity = Math.abs(luminosity - previousLuminosity);
|
||||
if (deltaLuminosity > DELTA_LUMINOSITY_THRESHOLD) {
|
||||
isViolated = true;
|
||||
Log.d("Violation", "Violation");
|
||||
}
|
||||
Log.d("Delta", String.valueOf(Math.abs(previousLuminosity - luminosity)));
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:id="@+id/textViewLog"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World!"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:maxLines="25"
|
||||
android:scrollbars="vertical"
|
||||
android:text="TextViewLoggerMain"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewWorkerThread"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/toggleButton1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="161dp"
|
||||
android:layout_marginTop="115dp"
|
||||
android:layout_marginEnd="162dp"
|
||||
android:text="ToggleButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/previewButton"
|
||||
<TextView
|
||||
android:id="@+id/textViewWorkerThread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Button"
|
||||
tools:layout_editor_absoluteX="156dp"
|
||||
tools:layout_editor_absoluteY="189dp" />
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:text="textViewWorkerThreadTextView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toggleButton1" />
|
||||
|
||||
<androidx.camera.view.PreviewView
|
||||
android:id="@+id/previewView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<Button
|
||||
android:id="@+id/button1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="35dp"
|
||||
android:layout_marginTop="31dp"
|
||||
android:layout_marginEnd="282dp"
|
||||
android:layout_marginBottom="100dp"
|
||||
android:text="Clear Log"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textViewWorkerThread"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '7.4.2' apply false
|
||||
id 'com.android.library' version '7.4.2' apply false
|
||||
id 'com.android.application' version '8.0.0' apply false
|
||||
id 'com.android.library' version '8.0.0' apply false
|
||||
}
|
||||
@@ -19,3 +19,5 @@ android.useAndroidX=true
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonFinalResIds=false
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#Thu May 11 15:04:30 CEST 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
Reference in new issue
Block a user