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

1217 Commits

Author SHA1 Message Date
cpfeiffer
d4f070f0aa Simplify external dir handling again -- prefer the primary dir
The primary external dir is often a user-partition on the internal
storage medium. This one is safe in multi-user environments.

The "removable storage" (sdcard) on the other hand can be read by
everyone. If the former is not available or not writable, use the
latter.

closes #153
2015-11-01 20:49:50 +01:00
cpfeiffer
39c7a853c8 Improve error logging: #153 2015-10-26 22:45:43 +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
4e0fed8857 Improvements to how and when alarms are sent to the device
They are now sent whenever the Alarms activity is finished.
Display "All alarms disabled" when no alarm is enabled.

Unrelated: pass exceptions to GB.toast() where applicable.
2015-10-18 23:52:59 +02:00
cpfeiffer
b43e96318a Also support pulldown to sync in ControlCenter #138
Should factor out some common code between ChartsActivity
and ControlCenter, though.
2015-10-18 01:39:25 +02:00
cpfeiffer
1e56e540fa Remove hardcoded equals("MI") in favor of DeviceCoordintator #136 2015-10-18 01:01:13 +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
c8a08510ce always initialize checkboxes AppBlacklistActivity, not only when App is in blacklist
Closes #129
2015-09-25 21:33:35 +02:00
Andreas Shimokawa
e3533a2b18 Pebble: Allow muting (blacklisting) Apps from within generic notifications on the watch
Closes #113
2015-09-25 00:53:40 +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
Andreas Shimokawa
98b1abedac Allow phone call notifications (also in call display) to be disabled in preferences
This will allow Pebble Dialer to handle these #106
2015-09-20 22:04:53 +02:00
Andreas Shimokawa
58bbcb0035 Pebble: allow to configure reconnect attempts
This should help #89
2015-09-17 15:31:12 +02:00
Andreas Shimokawa
6e3c839608 Allow to select preferred music player in preferences, closes #112 2015-09-16 00:53:54 +02:00
Andreas Shimokawa
95e22a4e32 Pebble: Allow stopping apps though PebbleKit messages (also in the API) 2015-09-13 21:44:26 +02:00
Andreas Shimokawa
914d1b9625 Make notification blacklist actually working 2015-09-12 00:19:36 +02:00
Andreas Shimokawa
03b9f02b2c Pebble: allow launching internal Golf and Sports App if untested features are enabled
This is completely useless for now, but since it is there on every Pebble, I want to be able to launch it.
2015-09-10 23:07:42 +02:00
Andreas Shimokawa
0ad758fbca WIP blacklist activity (currently does nothing except listing apps) 2015-09-10 13:48:54 +02:00
cpfeiffer
d9d222ca9b Tiny logging improvement 2015-09-09 21:15:29 +02:00
cpfeiffer
518b1ee6f4 Merge branch 'master' into live-activity-data 2015-09-07 21:41:02 +02:00
Daniele Gobbetti
6c28b50f52 allow the transfer of activity data without clearing MiBand's memory 2015-09-07 12:06:56 +02:00
cpfeiffer
1711a7a731 Merge branch 'master' into live-activity-data 2015-09-06 00:46:50 +02:00
cpfeiffer
fbd23c2d4c Some layout improvements (#30) 2015-09-06 00:03:56 +02:00
cpfeiffer
bc3c0760d0 More WIP with live activity charts 2015-09-05 23:05:57 +02:00
cpfeiffer
5f993c0049 Merge branch 'master' into live-activity-data 2015-09-05 00:15:49 +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
Andreas Shimokawa
ab29736a50 Pebble: Implement "Open on Phone" function for generic notifications
TODO:
- search a better icon for the Pebble Time
- send a reply to the OG Pebble to prevent the error message from popping up
2015-09-02 22:43:22 +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
cpfeiffer
41d8bcf634 Make firmware and app installation a bit more user friendly #30 2015-08-30 00:21:51 +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
cpfeiffer
0bb3188bc8 Start and end dates now work properly across charts
They are now managed by the Activity, because the fragments
may be created and destroyed at any time and hece cannot
synchronize their date-state all the time.

Open issue: moving across the borders (first day with data,
current day)
2015-08-25 00:54:16 +02:00
cpfeiffer
e47ebb8f09 Improvements to charts
- backward and forward buttons work better
- buttons only refresh the current fragment now
- activity shows fragment-specific titles
2015-08-25 00:33:37 +02:00
cpfeiffer
070876db06 Allow disconnecting when device is connecting
Also require "initialized" state for "find device"
2015-08-24 13:19:17 +02:00
cpfeiffer
a1cb246e27 Add and use a "client interface" for the actions of the service
Previously, the DeviceCommunicationService was invoked directly,
via
Intent intent = new Intent(foo, bar);
intent.setExtra(EXTRA_BAZ, baz);
startService(...);

and this was scattered throughout GadgetBridge.
Now there is a "frontend" available, so that you can call
the service more easily, like
GBApplication.deviceService().connect();

For a start, this client interface (DeviceService) actually
implements the same interface (EventHandler) as the receiving side
(DeviceSupport). This may change in the future.

This will also make testing much easier, because we can use
this client interface to invoke the test service as well.
2015-08-21 01:03:57 +02:00
Andreas Shimokawa
faaa04b670 App Installation: various improvements
- make FwAppInstallerActivity wait for a completely initialized device
- check basalt/aplite compatibility with pbw to be installed and report intead of crashing
- fix crash when trying to install pbw with all app slots full
2015-08-20 18:55:22 +02:00
cpfeiffer
5a4f8fb56f Last commit accidentally called the wrong get*Samples method 2015-08-19 01:06:46 +02:00
Andreas Shimokawa
a7796ecbc6 Pebble: Emulator support
NOTE:
- supports aplite and basalt emulator
- needs recompilation of Gadgetbridge with INTERNET permission

TODO:
- fix disconnect issues
- emulator special packet support
- string localization
- ...
2015-08-19 00:06:15 +02:00
Andreas Shimokawa
6fede31bdf Pebble: make watchapp installation available on FW 3.x without the need for setting an option 2015-08-17 18:07:47 +02:00
cpfeiffer
bcf42f8022 Finally, the prev and next buttons do something (#79)
Far from perfect, but a start.
2015-08-17 02:22:16 +02:00
cpfeiffer
27a9eb8a07 Only repaint chart when activity is still alive
(fixes error message when synchronizing in the charts activity and then
switching orientation)
2015-08-16 23:27:18 +02:00
cpfeiffer
567f27b0f4 Some initial fixes found by static analysis #92 2015-08-16 00:17:16 +02:00
cpfeiffer
d0229847e7 onFirmwareVersionReq() is no more
- version information is now provided implicitly by device initialization
- ACTION_REQUEST_VERSIONINFO is now ACTION_REQUEST_DEVICEINFO and it will
  return the current device state of the service without asking any DeviceSupport
  instance.
- ACTION_CONNECT now implicitly answers with a device update intent if it
  IS already connected.
2015-08-14 23:37:47 +02:00
Andreas Shimokawa
749fbe5ecc Pebble: fix crash with emply pbw cache 2015-08-13 10:06:32 +02:00
Andreas Shimokawa
6ed54484a6 Pebble: only fill app list in AppManager with cached apps once in onCreate()
This is important for FW 3.x testing, since the REFRESH intent
will never arrive and we want to see cached watchapps
2015-08-11 14:16:08 +02:00
Andreas Shimokawa
e43fed2e7e Pebble: various preparations for FW 3.x support
- Implement encodeAppStart() for FW 3.x
- List cached PBWs in AppManager (currently only UUID)
2015-08-11 13:55:35 +02:00
Andreas Shimokawa
5a8c9a9180 Pebble: cache installed pbw files on sdcard if force untested option is set
This will be needed for FW 3.x on demand installations.
2015-08-11 12:04:45 +02:00
Andreas Shimokawa
27f88e484d Make ControlCenter only ask for version details after device is initialized
This allows removal of a workaround which allowed ACTION_REQUEST_VERSIONINFO
to be used in connected state (instead of initialized state)
2015-08-07 22:07:48 +02:00
cpfeiffer
9004a8b0c1 Experimental: ACTION_START is now optional -- ACTION_CONNECT is sufficient 2015-08-06 23:17:41 +02:00
cpfeiffer
64298fc9af Small improvements for the install activity #30
Now starts the service if not already running
2015-08-06 21:35:00 +02:00
cpfeiffer
2a2eae068a Improvements to the install activity #30
- made it independent of Mi fw and Pebble fw + app classes
- automatically connect to the last used device
- some other small fixes/improvements
2015-08-06 02:17:38 +02:00
Daniele Gobbetti
65fc6f6866 Adapt the Firmware installer activity to the new FirmwareHelper 2015-08-05 17:31:11 +02:00
cpfeiffer
c407ed1a76 Last refactoring for now: BluetoothCommunicationService
- rename to DeviceCommunicationService
- move all bluetooth related bits into separate DeviceSupportFactory
  class
2015-08-04 01:01:14 +02:00
cpfeiffer
7c597b325a Big refactoring: move classes and packages around to get a better structure
- model package contains mostly shared interfaces (UI+service), not named GB*
- impl package contains implementations of those interfaces, named GB*
  the impl classes should not be used by the service (not completely done)
- the service classes should mostly use classes inside the service and deviceevents
  packages (tbd)

Every device now has two packages:
- devices/[device name] for UI related functionality
- service[device name] for lowlevel communication
2015-08-03 23:09:49 +02:00
Daniele Gobbetti
c798cd00fe Prevent tearing of the barchart values over other graph elements 2015-08-03 18:34:58 +02:00
cpfeiffer
802f48011d Refactoring of database access
- the db is now exclusively locked for one thread
- the charts read from the db and analyze data in a background thread

+ some small cleanups
2015-08-03 01:21:44 +02:00
Daniele Gobbetti
878afd79df Allow the user to set the target number of steps for each day (fitness goal), both in the sharedpreferences and in the MiBand.
The value is then used in the graphs.

#31 #44
2015-07-29 18:49:16 +02:00
Daniele Gobbetti
27669761bf Fix potential race condition when counted steps are above the daily target.
Also added a few comments wrt the labels and the values of the pie chart.
2015-07-29 18:07:35 +02:00
Daniele Gobbetti
c05cfc775e New chart showing the steps done today and in the last week.
#31 #44
2015-07-29 16:30:19 +02:00
Andreas Shimokawa
9f591ef8b5 Refactoring: Merge Pebble app/fw installer activity and Miband firmware update Activity 2015-07-28 17:30:20 +02:00
cpfeiffer
858c962dd0 Refactoring #45
- add some device and db independent model interfaces for activity samples
- use these model interfaces where possible
- chart activity does not do device dependent rendering anymore and uses
  normalized values for all devices
- initial interface for daily summaries
2015-07-28 00:05:05 +02:00
Andreas Shimokawa
91b8d7789d Pebble: improvemnts for upcoming Gadgetbridge Pebble watchapp 2015-07-27 23:21:06 +02:00
Andreas Shimokawa
dbbcf20bbc reformat code 2015-07-25 21:52:52 +02:00
cpfeiffer
1f2b0329c5 Misc improvelets (#45) 2015-07-21 21:24:35 +02:00
cpfeiffer
0f6491a11d More WIP: sync from the charts activity
Also add preliminary buttons to go forward/backward in time.
2015-07-21 00:06:20 +02:00
cpfeiffer
184e0f2dea New dependency to format durations (and use that where applicable) 2015-07-20 23:14:08 +02:00
Andreas Shimokawa
e6bc406d98 Fix funny typo :D
Thanks to @girlwithnoname for spotting
2015-07-18 23:38:59 +02:00
cpfeiffer
d498bd976a Work in progress #45
Comparison between Light Sleep and Deep Sleep.
(Currently wrong, needs more analysis)
2015-07-14 00:29:32 +02:00
cpfeiffer
b1e2671bec limit maximum intensity to 180 for now... maybe make this configurable #45 2015-07-13 21:55:52 +02:00
cpfeiffer
04e628b2d1 Separate fragments for all activity kinds and just sleep #45 2015-07-13 21:54:46 +02:00
cpfeiffer
8b44f90bb6 Some more refactorings to support different charts 2015-07-12 23:42:23 +02:00
cpfeiffer
623e4724c2 Slightly better text when no data available 2015-07-12 21:48:48 +02:00
cpfeiffer
a6e26e5ddc Cleanup, use fragment based charts (WIP #45)
Known issue: scrolling a zoomed-in chart interferes with swiping to the
next/previous chart (so far there's just one, but...)
Workaround: Swipe down and then left or right in one go, this will let
you scroll the zoomed chart
2015-07-11 00:03:41 +02:00
Andreas Shimokawa
b25d771ee9 reformat code 2015-06-30 12:09:29 +02:00
Daniele Gobbetti
371a7bb4af Get rid of the Checkedtextview because they weren't in line with the our style 2015-06-30 06:40:46 +02:00
Daniele Gobbetti
900511760c further improvements:
- the day of week are evenly spread across the screen in the alarms detail activity
- the alarms are stored in a single shared preference (as a set) NB: you'll have to reset your alarms if you used a previous version (and also manually clean the shared preferences, but this is not needed)
- the list of alarms gets correctly updated after editing a specific alarm
- the actionbar back button saves the alarm status, the device back button doesn't. I'm not sure if it's a bug or a feature :)
2015-06-30 06:40:46 +02:00
Daniele Gobbetti
dc3ed1659c use parcelable for passing alarms around 2015-06-30 06:40:46 +02:00
Daniele Gobbetti
1caca1439a Initial implementation of setting alarms to the Mi Band.
The code basically works, but there a lot of things to fix / improve.
* The alarms are stored to and read from the Shared Preferences, but there is no persistence within the app (basically they are read and stored at every access)
* The alarm list is not updated when coming back from the alarm detail view (probably related to the point above), but the actual alarm is
* The alarms preference names is sometimes built by concatenating strings, which is not really safe
* There is no check in the alarm constructor whether the stored string is a valid alarm representation
* Even though only 3 alarms can be stored on the device, we could have more in the app and let the user choose which to sync
* In the alarm detail view XML some material* drawables are used, it's possible that these break on android version < 5
* ...
2015-06-30 06:40:14 +02:00
cpfeiffer
4b241ca9eb Initial work on supporting multiple charts.
- one fragment per chart screen
- common chart code should move to fragment baseclass and the host
  Activity (ChartsActivity)

Currently it's not used, change ControlCenter to invoke ChartsActivity
instead of SleepChartActivity to test it.

WIP for #79
2015-06-23 23:03:05 +02:00
Andreas Shimokawa
73da7fff0a Refactoring: rename GBDeviceCommand to GBDeviceEvent 2015-06-23 11:54:33 +02:00
cpfeiffer
1fb20926b3 Fix previous commit, disable LimitLines for this release 2015-06-21 19:43:45 +02:00
Andreas Shimokawa
b1973994f0 Sleep Monitor: Disable anotations for now (produces unreadable output on some devices) 2015-06-21 16:39:03 +02:00
cpfeiffer
e562fa9870 Light sleep and deep sleep was mixed up. Corrected graphs again. #45
Use dashed limit lines, still not perfect.
2015-06-19 01:14:58 +02:00
cpfeiffer
f9e5ab5fc1 Some more refinements to sleep display (#45):
- display the recorded level of deep sleep rather than a constant
  (I hope this works for morpheuz, too!?)
- give light sleep a minimum value, because it's sometimes 0 for Mi Band
2015-06-19 00:20:38 +02:00
cpfeiffer
03fa05756e As a test, draw limit lines for sleep/activity changes.
Unfortunately it looks like the labels for it don't get rendered ;-(
2015-06-18 23:41:54 +02:00
Andreas Shimokawa
bffd7f332f remove SleepChartActivityOld, as the new one is usable now ;) 2015-06-17 08:18:24 +02:00
cpfeiffer
a5ae7acc63 Improved sleep chart #45
- use just one data set, because multiple data sets is not supported
  by MPAndroidChart (the way we need it)

Now there is hardly any space between the bars anymore

Also:
- allow scaling x and y axis independently via pinch gesture
- set fixed y max value (1.0) so that the display is stable and
  independent of the actual available data
- (at least temporarily) display y labels
2015-06-17 07:03:50 +02:00
cpfeiffer
8709b95a95 Use a single data set instead of one per activity kind
The reason is that multiple data sets will always be grouped.
If we add null values to fix the grouping issue, we will still have
space between the bars.
2015-06-17 07:03:50 +02:00
Andreas Shimokawa
70c021e92c SleepChartActivity: Make light sleep color brighter 2015-06-13 20:47:36 +02:00
Andreas Shimokawa
73187431b2 Use old Sleep Monitor Activity for Pebble/Morpheuz
The new one does not look good with Morpheuz data yet (samples every 10 minutes)
2015-06-13 20:37:53 +02:00
Daniele Gobbetti
75de3b21e1 Use colors that are easier on the eyes
Changed the colors of the Deep-/Light Sleep and Activity datasets.
* Deep sleep has been used as basic color,
* Light sleep is a color that is monochromatically analogous
* Activity is a color triadic to the basic one
2015-06-12 11:17:44 +02:00
cpfeiffer
8aef92026c A new sleep chart based on MPAndroidChart 45
- supports zooming an panning
- displays labels for all x-values (= time of day)
- fix deep vs. light sleep constants
- increase activity data buffer size for Mi Band
2015-06-11 23:37:00 +02:00
Andreas Shimokawa
1b2f20160a fix some lint warnings, mostly simplifications 2015-05-12 20:09:35 +02:00
cpfeiffer
9a26769c3e Search & replace: use slf4j for logging instead of Logcat directly
For a start, use android-logger as backend. Needs a better configuration
but no time right now.

For file-logging we will use logback as slf4j-implementation.
2015-05-12 06:33:37 +02:00
cpfeiffer
bd2d5fd608 Ensure that device list is refreshed when changing MAC address
(the set-summary preference change listener overwrote our own
listener)
2015-05-10 21:12:10 +02:00
cpfeiffer
a23690c8e1 Initial support for Mi Band specific settings
(User info for now).

TODO: We need to have that information *before* starting a connect
2015-05-07 01:32:17 +02:00
cpfeiffer
9df661bd96 Initial (ugly) support for device discovery and pairing (#3) 2015-05-05 00:48:54 +02:00