1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 20:10:15 +02:00
Commit Graph

259 Commits

Author SHA1 Message Date
Pavel
62e080d5ac
Update LiveActivityFragment.java
I'm sorry, I wanted to add entry if > min HR
2018-09-16 20:35:28 +03:00
cpfeiffer
5028458fe8 Fix some static analysis warnings 2018-09-16 13:54:56 +02:00
Pavel Elagin
e85257b545 Show current / max heart rate. Ignore heart rate < user settings. Invisible button bar into LiveActivity. Auto scale totalStepsChart. Fix time x axis history chart. Draw total and per minute steps. Set limit on per minute chart by user settings. 2018-09-13 12:51:52 +03:00
cpfeiffer
aee0e54d05 Handle possible negative steps values 2018-09-11 23:08:29 +02:00
cpfeiffer
fbcd2840ca No need to call method twice 2018-09-11 23:04:18 +02:00
cpfeiffer
88ad6cf0e0 Improve balance handling 2018-09-10 23:41:01 +02:00
Pavel Elagin
4592d35cc6 Calculation and display of weekly balance by steps and time of sleep. 2018-09-10 23:41:01 +02:00
Dikay900
64da085942 make heart rate values configurable and use singleton for heartrateutils
to listen for preference changes
2018-09-02 12:57:52 +02:00
License Bot
696653eabf Update contributors list and license headers. 2018-08-29 21:30:23 +02:00
cpfeiffer
0145013597 Add some @Nullable 2018-08-17 00:13:38 +02:00
Carsten Pfeiffer
26fcb3cbbb
Merge pull request #1212 from elagin/legend_wordwrap_center
Enable word wrap and set center horizontal alignment for legend into …
2018-08-16 23:58:00 +02:00
Pavel Elagin
354ab79285 Display start and end sleep. #164 2018-08-16 17:59:56 +03:00
Pavel Elagin
65d36d2c81 Enable word wrap and set center horizontal alignment for legend into ActivitySleepChart and WeekSleepChart 2018-08-15 18:03:32 +03:00
cpfeiffer
f2ff1991da Comment out chatty debug output 2018-07-09 22:55:20 +02:00
Andreas Shimokawa
29a05f1d8f refactor onFetchActivityData() into onFetchRecordedData(dataTypes) to make it more generic
This removes misuse of testNewFunctionality() and support fetching GPS data and debug logs
Fetching debug logs (Amazfit Bip/Cor) is now accessible in the debug activity
Fetching GPS data can be done by swiping in the list activity.
TODO: actually refresh list when fetching data is done :P

Also fix some android studio warnings on the go...
2018-03-31 16:21:25 +02:00
Andreas Shimokawa
a8fdcb50f3 fix bad merge from master 2018-03-13 21:17:14 +01:00
Andreas Shimokawa
3d3cc1f40c Merge branch 'master' into bip-wip 2018-03-13 17:27:18 +01:00
Andreas Shimokawa
0ea5c3dee1 Charts: Ignore heart rate data if sample indicates that the device was not worn
Closes #1005
2018-02-26 22:06:56 +01:00
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +01:00
Daniele Gobbetti
331ca6a47e Merge branch 'master' into bip-wip 2017-11-01 22:12:13 +01:00
Daniele Gobbetti
e7839f1c39 Replace the Combined Charts with simple Line Charts
Fixes #808
The datasets had to be separed in order to fill the area below each line with the right color.
2017-11-01 17:35:05 +01:00
Daniele Gobbetti
98b04dd2fc Allow disabling left/right swipe on the graphs
Fixes #860
 Added preference to control this option
 Swiping down will still toggle a sync of the data from the device (if connected) in any case
