A fork of Simple Time Tracker with WearOS support. (Now integrated upstream)
0

Configure Feed

Select the types of activity you want to include in your feed.

chore: Remove `TimeTrackingActivity`

These hard-coded values were useful for the original
proof-of-concept, but now that we have a dynamic activity list,
they are no longer necessary.

Joseph Hale (Feb 26, 2024, 10:23 PM -0700) c99ee595 3eff9add

-77
-77
wear/src/main/java/com/example/util/simpletimetracker/data/TimeTrackingActivity.kt
··· 1 - /* 2 - * This Source Code Form is subject to the terms of the Mozilla Public 3 - * License, v. 2.0. If a copy of the MPL was not distributed with this 4 - * file, You can obtain one at https://mozilla.org/MPL/2.0/. 5 - */ 6 - package com.example.util.simpletimetracker.data 7 - 8 - import androidx.compose.ui.graphics.Color 9 - import com.example.util.simpletimetracker.R 10 - 11 - class TimeTrackingActivity( 12 - val name: String, 13 - val tags: List<String>, 14 - val color: Color, 15 - val iconId: Int, 16 - ) 17 - 18 - fun getTimeTrackingActivities(): List<TimeTrackingActivity> { 19 - return listOf<TimeTrackingActivity>( 20 - activity("TODOs", listOf<String>("Chores", "Shopping")), 21 - activity("Travel", listOf<String>("Bike", "Car", "Plane", "Scooter", "Public Transit")), 22 - activity("Planning", listOf<String>("Goals", "Processing", "Reflection")), 23 - activity("Personal Learning", listOf<String>("Industry", "Hobbies", "Music")), 24 - activity("Professional Development", listOf<String>("Engineering", "Networking", "Trainings")), 25 - activity("Basic Needs", listOf<String>("Exercise", "Hygiene", "Meals", "Sleep")), 26 - activity("Church", listOf<String>("Service", "Study", "Worship", "Volunteer")), 27 - activity("Activities", listOf<String>("Family", "Friends", "Personal")), 28 - activity("Dates"), 29 - activity("Other"), 30 - ) 31 - } 32 - 33 - fun activity( 34 - name: String, 35 - tags: List<String> = listOf(), 36 - ): TimeTrackingActivity { 37 - return TimeTrackingActivity( 38 - name = name, 39 - tags = tags, 40 - color = colorForActivity(name), 41 - iconId = iconForActivity(name), 42 - ) 43 - } 44 - 45 - fun iconForActivity(activityName: String): Int { 46 - val icons = 47 - mapOf<String, Int>( 48 - "Activities" to R.drawable.baseline_people_24, 49 - "Basic Needs" to R.drawable.baseline_bed_24, 50 - "Church" to R.drawable.baseline_church_24, 51 - "Dates" to R.drawable.baseline_heart_broken_24, 52 - "Other" to R.drawable.baseline_horizontal_rule_24, 53 - "Personal Learning" to R.drawable.baseline_computer_24, 54 - "Planning" to R.drawable.baseline_timer_24, 55 - "Professional Development" to R.drawable.baseline_home_work_24, 56 - "TODOs" to R.drawable.baseline_check_box_24, 57 - "Travel" to R.drawable.baseline_directions_car_24, 58 - ) 59 - return icons.getOrDefault(activityName, R.drawable.baseline_question_mark_24) 60 - } 61 - 62 - fun colorForActivity(activityName: String): Color { 63 - val colors = 64 - mapOf<String, Color>( 65 - "Activities" to Color(3, 169, 244, 255), 66 - "Basic Needs" to Color(205, 220, 57, 255), 67 - "Church" to Color(76, 175, 80, 255), 68 - "Dates" to Color(156, 39, 176, 255), 69 - "Other" to Color(96, 125, 139, 255), 70 - "Personal Learning" to Color(255, 193, 7, 255), 71 - "Planning" to Color(255, 87, 34, 255), 72 - "Professional Development" to Color(233, 30, 99, 255), 73 - "TODOs" to Color(245, 54, 57, 255), 74 - "Travel" to Color(120, 82, 72, 255), 75 - ) 76 - return colors.getOrDefault(activityName, Color(96, 125, 139, 255)) 77 - }