Browse Source

Added RecyclerView to MainActivity

DoNotMerge_Runnable_Test_Branch
Christian Tinz 1 year ago
parent
commit
d21c22cd02
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      app/src/main/java/com/example/greenwatch/MainActivity.java

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

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


RecyclerView recyclerView = findViewById(R.id.deviceListRecyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setHasFixedSize(true);

final DeviceListAdapter deviceListAdapter = new DeviceListAdapter();
recyclerView.setAdapter(deviceListAdapter);

mMainActivityViewModel = new ViewModelProvider(this).get(MainActivityViewModel.class); mMainActivityViewModel = new ViewModelProvider(this).get(MainActivityViewModel.class);
mMainActivityViewModel.init(); mMainActivityViewModel.init();
mMainActivityViewModel.getConnectedDeviceList().observe(this, new Observer<List<Device>>() { mMainActivityViewModel.getConnectedDeviceList().observe(this, new Observer<List<Device>>() {

Loading…
Cancel
Save