Browse Source

adapted Layout MainActivity

Benutzeroberflaeche
Christian Tinz 1 year ago
parent
commit
60bf036b40

+ 0
- 14
app/src/main/java/com/example/greenwatch/MainActivity.java View File

@@ -30,7 +30,6 @@ public class MainActivity extends AppCompatActivity {
private Button accelerometerButton;
private Button audiodetectionAndAccelerometerButton;
private Button videodetectionAndAccelerometerButton;
private Button connectionButton;
private MainActivityViewModel mMainActivityViewModel;
private Permission permission = new Permission();

@@ -50,7 +49,6 @@ public class MainActivity extends AppCompatActivity {
accelerometerButton = (Button) findViewById(R.id.accelerometerButton);
audiodetectionAndAccelerometerButton = (Button) findViewById(R.id.audiodetectionAndAccelerometerButton);
videodetectionAndAccelerometerButton = (Button) findViewById(R.id.videodetectionAndAccelerometerButton);
connectionButton = (Button) findViewById(R.id.connectionButton);

RecyclerView deviceListRecyclerView = findViewById(R.id.deviceListRecyclerView);
deviceListRecyclerView.setLayoutManager(new LinearLayoutManager(this));
@@ -159,12 +157,6 @@ public class MainActivity extends AppCompatActivity {
}
}
});
connectionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openConnectionActivity();
}
});
}

@Override
@@ -198,10 +190,4 @@ public class MainActivity extends AppCompatActivity {
Intent intent = new Intent(this, VideodetectionAndAccelerometerActivity.class);
startActivity(intent);
}
public void openConnectionActivity(){
//Intent intent = new Intent(this, ConnectionActivity.class);
//startActivity(intent);
mMainActivityViewModel.updateDevice(mMainActivityViewModel.getLocalDeviceUUID(), "10:51", false, "Audio", 10);
}

}

+ 67
- 41
app/src/main/res/layout/activity_main.xml View File

@@ -5,9 +5,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp"
android:padding="5dp"
tools:context=".MainActivity">


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/alarmHistoryListRecyclerView"
android:layout_width="match_parent"
@@ -23,60 +24,85 @@
android:layout_weight="3"
tools:listitem="@layout/device_item">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="3">

<Button
android:id="@+id/audiodetectionButton"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Audiodetection">
</Button>
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">

<Button
android:id="@+id/videodetectionButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Videodetection">
</Button>
<Button
android:id="@+id/audiodetectionButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="2dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="Audiodetection">
</Button>

<Button
android:id="@+id/accelerometerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Accelerometer">
</Button>
<Button
android:id="@+id/videodetectionButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="Videodetection">
</Button>

<Button
android:id="@+id/audiodetectionAndAccelerometerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Audiodetection + Accelerometer">
</Button>
</LinearLayout>

<Button
android:id="@+id/videodetectionAndAccelerometerButton"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Videodetection + Accelerometer">
</Button>
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">

<Button
android:id="@+id/connectionButton"
<Button
android:id="@+id/accelerometerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="Accelerometer">
</Button>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Connect to Devices">
</Button>
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">

<Button
android:id="@+id/audiodetectionAndAccelerometerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="2dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="Audiodetection + Accelerometer">
</Button>

<Button
android:id="@+id/videodetectionAndAccelerometerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="Videodetection + Accelerometer">
</Button>

</LinearLayout>

</LinearLayout>


Loading…
Cancel
Save