-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widget for Galaxy Gear S2/3 watchface using Wearable Widgets #47
base: master
Are you sure you want to change the base?
Conversation
Added new home screen widget designed to be used with Wearable Widgets as a watch face for the Samsung Galaxy Gear 2/3 smartwatch.
Cleaned up logic of WidgetUpdateService to always run and capture clock ticks. This is necessary to keep the time accurate on the widget.
further improved startup logic to make tick capture fully reliable.
minor alignment adjustments
modified slopeToArrowSymbol to add intermediate indexing function -- future use in selecting arrow images on gear widget
added slight dimmed alpha bkgd for time/date and BG readings so graph line doesn't interfere with readability when it's behind the letters
Hi there, thanks for this. I haven't reviewed the code in any detail yet and I will likely have more questions. But at the moment it appears there is a merge conflict because of refactoring which has occurred to the master branch after your made your fork. The test which fails so far is that the static preferences reading has been moved to its own You should either try to merge the upstream master and update your code accordingly or simply add the Pref class to your tree and change the failing bits of code which still access it when it used to be inside |
Howdy. Yeah, I saw the build error checking on github, and was going to do exactly what you suggest, merging with the current master. Sorry I didn't get to it sooner -- moving in the middle of all of this, was off the radar for a few days.
I'll grab the current master, merge it, test, and do another pull request.
Dave
From: JamOrHam <notifications@github.com>
To: jamorham/xDrip-plus <xDrip-plus@noreply.github.com>
Cc: dwallersv <david@davidwaller.net>; Author <author@noreply.github.com>
Sent: Tuesday, January 30, 2018 2:51 PM
Subject: Re: [jamorham/xDrip-plus] Widget for Galaxy Gear S2/3 watchface using Wearable Widgets (#47)
Hi there, thanks for this. I haven't reviewed the code in any detail yet and I will likely have more questions. But at the moment it appears there is a merge conflict because of refactoring which has occurred to the master branch after your made your fork. The test which fails so far is that the static preferences reading has been moved to its own Pref class.You should either try to merge the upstream master and update your code accordingly or simply add the Pref class to your tree and change the failing bits of code which still access it when it used to be inside Home—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
merged the current upstream master, made the changes for the Pref class refactor. Built, tested. I'll keep watch to see if it passes the automated tests. |
@@ -55,61 +35,41 @@ public WidgetUpdateService() {} | |||
|
|||
@Override | |||
public void onCreate() { | |||
context = getApplicationContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't store the application context in a static field here, just use xdrip.getAppContext()
if you need it from static, otherwise just store it in a local variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make the change.
} | ||
} | ||
|
||
public static String slopeToArrowSymbol(double slope) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the reason for refactoring this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The up-right and down-right arrow symbols from the font are visually very different than the normal up, down, and right arrows. I did this refactoring in preparation to add some pure images for the arrows, and was going to refactor the gear widget to use them. Never got around to finishing it, but I intend to in the near future.
I've got the code in a local branch, I'll remove it for now so it's not confusing.
@@ -46,6 +47,10 @@ | |||
public void onCreate() { | |||
xdrip.context = getApplicationContext(); | |||
super.onCreate(); | |||
|
|||
//start widget update service to capture time ticks | |||
this.startService(new Intent(this, WidgetUpdateService.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a problem because its going to enable the service even if no widgets are active. How about I make a new preference option in Smart Watch Features
for Galaxy Gear / Wearable Widgets with an option users can enable. We can then make this early start conditional on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to add another setting for this. The existence of Gear widgets can be determined dynamically, so the service (and the clock tick event) can be handled properly.
Frankly, I was too focused on the Gear widget when I was doing this that I forgot about making sure the original widget was being handled properly. More in the next comment...
Log.d(TAG, "enableClockTicks"); | ||
IntentFilter intentFilter = new IntentFilter(); | ||
intentFilter.addAction(Intent.ACTION_TIME_TICK); | ||
intentFilter.addAction(Intent.ACTION_SCREEN_ON); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks from the diff like this will always be listening for clock ticks. This isn't good for anyone who isn't using wearable widgets from a power saving point of view so I would suggest that the original behavior is restored but with it always enabling listening for clock ticks when the wearable widgets preference item I suggested is enabled. I can add that item in today so you have something to work with easily.
Thanks for submitting this. I know there are gear users who are looking for this feature. I have added some by line questions where I think changes are needed. In the I plan to add the preference item later today so you can hook on to that for the changes. |
Widget for Galaxy Gear S2/3 watchface using Wearable Widgets is it available? |
how can I show time in the Widget in Galaxy Gear S2/3 watchface using Wearable Widgets ? |
Implemented a second widget for use with the Wearable Widgets application to display BG information and trend graph with prominent time/date displayed.
Cleaned up a few typos encountered while coding.
Redesigned WidgetUpdateService to reliably handle system clock ticks (minute boundaries) so that Gear Widget time stays minute-accurate.