Compare commits
6 Commits
5007623acc
...
c8b947bb57
Author | SHA1 | Date | |
---|---|---|---|
c8b947bb57 | |||
4a1c554a09 | |||
eb1629a700 | |||
b97c494427 | |||
6a251fbb27 | |||
076db89147 |
@ -1,20 +1,25 @@
|
|||||||
package com.example.ueberwachungssystem.Fragments;
|
package com.example.ueberwachungssystem.Fragments;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.VideoView;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.example.ueberwachungssystem.R;
|
import com.example.ueberwachungssystem.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class Fragment1 extends Fragment {
|
public class Fragment1 extends Fragment {
|
||||||
private String text;
|
private String text;
|
||||||
private final static String KEY_TEXT = "KEY_TEXT";
|
private final static String KEY_TEXT = "KEY_TEXT";
|
||||||
|
|
||||||
private void log(String nachricht) {
|
private void log(String nachricht) {
|
||||||
Log.d(this.getClass().getSimpleName(), nachricht);
|
Log.d(this.getClass().getSimpleName(), nachricht);
|
||||||
}
|
}
|
||||||
@ -23,7 +28,7 @@ public class Fragment1 extends Fragment {
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
||||||
log("onCreateView");
|
log("onCreateView");
|
||||||
View view = inflater.inflate(R.layout.fragment1, container, false);
|
View view = inflater.inflate(R.layout.fragment1, container, false);
|
||||||
TextView Sensor = (TextView) view.findViewById(R.id.Sensor);
|
TextView Sensor = (TextView) view.findViewById(R.id.Alarm);
|
||||||
Sensor.setText(text);
|
Sensor.setText(text);
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
@ -36,7 +41,7 @@ public class Fragment1 extends Fragment {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle bundle) {
|
public void onCreate(Bundle bundle) {
|
||||||
super .onCreate(bundle);
|
super.onCreate(bundle);
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
if (args != null ) {
|
if (args != null ) {
|
||||||
text = args.getString(KEY_TEXT);
|
text = args.getString(KEY_TEXT);
|
||||||
|
@ -1,18 +1,28 @@
|
|||||||
package com.example.ueberwachungssystem.Fragments;
|
package com.example.ueberwachungssystem.Fragments;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.example.ueberwachungssystem.MeinAdapter;
|
||||||
import com.example.ueberwachungssystem.R;
|
import com.example.ueberwachungssystem.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class Fragment2 extends Fragment {
|
public class Fragment2 extends Fragment {
|
||||||
private String text;
|
private String text;
|
||||||
|
private Context c;
|
||||||
private final static String KEY_TEXT = "KEY_TEXT" ;
|
private final static String KEY_TEXT = "KEY_TEXT" ;
|
||||||
private void log(String nachricht) {
|
private void log(String nachricht) {
|
||||||
Log.d(this.getClass().getSimpleName(), nachricht);
|
Log.d(this.getClass().getSimpleName(), nachricht);
|
||||||
@ -21,8 +31,8 @@ public class Fragment2 extends Fragment {
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
||||||
log( "onCreateView" );
|
log( "onCreateView" );
|
||||||
View view = inflater.inflate(R.layout.fragment2, container, false );
|
View view = inflater.inflate(R.layout.fragment2, container, false );
|
||||||
TextView Sensor = (TextView) view.findViewById(R.id.Sensor);
|
// TextView Sensor = (TextView) view.findViewById(R.id.Aufzeichnungen);
|
||||||
Sensor.setText(text);
|
// Sensor.setText(text);
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
public static Fragment2 erstellen(String text) {
|
public static Fragment2 erstellen(String text) {
|
||||||
@ -36,6 +46,9 @@ public class Fragment2 extends Fragment {
|
|||||||
public void onCreate(Bundle bundle) {
|
public void onCreate(Bundle bundle) {
|
||||||
super.onCreate(bundle);
|
super.onCreate(bundle);
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
|
c = getContext();
|
||||||
|
ListView listView = new ListView(c);
|
||||||
|
listView.setAdapter(new MeinAdapter(c, getVideoFiles()));
|
||||||
if (args != null) {
|
if (args != null) {
|
||||||
text = args.getString(KEY_TEXT);
|
text = args.getString(KEY_TEXT);
|
||||||
log("onCreate: text=" + text);
|
log("onCreate: text=" + text);
|
||||||
@ -43,4 +56,10 @@ public class Fragment2 extends Fragment {
|
|||||||
log("onCreate");
|
log("onCreate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public List<File> getVideoFiles(){
|
||||||
|
File directory = c.getFilesDir();
|
||||||
|
File[] files = directory.listFiles();
|
||||||
|
assert files != null;
|
||||||
|
return Arrays.asList(files);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
package com.example.ueberwachungssystem.Fragments;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
|
|
||||||
import com.example.ueberwachungssystem.R;
|
|
||||||
|
|
||||||
public class Fragment3 extends Fragment {
|
|
||||||
private String text;
|
|
||||||
private final static String KEY_TEXT = "KEY_TEXT" ;
|
|
||||||
private void log(String nachricht) {
|
|
||||||
Log.d(this.getClass().getSimpleName(), nachricht);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
|
||||||
log( "onCreateView" );
|
|
||||||
View view = inflater.inflate(R.layout.fragment2, container, false );
|
|
||||||
TextView Sensor = (TextView) view.findViewById(R.id.Sensor);
|
|
||||||
Sensor.setText(text);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
public static Fragment3 erstellen(String text) {
|
|
||||||
Fragment3 fragment = new Fragment3();
|
|
||||||
Bundle b = new Bundle();
|
|
||||||
b.putString(KEY_TEXT, text);
|
|
||||||
fragment.setArguments(b);
|
|
||||||
return fragment;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle bundle) {
|
|
||||||
super.onCreate(bundle);
|
|
||||||
Bundle args = getArguments();
|
|
||||||
if (args != null) {
|
|
||||||
text = args.getString(KEY_TEXT);
|
|
||||||
log("onCreate: text=" + text);
|
|
||||||
} else {
|
|
||||||
log("onCreate");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +1,10 @@
|
|||||||
package com.example.ueberwachungssystem;
|
package com.example.ueberwachungssystem;
|
||||||
|
|
||||||
|
import androidx.camera.core.ExperimentalGetImage;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.camera.core.ExperimentalGetImage;
|
|
||||||
import androidx.camera.view.PreviewView;
|
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -15,36 +16,46 @@ import android.util.Log;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
import com.example.ueberwachungssystem.Detection.Accelerometer;
|
import com.example.ueberwachungssystem.Fragments.Fragment1;
|
||||||
import com.example.ueberwachungssystem.Detection.AudioRecorder;
|
import com.example.ueberwachungssystem.Fragments.Fragment2;
|
||||||
import com.example.ueberwachungssystem.Detection.DetectionReport;
|
|
||||||
import com.example.ueberwachungssystem.Detection.Detector;
|
|
||||||
import com.example.ueberwachungssystem.Detection.DetectorService;
|
import com.example.ueberwachungssystem.Detection.DetectorService;
|
||||||
import com.example.ueberwachungssystem.Detection.MicrophoneDetector;
|
|
||||||
import com.example.ueberwachungssystem.Detection.VideoDetector;
|
|
||||||
|
|
||||||
@ExperimentalGetImage
|
@ExperimentalGetImage
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
//Fragmente
|
||||||
|
private Fragment aktuellesFragment;
|
||||||
|
private Fragment1 fragment1;
|
||||||
|
private Fragment2 fragment2;
|
||||||
|
|
||||||
private DetectorService detectorService = new DetectorService();
|
private DetectorService detectorService = new DetectorService();
|
||||||
ImageView inputImageView;
|
|
||||||
ImageView outputImageView;
|
|
||||||
ToggleButton toggleButton;
|
|
||||||
int num=0;
|
int num=0;
|
||||||
|
//Textviews
|
||||||
|
private TextView Auswahl;
|
||||||
|
private TextView AoderA;
|
||||||
|
private String auswahltext = "Wahl des Detektionsmodus";
|
||||||
|
private String auswahlAoderA = "Wahl von Alarmmeldungen oder Auswahl von Alarmaufzeichnungen";
|
||||||
|
//Buttons
|
||||||
|
private ToggleButton toggleKamera;
|
||||||
|
private ToggleButton toggleAudio;
|
||||||
|
private ToggleButton toggleBewegung;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
setTitle(this.getClass().getSimpleName());
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
Auswahl = findViewById(R.id.textAuswahl);
|
||||||
inputImageView = findViewById(R.id.inputImageView);
|
Auswahl.setText(auswahltext);
|
||||||
outputImageView = findViewById(R.id.outputImageView);
|
AoderA = findViewById(R.id.textAoderA);
|
||||||
toggleButton = findViewById(R.id.toggleButton);
|
AoderA.setText(auswahlAoderA);
|
||||||
|
toggleKamera = findViewById(R.id.toggleKamera);
|
||||||
|
toggleAudio = findViewById(R.id.toggleAudio);
|
||||||
|
toggleBewegung = findViewById(R.id.toggleBewegung);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -59,34 +70,35 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||||
startService(serviceIntent);
|
startService(serviceIntent);
|
||||||
|
|
||||||
toggleButton.setOnClickListener(new View.OnClickListener() {
|
toggleKamera.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (toggleButton.isChecked())
|
if (toggleKamera.isChecked()) {
|
||||||
{
|
if(detectorService != null) {
|
||||||
if (detectorService != null){
|
|
||||||
|
|
||||||
detectorService.videoDetector.startDetection();
|
detectorService.videoDetector.startDetection();
|
||||||
|
|
||||||
detectorService.audioDetector.startDetection();
|
|
||||||
|
|
||||||
detectorService.motionDetector.startDetection();
|
|
||||||
|
|
||||||
detectorService.audioRecorder.stopRecording();
|
|
||||||
|
|
||||||
detectorService.videoDetector.startRecording();
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
detectorService.videoDetector.stopDetection();
|
detectorService.videoDetector.stopDetection();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
toggleAudio.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (toggleAudio.isChecked()) {
|
||||||
|
|
||||||
detectorService.audioDetector.stopDetection();
|
} else {
|
||||||
|
|
||||||
detectorService.motionDetector.stopDetection();
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
toggleBewegung.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (toggleBewegung.isChecked()) {
|
||||||
|
|
||||||
detectorService.audioRecorder.stopRecording();
|
} else {
|
||||||
|
|
||||||
detectorService.videoDetector.stopRecording();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -100,28 +112,29 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
getMenuInflater().inflate(R.menu.options_menu, menu);
|
getMenuInflater().inflate(R.menu.options_menu, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
Toast.makeText(this, "Selected Item: " + item.getTitle(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Selected Item: " + item.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
PopUpClass popUpClass;
|
PopUpClass popUpClass;
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.Rechteverwaltung:
|
case R.id.Rechteverwaltung:
|
||||||
popUpClass = new PopUpClass(MainActivity.this);
|
popUpClass = new PopUpClass(MainActivity.this);
|
||||||
popUpClass.showPopupWindow(inputImageView);
|
popUpClass.showPopupWindow(toggleAudio);
|
||||||
popUpClass.RechtePrüfen();
|
popUpClass.RechtePrüfen();
|
||||||
return true;
|
return true;
|
||||||
case R.id.Sensoren:
|
case R.id.Sensoren:
|
||||||
popUpClass = new PopUpClass(MainActivity.this);
|
popUpClass = new PopUpClass(MainActivity.this);
|
||||||
popUpClass.showPopupWindow(inputImageView);
|
popUpClass.showPopupWindow(toggleAudio);
|
||||||
popUpClass.Sensoren();
|
popUpClass.Sensoren();
|
||||||
return true;
|
return true;
|
||||||
case R.id.Impressum:
|
case R.id.Impressum:
|
||||||
popUpClass = new PopUpClass(MainActivity.this);
|
popUpClass = new PopUpClass(MainActivity.this);
|
||||||
popUpClass.showPopupWindow(inputImageView);
|
popUpClass.showPopupWindow(toggleAudio);
|
||||||
popUpClass.Impressum();
|
popUpClass.Impressum();
|
||||||
return true;
|
return true;
|
||||||
case R.id.Detection:
|
case R.id.Detection:
|
||||||
popUpClass = new PopUpClass(MainActivity.this);
|
popUpClass = new PopUpClass(MainActivity.this);
|
||||||
popUpClass.showPopupWindow(inputImageView);
|
popUpClass.showPopupWindow(toggleAudio);
|
||||||
popUpClass.DetectionTotal(num);
|
popUpClass.DetectionTotal(num);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
@ -134,7 +147,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||||
DetectorService.ServiceBinder binder = (DetectorService.ServiceBinder) service;
|
DetectorService.ServiceBinder binder = (DetectorService.ServiceBinder) service;
|
||||||
detectorService = binder.getBoundService();
|
detectorService = binder.getBoundService();
|
||||||
detectorService.videoDetector.debugProcessing(null, outputImageView); //inputImageView
|
// detectorService.videoDetector.debugProcessing(null, outputImageView); //inputImageView
|
||||||
|
|
||||||
detectorService.setOnDetectionListener(new DetectorService.OnDetectionListener() {
|
detectorService.setOnDetectionListener(new DetectorService.OnDetectionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -148,4 +161,33 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
public void onServiceDisconnected(ComponentName name) {
|
public void onServiceDisconnected(ComponentName name) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public void onClickZeigeFragment1(View view) {
|
||||||
|
Button button = (Button) view;
|
||||||
|
zeigeFragment(fragment1.erstellen("Hier stehen dann die Alarme"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClickZeigeFragment2(View view) {
|
||||||
|
Button button = (Button) view;
|
||||||
|
zeigeFragment(fragment2.erstellen("Hier stehen dann die Videos"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClickEntferneFragment(View view) {
|
||||||
|
entferneFragment();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void zeigeFragment(Fragment fragment) {
|
||||||
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
|
ft.replace(R.id.frame, fragment);
|
||||||
|
ft.commit();
|
||||||
|
aktuellesFragment = fragment;
|
||||||
|
}
|
||||||
|
private void entferneFragment() {
|
||||||
|
if (aktuellesFragment != null) {
|
||||||
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
|
ft.remove(aktuellesFragment);
|
||||||
|
ft.commit();
|
||||||
|
aktuellesFragment = null ;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.example.ueberwachungssystem;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MeinAdapter extends ArrayAdapter<File> {
|
||||||
|
private Context context;
|
||||||
|
private File[] files;
|
||||||
|
public MeinAdapter(Context context, List<File> listf) {
|
||||||
|
super(context, android.R.layout.simple_list_item_1, listf);
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(final int pos, View cv, ViewGroup vg) {
|
||||||
|
View v = super.getView(pos, cv, vg);
|
||||||
|
v.setOnClickListener( new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Log.d("DerLog","nicht null");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
5
app/src/main/res/drawable/toggle_btn.xml
Normal file
5
app/src/main/res/drawable/toggle_btn.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_checked="false" android:drawable="@color/redbright" />
|
||||||
|
<item android:state_checked="true" android:drawable="@color/greenbright" />
|
||||||
|
</selector>
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@ -1,41 +1,129 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:background="#010C49"
|
||||||
android:gravity="top"
|
android:visibility="visible"
|
||||||
android:orientation="vertical"
|
tools:context="com.example.ueberwachungssystem.MainActivity"
|
||||||
tools:context=".MainActivity">
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
<androidx.camera.view.PreviewView
|
android:id="@+id/textAuswahl"
|
||||||
android:id="@+id/previewView"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:backgroundTint="@android:color/black"/>
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textAoderA"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/toggleAudio"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
android:id="@+id/toggleButton"
|
android:id="@+id/toggleKamera"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/toggleAudio"
|
||||||
|
android:layout_marginRight="30dp"
|
||||||
|
android:layout_toLeftOf="@id/toggleAudio"
|
||||||
|
android:textColor="@color/yellow"
|
||||||
|
android:textOn="Kamera an"
|
||||||
|
android:textOff="Kamera aus"
|
||||||
|
android:background="@drawable/toggle_btn"/>
|
||||||
|
|
||||||
|
<ToggleButton
|
||||||
|
android:id="@+id/toggleAudio"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/textAuswahl"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:textColor="@color/yellow"
|
||||||
|
android:textOn="Audio an"
|
||||||
|
android:textOff="Audio aus"
|
||||||
|
android:background="@drawable/toggle_btn"/>
|
||||||
|
|
||||||
|
<ToggleButton
|
||||||
|
android:id="@+id/toggleBewegung"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/toggleAudio"
|
||||||
|
android:layout_marginLeft="30dp"
|
||||||
|
android:layout_toEndOf="@+id/toggleAudio"
|
||||||
|
android:layout_toRightOf="@id/toggleAudio"
|
||||||
|
android:textColor="@color/yellow"
|
||||||
|
android:textOn="Bewegung an"
|
||||||
|
android:textOff="Bewegung aus"
|
||||||
|
android:background="@drawable/toggle_btn"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnAlarme"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/btnAufnahmen"
|
||||||
|
android:layout_toLeftOf="@id/btnAufnahmen"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:theme="@style/Button.Green"
|
||||||
|
android:onClick="onClickZeigeFragment1"
|
||||||
|
android:text="Alarme" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnAufnahmen"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/textAoderA"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:theme="@style/Button.Green"
|
||||||
|
android:onClick="onClickZeigeFragment2"
|
||||||
|
android:text="Aufnahmen" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnAnzeigeVerb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/btnAufnahmen"
|
||||||
|
android:layout_toRightOf="@id/btnAufnahmen"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:text="Anzeige verbergen"
|
||||||
|
android:onClick="onClickEntferneFragment"/>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:text="ToggleButton" />
|
android:layout_below="@+id/btnAufnahmen"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:background="@color/white">
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<ImageView
|
<!--
|
||||||
android:id="@+id/inputImageView"
|
<ScrollView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/scrollView1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
tools:srcCompat="@tools:sample/avatars" />
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/btnAufnahmen"
|
||||||
|
android:layout_marginTop="25dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Alarm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/red"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
-->
|
||||||
|
|
||||||
<ImageView
|
</RelativeLayout>
|
||||||
android:id="@+id/outputImageView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:srcCompat="@tools:sample/avatars" />
|
|
||||||
|
|
||||||
<androidx.camera.view.PreviewView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@ -4,19 +4,23 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@android:color/holo_green_light">
|
android:background="@color/bluedark">
|
||||||
|
|
||||||
<TextView
|
<ScrollView
|
||||||
android:id="@+id/Sensor"
|
android:id="@+id/scrollView1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
android:layout_marginTop="25dp">
|
||||||
|
<LinearLayout
|
||||||
<TextView
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/Alarm"
|
android:layout_height="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:orientation="vertical" >
|
||||||
android:layout_height="wrap_content"
|
<TextView
|
||||||
android:layout_below="@id/Sensor"
|
android:id="@+id/Alarm"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/yellow"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -6,17 +6,28 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@android:color/holo_blue_light" >
|
android:background="@android:color/holo_blue_light" >
|
||||||
|
|
||||||
<TextView
|
<ScrollView
|
||||||
android:id="@+id/Sensor"
|
android:id="@+id/scrollView2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="250dp"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
android:layout_marginTop="25dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Aufzeichnungen"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/yellow"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
<TextView
|
<VideoView
|
||||||
android:id="@+id/Alarm"
|
android:id="@+id/AusAuf"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/Sensor"
|
android:layout_below="@id/scrollView2"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:background="@android:color/holo_blue_light" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/Sensor"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/Alarm"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/Sensor"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@ -7,4 +7,9 @@
|
|||||||
<color name="teal_700">#FF018786</color>
|
<color name="teal_700">#FF018786</color>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="red">#5C0000</color>
|
||||||
|
<color name="redbright">#EF3434</color>
|
||||||
|
<color name="greenbright">#469733</color>
|
||||||
|
<color name="bluedark">#053C8E</color>
|
||||||
|
<color name="yellow">#FFEB3B</color>
|
||||||
</resources>
|
</resources>
|
@ -13,4 +13,9 @@
|
|||||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Button.Green" parent="ThemeOverlay.AppCompat">
|
||||||
|
<item name="colorAccent">#0F3E01</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user