2017-11-01 09:07:01 +01:00
cpfeiffer
eac8f5f8c7 Extract isValidHeartRate() method to HeartRateUtils 2017-10-31 23:16:39 +01:00
Andreas Shimokawa
1ff8fbac55 switch speed zones and live activity tabs
(makes it easier, since live activity is not for all devices9
2017-08-27 22:00:28 +02:00
Daniele Gobbetti
41feb008a7 Various style fixes
The top axis had the default color and was not visible with dark theme.
Enabled granularity of 1 to avoid fractions of steps being shown on the axis.
2017-08-27 17:26:24 +02:00
Andreas Shimokawa
b4639b9062 Speed Zones Chart: remove unused legend code 2017-08-27 00:04:08 +02:00
Andreas Shimokawa
6fb0a977fc rename StatsChartFragment to SpeedZonesFragment 2017-08-26 23:55:11 +02:00
Vebryn
ea6457c359 fix building error 2017-08-26 23:36:59 +02:00
Vebryn
a61cbddb5d simplifying speed zones and re-enabling 2017-08-26 23:35:16 +02:00
License Bot
15f4ce2869 Update license headers 2017-08-25 11:25:01 +02:00
cpfeiffer
c1925a4e64 Properly handle and distribute language change #733
Also centralize QUIT handling in GBActivity
2017-07-31 22:49:05 +02:00
Andreas Shimokawa
23d12f7289 Charts: various visual improvements
Thanks @girlwithnoname
2017-07-23 17:56:32 +02:00
Andreas Shimokawa
a4e35b49b2 Only show realtime chart on device supporting it 2017-06-02 21:59:46 +02:00
Translation Bot
fb8f866031 disable "Speed Zones" graph
It is not ready yet and full of bugs
2017-06-02 21:42:41 +02:00
cpfeiffer
1d79c9d93d Dark theme: set some text colors for the speed zone tab 2017-05-18 23:26:04 +02:00
Andreas Shimokawa
7cce2aeb8b Cleanup Speed zones chart code
- Remove unused stuff
- rename "pie" and "sleed" (there is no sleep and no pie here :)
2017-05-15 22:19:50 +02:00
Vebryn
7dc9c28c74 initial version of speed zones tab (#674)
* #673 initial version of speed zones tab

* #673 fix copyrights and initial step speed length
2017-05-14 23:09:27 +02:00
License Bot
8af9054f2d Update license headers 2017-04-26 00:14:25 +02:00
cpfeiffer
4a4a1e25df Properly format the sleep goal as a duration, not as a time
Also suppress trailing zeros, e.g. display
8h instead of 8h 0m
2017-04-08 23:16:33 +02:00
Alberto
155ce5be02 Font size bar chart (#645)
Increas font size bar chart

small fix that improves the readability of the values on bar charts
2017-04-08 22:58:58 +02:00
cpfeiffer
2feb3bed47 Reduce animation time from 350ms to 250ms
(seemed a bit laggy to me)
2017-04-08 22:52:22 +02:00
Daniele Gobbetti
dd5ee03932 Set the right color for the Pie charts entry labels.
Closes #647 by showing the text also on the light theme, instead of hiding it everywhere.
2017-04-08 15:50:13 +02:00
Daniele Gobbetti
5a019c238a Hide the dateBar but don't set it as gone, this prevents charts from changing size when swiping. 2017-04-08 15:16:35 +02:00
cpfeiffer
60ed9ca373 Remove default intent actions out of if-condition 2017-04-07 21:55:47 +02:00
Andreas Shimokawa
3675386c13 Fix spider arms haging out of pie slices
Also make the Pie in week sleep chart look as the other pie chart in "Your Sleep"
2017-04-05 22:42:54 +02:00
cpfeiffer
f48729cc64 Pie Charts: some improvements wrt the labels
Still room for optimization.

Thanks to Alberto!
2017-04-05 00:08:17 +02:00
walkjivefly
f0d81818b3 Swap deep and light sleep colours in charts
This partially "fixes" issue #442. The effect of the change is
purely cosmetic: deep sleep is (once again) dark blue, light sleep
is (once again) light blue.
2017-04-02 19:49:55 +02:00
Daniele Gobbetti
e89ba529c3 Apply some Material design guidelines to the charts
- replace the PagerTabStrip with a TabLayout (moved to top and scrollable)
- move the date selection to the bottom
- do not update the activity title as the tab name is much more visible now
2017-04-01 17:47:54 +02:00
Andreas Shimokawa
173b4fbbe6 Add legend ans labels to weekly sleep charts
Also remove the "missing sleep" gray entry to avoid confusion
2017-03-31 23:42:25 +02:00
cpfeiffer
14552a1a80 Disable live activity tracking when activity is paused
Fixes #496
2017-03-20 23:01:28 +01:00
Andreas Shimokawa
5d042cf3c8 Fix weekly charts to display the same value for every day Android < 7
Closes #604
2017-03-18 17:13:35 +01:00
Andreas Shimokawa
fe870ebc77 Move step goal generic, show proper sleep goal in weekly sleep goal
It is now also accessible via "About You" but still remains in the Mi Band Settings
(because it has to be setup initially by a "wizard")
2017-03-11 11:34:03 +01:00
License Bot
e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
Andreas Shimokawa
a90e0074fc Change weekly sleep charts to display sleep from 12:00-12:00 instead of 0:00-0:00 2017-03-03 17:33:00 +01:00
Andreas Shimokawa
9b2f47d10a Improvements to week sleep chart
Time to close #557
2017-03-03 14:21:59 +01:00
Andreas Shimokawa
ac1875eea0 Charts: In "Sleep a week" chart display light and deep sleep as stacked bars 2017-02-26 21:41:27 +01:00
Andreas Shimokawa
8b39ef3a52 Speedup for charts by caching aggregated sleep amounts and steps for maximum 32 days 2017-02-26 00:40:50 +01:00
cpfeiffer
49e1b55ad8 Format center-text for week-sleep-pie 2017-02-23 21:15:57 +01:00
Andreas Shimokawa
437ec6c9b7 Minor improvements to the WIP week sleep chart 2017-02-23 08:50:31 +01:00
Andreas Shimokawa
e9cb5fd374 WIP sleep in a week chart
Displays minutes which is confusing
Only displays deeps sleep (no idea why)
Is green (which is also confusing)
2017-02-21 16:20:42 +01:00
cpfeiffer
bb8aff8c99 Fix axis label color live activity (dark theme) 2016-12-26 12:51:20 +01:00
cpfeiffer
da494cde7b Handle live activity for Mi2 and Mi1 in the same way #448
Realtime samples now use ActivitySample.NOT_MEASURED for unknown or
invalid values.
2016-12-26 12:51:12 +01:00
cpfeiffer
8719cadc43 Mi Band: fix live activity messing up stepcount #448
live samples now report relative steps, not absolute to the current
day's stepcount.

Also live samples' steps should NOT be added to the database since
they are already counted in the regular stepcount.
2016-12-26 01:38:20 +01:00
cpfeiffer
305bd7600c Fix current realtime steps calculations #450
timestamp is already in seconds instead of milliseconds

Also: port to REALTIME_SAMPLES
2016-12-26 00:23:02 +01:00
Andreas Shimokawa
17b581022b optimize imports 2016-12-09 20:14:17 +01:00
cpfeiffer
2d4645f6cc Fix only the first day label being displayed in Week Steps charts 2016-11-24 23:35:10 +01:00
Andreas Shimokawa
84caf22479 fix weekly charts to start y axis at 0 2016-11-24 22:27:44 +01:00
cpfeiffer
60cb67c3c8 Some cleanup 2016-11-24 21:15:27 +01:00
cpfeiffer
dfbaba4cb6 Make sure that the charts display the requested time range
(instead of only the range with available samples)
2016-11-22 15:53:58 +01:00
cpfeiffer
96a16245df Update to MPAndroidChart 3.0.1 2016-11-18 21:31:55 +01:00
Daniele Gobbetti
b9bfb8c93a Use attr resources to enable theme dependent colors for the charts. 2016-10-29 20:29:35 +02:00
cpfeiffer
c2ff05e849 Make timestamp to mpandroidchart float x-value explicit 2016-10-08 21:27:32 +02:00
cpfeiffer
5a2ddaaec0 Use x-values instead of x indices for the charts 2016-10-08 01:35:03 +02:00
cpfeiffer
558c9e4664 Fiix visal glitch in weeksteps chart (first and last bar only partly visible) 2016-10-07 21:46:00 +02:00
cpfeiffer
e5d178b315 Fix crash with mpandroidchart 3.0pre (master) 2016-10-04 23:39:14 +02:00
cpfeiffer
75bca1b924 Update to latest master in mpac and fix labels for sleep chart as well 2016-10-04 00:09:56 +02:00
cpfeiffer
f35f76a42b Fix extraneous space at the bottom of the week steps chart 2016-10-04 00:04:04 +02:00
cpfeiffer
eccf9164f6 No need to have a separate xLabelsFormatter 2016-10-03 23:48:32 +02:00
cpfeiffer
dee492bc4f Fixes regarding xlabels -- must set them at the correct point in time
(otherwise we get ArrayIndexOutOfBoundsException when the chart
refreshes and the wrong xLabels, potentially with fewer entries are used)
2016-10-03 23:36:04 +02:00
cpfeiffer
827c99f620 Fix weekday charts, closes #403 2016-10-03 22:42:25 +02:00
cpfeiffer
dd590528dc Add back the x-labels 2016-10-03 21:53:06 +02:00
cpfeiffer
fbfc9ed97f Workaround for https://github.com/PhilJay/MPAndroidChart/issues/2317 2016-09-29 22:45:17 +02:00
cpfeiffer
f58b1f33c6 Fix parameter order for mpandroidchart 3.0 2016-09-29 22:45:17 +02:00
cpfeiffer
1b5bc23981 Initial port to mpandroidchart 3.0
does not quite work yet
2016-09-29 22:45:17 +02:00
Andreas Shimokawa
9520e23439 fix negative steps in Charts with Morpheuz 2016-08-02 00:31:29 +02:00
Andreas Shimokawa
8ea29e6e1d Refactor database / sample access (#206)
We now have separate tables for each provider's samples but a common interface.
2016-07-27 23:34:13 +02:00
cpfeiffer
f0da25c49b Fix activity fetching getting stuck when double tapping #333 2016-06-28 23:07:24 +02:00
cpfeiffer
e70a2290c3 sampleproviders now return device specific data #206 2016-06-27 20:43:48 +02:00
cpfeiffer
45fa930ac3 Properly check support for heartrate measurements 2016-06-19 23:22:28 +02:00
cpfeiffer
41e6833b2d Getting closer... db migration almost works. 2016-06-18 01:26:36 +02:00
cpfeiffer
687beee501 Migration work 2016-06-16 21:54:53 +02:00
cpfeiffer
876bdac918 More WIP: remove now unused code, better use of generics 2016-05-16 23:36:54 +02:00
cpfeiffer
40a376bbd0 Merge branch 'master' into db-refactoring 2016-05-16 23:01:16 +02:00
cpfeiffer
3e0bc16741 More WIP, but we're getting closer
current state:
- storing samples works (tested only mi band)
- charts work
2016-05-16 23:00:04 +02:00
Andreas Shimokawa
d66f842e9b Mi Band: Make sure live activity gets stopped when using the back button 2016-05-15 22:24:37 +02:00
cpfeiffer
8ca821ab8a More WIP on db refactoring 2016-05-13 23:47:47 +02:00
Andreas Shimokawa
3fefb57fdd Fix colors in alarm activity for dark theme 2016-04-23 23:24:56 +02:00
Andreas Shimokawa
a9e7cdcaa7 use some colors from the theme for charts activity 2016-04-14 17:41:04 +02:00
Andreas Shimokawa
4bcebca744 Work towards dark theme, remove -v21 specific theme definition 2016-04-14 15:21:25 +02:00
cpfeiffer
b25a47c398 Immediately disable hr reading and activity tracking when leaving the tab #273 2016-04-13 23:36:14 +02:00
cpfeiffer
e87a357bed Show separate curves when the time between two measurements is too long #273 2016-04-13 21:38:35 +02:00
cpfeiffer
ae5d9089d8 Slight improvement to hr charts #178 2016-04-13 21:21:10 +02:00
cpfeiffer
f15a97d994 Initial live heartrate measurement in the live activity tab #178 2016-04-12 23:12:50 +02:00
cpfeiffer
7ab31514dc Rework charts to completely fix crash in charts activity #277 2016-04-11 23:18:12 +02:00
cpfeiffer
42dda911e4 Fix crash in charts activity, closes #277 2016-04-08 23:02:50 +02:00
cpfeiffer
403f74e59b Enable heart rate charts #232
(And fix some charting issues)
2016-04-04 23:05:20 +02:00
Andreas Shimokawa
4be1926459 reformat code though Android Studio 2016-03-20 15:00:05 +01:00
cpfeiffer
a96120f91d Clear the chart when there are no samples
(e.g. when switching to another day for which no samples are
available, the chart now becomes empty instead of displaying the
samples from the last day with data.
2016-03-07 23:17:02 +01:00
cpfeiffer
25e58eb414 Upgrade mpandroidchart to 2.2.3 2016-03-07 22:46:03 +01:00
Andreas Shimokawa
ed85fd5011 convert byte and short values related to activity tracking to int
This avoids a lot of problems because java
- does not know unsigned values
- jvm and dalvic do not internally support byte and short
- sqlite does not know them either
2016-02-29 20:54:39 +01:00
cpfeiffer
3ff31cd73b Disable heartrate in charts fow now, fix notification for manual hr 2016-02-27 23:18:44 +01:00
cpfeiffer
d6dfc3b6ec Fix some ClassCastExceptions in charts since switching to CombinedChart 2016-02-27 15:30:46 +01:00
cpfeiffer
de6f898fef Some more fixes regarding heart rate measurement #178 2016-02-27 11:18:16 +01:00
cpfeiffer
0ef738067d Some work in progress for heart rate graphs #178
Currently we get the heart rate when synchronizing activity data
(i.e. not live) and we write it to the activity database so that we
can show a nice graph. The value is currently always 0 though,
because we can't enable recording hr, yet.
2016-02-26 23:45:17 +01:00
cpfeiffer
159c187e5e On Quit, remove all pending notifications
At least the notifications from #141 don't stay there forever, then.
2015-12-08 21:48:56 +01:00
cpfeiffer
bd0716ba58 Some more lint warnings fixed 2015-11-23 23:04:46 +01:00
cpfeiffer
81c2f657bd Some lint fixes 2015-11-23 22:46:12 +01:00
cpfeiffer
ebbb71ae9d Update MPAndroidChart to 2.1.6 2015-11-13 23:57:04 +01:00
cpfeiffer
2e267a4c2b Temporary workaround for totally wrong sleep stats
The reason being that we filter samples by activity kind
and then calculate the total sleep time using a delta between two
consecutive sample timestamps. But due to filtering of samples, not
all samples are consecutive. Instead of we have "holes" and add those
to your sleep time.

The data in the db is correct though (it always is), it's just the
display in the app that is wrong.
2015-11-09 23:56:46 +01:00
cpfeiffer
d9722c6db2 Translate strings, remove unused variable 2015-11-09 23:56:46 +01:00
cpfeiffer
4200e77016 Disable activity data fetching when not supported
Closes #149
2015-10-24 23:28:55 +02:00
cpfeiffer
aa5749cd40 Some improvements to live activity.
Still rather inaccurate due to missing timing information.
2015-10-21 00:36:18 +02:00
cpfeiffer
45fc2c181c Add pulldown to sync and tabs in the charts activity #138 2015-10-17 17:10:14 +02:00
cpfeiffer
0d27245dd1 Some more translations + reoder live activity layout 2015-10-04 00:17:24 +02:00
cpfeiffer
93523d7831 Fix crash introduced by translation before onCreate() 2015-10-03 10:08:48 +02:00
cpfeiffer
baa2d0b27a Displaying live activity data works well enough 2015-10-02 23:38:07 +02:00
cpfeiffer
c9e91bd708 Some work in enabling the history of step count
Doesn't work yet.
2015-10-02 00:07:19 +02:00
cpfeiffer
2149b18ae3 Yay, animating live activity data works.
Nice hack: MPAndroidChart supports animating values, but only animating
a new entry, going from zero to its actual value. We want to animate
a single entry changing its value.

Since it's just a single entry, we can let a custom animator do this
(without knowledge of any other entries).
2015-10-01 22:36:33 +02:00
cpfeiffer
4250a002b4 Merge branch 'master' into live-activity-data 2015-09-27 00:16:04 +02:00
cpfeiffer
0395977fde Some work for properly animating our single (value-changing) entry 2015-09-27 00:10:33 +02:00
Andreas Shimokawa
1d41f2f8e4 Refactoring
The notfification APIs now use NotificationSpec as their only parameter, which
contains all information (required and optional ones).
We no longer have separate methods and actions for SMS/EMAIL/GENERIC anymore.
The type of notification is important now, not how we received them technically.
2015-09-24 14:45:21 +02:00
cpfeiffer
8ba307657a Migrate from MPAndroidChart 2.1.0 to 2.1.4
This actually makes our CustomLegendRenderer and CustomBarChart
unnecessary.
2015-09-24 00:04:21 +02:00
cpfeiffer
d9d222ca9b Tiny logging improvement 2015-09-09 21:15:29 +02:00
cpfeiffer
bc3c0760d0 More WIP with live activity charts 2015-09-05 23:05:57 +02:00
cpfeiffer
8f4e933e30 More WIP on live activity:
- keep screen on while live activity is visible
- hide the date bar (prev&forward buttons)
- live activity chart is still nowhere near usable
2015-09-04 21:55:29 +02:00
cpfeiffer
9a1f4875fc Temporary backup with live activity 2015-09-03 23:20:47 +02:00
cpfeiffer
42420e676b More WIP: displays live activity data 2015-09-02 23:49:06 +02:00
cpfeiffer
ab8982e7f2 WIP: support for live display of activity data 2015-09-02 08:02:26 +02:00
cpfeiffer
536b2bd8a0 Another translatable string 2015-09-01 23:56:14 +02:00
cpfeiffer
c49c795b1d Actually remove that implicit "current date" handling
We now manage days explicitly in the UI.
2015-09-01 22:43:31 +02:00
cpfeiffer
d791054e42 Fix getLast24Hours() -- take end time into account 2015-09-01 22:37:20 +02:00
cpfeiffer
a6d18e599b Tiny simplification and extract string 2015-09-01 22:34:04 +02:00
cpfeiffer
917801f223 Use the correct date for displaying steps #91 2015-09-01 22:13:30 +02:00
Daniele Gobbetti
9360b81ef3 Don't add new limitlines, clean the existing one before (it could be optimized further by reusing the existing one, probably) 2015-08-31 17:41:09 +02:00
Daniele Gobbetti
249ff5bf94 Let the user change date also on the Week steps chart 2015-08-31 17:41:09 +02:00
Andreas Shimokawa
13300fcb5d finally fix build with SDK 23 2015-08-29 11:31:48 +02:00
Daniele Gobbetti
26792717d4 Add showing when the device wasn't worn by the user 2015-08-28 14:58:30 +02:00
Daniele Gobbetti
fb5ebeacb6 Light colors for the graphs.
Closes #99
2015-08-28 14:58:30 +02:00
cpfeiffer
e1c02cc373 Prevent charts date in the future, documentation and cleanup 2015-08-25 22:45:07 +02:00
cpfeiffer
b4e34db1d2 Faster animation 2015-08-25 01:03:58 +02:00