From b9fd55099606ff25245ebec5555f6b9e91cd8e65 Mon Sep 17 00:00:00 2001 From: Paul-Louis NECH Date: Sun, 17 Feb 2019 18:17:31 +0100 Subject: [PATCH] TODO/Debug data --- README.md | 1 + TODO.md | 12 ++++++++---- app/src/main/java/fr/plnech/lifelogger/model/DataPoint.kt | 4 ++-- app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt | 13 ++++++------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7bbc44f..e331b9d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ LifeLogger helps you log your life. - A **DataPoint** is an event pertaining to one of your Logs. - Example: you climbed stairs to the 5th floor. - Example: you saw a friend (Julien) today. + - Example: you felt relaxed today. ## Contributing diff --git a/TODO.md b/TODO.md index c8cd490..2461771 100644 --- a/TODO.md +++ b/TODO.md @@ -1,12 +1,16 @@ # Roadmap # V0.1 -- Validate MVP model -- MVP display -- MVP storage -- MVP Distribution +- [x] Validate MVP model +- [] MVP display +- [] MVP storage +- [] MVP Distribution # V0.5 - More generic model + - Named events: saw friend + - +1: Brushed teeth + - Counts: climbed X floors + - Boolean events? - Better display - Online storage - Material design diff --git a/app/src/main/java/fr/plnech/lifelogger/model/DataPoint.kt b/app/src/main/java/fr/plnech/lifelogger/model/DataPoint.kt index ba0da5e..3e860c2 100644 --- a/app/src/main/java/fr/plnech/lifelogger/model/DataPoint.kt +++ b/app/src/main/java/fr/plnech/lifelogger/model/DataPoint.kt @@ -28,8 +28,8 @@ data class DataPoint( private val metadata: HashMap = HashMap() ) { - constructor(name: String, count: Int = NONE) : this() { - metadata["name"] = name + constructor(name: String?, count: Int = NONE) : this() { + name?.let { metadata["name"] = name } metadata["count"] = count } diff --git a/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt b/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt index e3f64c6..f88dee4 100644 --- a/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt +++ b/app/src/main/java/fr/plnech/lifelogger/ui/HomeActivity.kt @@ -72,26 +72,25 @@ class HomeActivity : AppCompatActivity() { } private fun generateDebugData(): ArrayList { - var logs : ArrayList = ArrayList() + val logs: ArrayList = ArrayList() val stairs = Log("Stairway to heaven") stairs.addPoint(DataPoint("stairs", 7)) - stairs.addPoint(DataPoint("lift")) stairs.addPoint(DataPoint("stairs", 4)) stairs.addPoint(DataPoint("stairs", 4)) - stairs.addPoint(DataPoint("lift")) val moods = Log("MoodBoard") moods.addPoint(DataPoint("happy")) moods.addPoint(DataPoint("focused")) moods.addPoint(DataPoint("relax")) - val mind = Log("MindBoard") - mind.addPoint(DataPoint("HeadSpace", 10)) - mind.addPoint(DataPoint("HeadSpace", 5)) + val friends = Log("Friends") + friends.addPoint(DataPoint("Julien")) + friends.addPoint(DataPoint("Alex")) + friends.addPoint(DataPoint("Simon")) logs.add(stairs) logs.add(moods) - logs.add(mind) + logs.add(friends) return logs } } -- libgit2 0.27.0