From c4685214d8db34166213ffa373a16af1a99401a5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 27 Jan 2015 21:23:50 +0100 Subject: o Adding 'recently seen' on BtDevice. Updated when scanning. o Removing BtScanResult, it was never used. o Getting MainActivity to listen on device property changed so the UI is properly updated. o Adding a status bar with color to indicate if the device is available, connected or not seen. --- .gitignore | 2 + app/src/main/AndroidManifest.xml | 16 +- .../main/java/io/trygvis/android/bt/BtDevice.java | 49 ++++-- .../main/java/io/trygvis/android/bt/BtPromise.java | 12 +- .../java/io/trygvis/android/bt/BtScanResult.java | 9 - .../main/java/io/trygvis/android/bt/BtService.java | 3 + .../io/trygvis/android/bt/DefaultBtService.java | 77 ++++++--- .../soilmoisture/DefaultSoilMoistureService.java | 15 +- .../java/io/trygvis/soilmoisture/MainActivity.java | 191 ++++++++++++++------- .../io/trygvis/soilmoisture/SensorActivity.java | 134 +++++++++++++++ .../java/io/trygvis/soilmoisture/SmDevice.java | 4 +- app/src/main/res/layout/activity_sensor.xml | 7 + app/src/main/res/layout/fragment_device.xml | 11 +- app/src/main/res/layout/fragment_main_sensor.xml | 28 +++ app/src/main/res/layout/fragment_sensor.xml | 34 ++-- app/src/main/res/menu/menu_sensor.xml | 8 + app/src/main/res/values/colors.xml | 6 + app/src/main/res/values/strings.xml | 1 + 18 files changed, 455 insertions(+), 152 deletions(-) delete mode 100644 app/src/main/java/io/trygvis/android/bt/BtScanResult.java create mode 100644 app/src/main/java/io/trygvis/soilmoisture/SensorActivity.java create mode 100644 app/src/main/res/layout/activity_sensor.xml create mode 100644 app/src/main/res/layout/fragment_main_sensor.xml create mode 100644 app/src/main/res/menu/menu_sensor.xml create mode 100644 app/src/main/res/values/colors.xml diff --git a/.gitignore b/.gitignore index f0134ac..19530d1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ local.properties .idea /build *.iml +*.tmp +*.tmp.* diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 500bd8d..3edd865 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,7 @@ - +