Browse Source

Added Toggle Buttons for Detection Mode

Added Scrollview for alarm
ko^2
Oliver Kleinecke 1 year ago
parent
commit
74eb3e0d98

+ 0
- 6
app/src/main/java/de/oklein/android/ueberwachungssystem/MainActivity.java View File

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.Sensor);
Sensor.setText(text); Sensor.setText(text);
TextView Alarm = (TextView) view.findViewById(R.id.Alarm);
Alarm.setText(text);
return view; return view;
} }
public static Fragment1 erstellen(String text) { public static Fragment1 erstellen(String text) {
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.Sensor);
Sensor.setText(text); Sensor.setText(text);
TextView Alarm = (TextView) view.findViewById(R.id.Alarm);
Alarm.setText(text);
return view; return view;
} }
public static Fragment2 erstellen(String text) { public static Fragment2 erstellen(String text) {
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.Sensor);
Sensor.setText(text); Sensor.setText(text);
TextView Alarm = (TextView) view.findViewById(R.id.Alarm);
Alarm.setText(text);
return view; return view;
} }
public static Fragment3 erstellen(String text) { public static Fragment3 erstellen(String text) {

+ 61
- 20
app/src/main/res/layout/activity_main.xml View File

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:background="@android:color/holo_orange_light"
android:visibility="visible"
tools:context="de.oklein.android.ueberwachungssystem.MainActivity" tools:context="de.oklein.android.ueberwachungssystem.MainActivity"
android:background="@android:color/holo_orange_light">
tools:visibility="visible">

<ToggleButton
android:id="@+id/toggleKamera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/toggleAudio"
android:layout_alignBottom="@id/toggleAudio"
android:text="Kamera" />

<ToggleButton
android:id="@+id/toggleAudio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="Audio" />

<ToggleButton
android:id="@+id/toggleBewegung"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/toggleAudio"
android:layout_alignBottom="@id/toggleAudio"
android:text="Bewegung" />


<Button <Button
android:id="@+id/btn1" android:id="@+id/btn1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/btn2" android:layout_alignBottom="@id/btn2"
android:layout_toLeftOf="@id/btn2" android:layout_toLeftOf="@id/btn2"
android:text="Audio"
android:onClick="onClickZeigeFragment1"/>
android:onClick="onClickZeigeFragment1"
android:text="Audio" />


<Button <Button
android:id="@+id/btn2" android:id="@+id/btn2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/toggleAudio"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:text="Kamera"
android:onClick="onClickZeigeFragment2"/>
android:onClick="onClickZeigeFragment2"
android:text="Kamera" />


<Button <Button
android:id="@+id/btn3" android:id="@+id/btn3"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/btn2" android:layout_alignBottom="@id/btn2"
android:layout_toRightOf="@id/btn2" android:layout_toRightOf="@id/btn2"
android:text="Bewegung"
android:onClick="onClickZeigeFragment3"/>
android:onClick="onClickZeigeFragment3"
android:text="Bewegung" />
<!--
<Button <Button
android:id="@+id/btnSensorWeg" android:id="@+id/btnSensorWeg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_below="@+id/btn1" android:layout_below="@+id/btn1"
android:text="Entferne Sensordarstellung" android:text="Entferne Sensordarstellung"
android:onClick="onClickEntferneFragment"/> android:onClick="onClickEntferneFragment"/>
-->
<Button
android:id="@+id/btnZwischen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/btn2"
android:layout_centerHorizontal="true"
tools:visibility="invisible" />


<Button <Button
android:id="@+id/btnAufnahme" android:id="@+id/btnAufnahme"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/btnSensorWeg"
android:text="Aufnahme"
android:onClick="onClickEntferneFragment"/>
android:layout_below="@+id/btn2"
android:layout_toLeftOf="@id/btnZwischen"
android:onClick="onClickEntferneFragment"
android:text="Aufnahme" />


<Button <Button
android:id="@+id/btnWiedergabe" android:id="@+id/btnWiedergabe"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@id/btnAufnahme"
android:layout_below="@+id/btnSensorWeg"
android:text="Wiedergabe"
android:onClick="onClickEntferneFragment"/>
android:layout_below="@+id/btn2"
android:layout_toRightOf="@id/btnZwischen"
android:onClick="onClickEntferneFragment"
android:text="Wiedergabe" />


<FrameLayout <FrameLayout
android:id="@+id/frame" android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_below="@+id/btnZwischen"
android:layout_alignParentStart="true">
</FrameLayout>

<ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_below="@+id/btnAufnahme">
</FrameLayout>
android:layout_below="@id/frame">
</ScrollView>


</RelativeLayout>
</RelativeLayout>

Loading…
Cancel
Save