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

private Button accelerometerButton; private Button accelerometerButton;
private Button audiodetectionAndAccelerometerButton; private Button audiodetectionAndAccelerometerButton;
private Button videodetectionAndAccelerometerButton; private Button videodetectionAndAccelerometerButton;
private Button connectionButton;
private MainActivityViewModel mMainActivityViewModel; private MainActivityViewModel mMainActivityViewModel;
private Permission permission = new Permission(); private Permission permission = new Permission();


accelerometerButton = (Button) findViewById(R.id.accelerometerButton); accelerometerButton = (Button) findViewById(R.id.accelerometerButton);
audiodetectionAndAccelerometerButton = (Button) findViewById(R.id.audiodetectionAndAccelerometerButton); audiodetectionAndAccelerometerButton = (Button) findViewById(R.id.audiodetectionAndAccelerometerButton);
videodetectionAndAccelerometerButton = (Button) findViewById(R.id.videodetectionAndAccelerometerButton); videodetectionAndAccelerometerButton = (Button) findViewById(R.id.videodetectionAndAccelerometerButton);
connectionButton = (Button) findViewById(R.id.connectionButton);


RecyclerView deviceListRecyclerView = findViewById(R.id.deviceListRecyclerView); RecyclerView deviceListRecyclerView = findViewById(R.id.deviceListRecyclerView);
deviceListRecyclerView.setLayoutManager(new LinearLayoutManager(this)); deviceListRecyclerView.setLayoutManager(new LinearLayoutManager(this));
} }
} }
}); });
connectionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openConnectionActivity();
}
});
} }


@Override @Override
Intent intent = new Intent(this, VideodetectionAndAccelerometerActivity.class); Intent intent = new Intent(this, VideodetectionAndAccelerometerActivity.class);
startActivity(intent); 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

android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:padding="10dp"
android:padding="5dp"
tools:context=".MainActivity"> tools:context=".MainActivity">



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


<Button
android:id="@+id/audiodetectionButton"
<LinearLayout
android:layout_width="match_parent" 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_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_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> </LinearLayout>



Loading…
Cancel
Save