JohanDegraeve / xdripswift

xdrip for iOS, written in Swift
GNU General Public License v3.0
327 stars 320 forks source link

UI Update #443

Closed BrightScreenTV closed 1 year ago

BrightScreenTV commented 1 year ago

Hi,

I've re-designed the main, home screen UI a little: the level display now has colour coded surrond and the strikethrough attribute is no longer used. Changes.md lists everything:

Main Changes

Added custom BGView to take of displaying the main blood glucode level. This consists of:

A more strictly formatted number (so that when user is panning, the number doesn't bounce left and right as the text is centred in the screen) for the level.

A re-designed time stamp view that displays the current time and nothing else when the use is not panning the graph and the level displayed is the latest one.

A re-designed delta view that has a guage with an arrow. The arrow is angled according to the rate of change (also displayed in text next to it) and as the rate becomes more severe, a secondary arrow will begin to appear behind it to emphasise the rate to the user.

The current BlueTooth status; connected, connecting, disconnecting, and dosconnected (seen from left to right under the BG level digits). This is designed to reflect what is shown in the BlueTooth view.

The level view is colour-coded rather than using strikethrough text. I felt this has a clearer visual interpretation than using struck through numbers as this always appeared to represent some sort of 'invalid' reading.

The view goes light grey when the user is panning through the chart and when they are displaying the current level it is colourised according to the level (green, yellow or red).

Also fixed a bug where the bottom of the stackview on the home screen would disappear behind the tab controller. This appears to be because the safe area of the main view disappears somehow when the device is rotated back to portrait.

Other changes

In RootViewController added computed iVar for UserDefaults.standard.bloodGlucoseUnitIsMgDl for purposes of ease of reading.

In BgReading+CoreDataClass tidied documentation (during reverse engineering to understand slope values) Moved the logic of unitizedString(_:) to a static func _unitizedString(_:) to make it available to all modules. unitizedString(_:) now calls this static member (left in place to minimise rewriting)

Extended the enum BgRangeDescriptor to include the cases: ugentLow urgentHigh

Added to String extensions:

mgDl = "mg/dL" mmolL = "mmol/L"

Changed passed in parameter of mgdlToMmolAndToString(_ :) to thisIsMgdL for ease of reading

Changed viewWillAppear(_ animated: Bool) in TreatmentsViewController to update black, translucent settings for ios 13.0+

Changed String extension, hexStringToUIColor() to use UInt64 and scanHexInt64(_:)as per deprecated warning for ios 13.0+

Modified unitizedDeltaString(previousBgReading:BgReading?, showUnit:Bool, highGranularity:Bool, mgdl:Bool) to return a Tuple of the string and the Double value. This is used by the new delta view in my code.

Added

static let UsersUnits = {
    return UserDefaults.standard.bloodGlucoseUnitIsMgDl ? Texts_Common.mgdl : Texts_Common.mmol
}()

To Texts_Common

Added extensions for:

Bool - now you can obtain a '1' or '0' according to the bool state, useful for alpha animations.

UIFont - static's to allow for easier change of fonts.

Double - now MMOL and MGDL are numeric types akin to Double. This helps with reading of code and logic flow. Only used in my changes, at some point - if desired - it could be rolled out across the app)

NSLayoutContraint - added convenience functions to make instantiating constraints shorter in code.

NSParagraphStyle - added convenience functions for justifying text.

UIView - added convenience function for adding and activating constraints.

JohanDegraeve commented 1 year ago

Hi Todd,

I didn't test it yet but it looks interesting

could you first

thanks,

Johan

BrightScreenTV commented 1 year ago

Hi Johan,

Thanks for taking the time to check out my PR. I really liked the app as soon as I saw it. FreeStyle Libre's great but I don't think Abbot's completely thought through their UX.

I'll do as requested ASAP.

Regards,

Todd.

BrightScreenTV commented 1 year ago

Hi,

I think that's done now - Git scares the pants off me, so before I do can I confirm that I should press the "Force push origin" button in GitHub Desktop? Screenshot 2023-07-09 at 21 25 54

JohanDegraeve commented 1 year ago

yes after squashing you have to do a forced push.

xDrip4iOS was rejected earlier by apple because iOS is a registered trademark. We changed it to xDrip4iO5. xDrip4iOS may still appear in comments

regarding the config file : I think as a last step you could push your (squashed) commit to github. Then you can see all the changes you've done (github is good in showing diffs), then whenever you've changed $(MAIN_APP_BUNDLE_IDENTIFIER) by net.brightscreentv.xdripswift you could revert that

then do again the squash and a new force push

BrightScreenTV commented 1 year ago

Ok, I've forced the push, it seems a little stuck at the moment, so I'll leave it running and hopefully all will resolve.

The config file, I realised I could just go back to the original one that I committed straight after the fork.

Ahh, I understand about the naming now. I have to say, I can't see any xDrip at all on the UK App Store, just something called Shuggah that's identical. Presumably the developer is re-branding and packaging for download over here.

paulplant commented 1 year ago

Hi Todd,

Great work on this!!! Fantastic!

I was discussing with Johan. Let us change the PR base and merge this into a new feature branch in the main repository. That way we can work out any changes needed or undo any undesired edits as mentioned in Johan's previous message.

I'm was also about to PR some new stuff into develop branch which will now directly cause conflicts with your commits so I will stop for a few days and we'll prepare your changes for dev first. Then I will rebase and make an updated PR. 👍

paulplant commented 1 year ago

Feature branch available here

BrightScreenTV commented 1 year ago

Hi,Glad to hear you like it! Thanks.Regarding branching and PR’s: whatever you think works best. As Git is very much a weak point of mine, you might have to prompt me if I need to do something. I’ll await any further instructions.Regards.ToddOn 10 Jul 2023, at 6:55 pm, Paul Plant @.***> wrote: Hi Todd, Great work on this!!! Fantastic! I was discussing with Johan. Let us change the PR base and merge this into a new feature branch in the main repository. That way we can work out any changes needed or undo any undesired edits as mentioned in Johan's previous message. I'm was also about to PR some new stuff into develop branch which will now directly cause conflicts with your commits so I will stop for a few days and we'll prepare your changes for dev first. Then I will rebase and make an updated PR. 👍

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

paulplant commented 1 year ago

Hi Todd,

We had a good look through this yesterday and whilst there is some really great stuff here, there is also lots of stuff rolled into the PR that we would need to clean out and discuss... whole redundant folders containing images and fonts in the root directory of the PR.

Also the variable naming convention is completely different to the one used in the project (we don't use "_" prefix for private vars) and we'd need to ask you to change this to follow the actual project conventions so that it all fits in and doesn't confuse things.

What is the easiest way to discuss with you? Facebook Messenger? Telegram? Github comments are a bit slow. Where are you based?

BrightScreenTV commented 1 year ago

Hi,Sorry about that: my local project was already cleaned up but my lack of Git knowledge me has probably ruined this PR.Understood about naming convention.I’m London based, my full-time job means I’m almost completely out of contact weekdays. This kind of coding is very much done whenever I can grab a quiet time away from family.I’ve downloaded Telegram: @ToddDtnHopefully this will be a little quicker than comments!Would it be best to abandon this PR and I resubmit a new one?Todd Dalton BFEEditor: edit.brightscreentv.netAgency: @. Dalton BFEEditor: edit.brightscreentv.netAgency: @. 11 Jul 2023, at 10:10 am, Paul Plant @.***> wrote: Hi Todd, We had a good look through this yesterday and whilst there is some really great stuff here, there is also lots of stuff rolled into the PR that we would need to clean out and discuss... whole redundant folders containing images and fonts in the root directory of the PR. Also the variable naming convention is completely different to the one used in the project (we don't use "_" prefix for private vars) and we'd need to ask you to change this to follow the actual project conventions so that it all fits in and doesn't confuse things. What is the easiest way to discuss with you? Facebook Messenger? Telegram? Github comments are a bit slow. Where are you based?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

BrightScreenTV commented 1 year ago

Hi,Sorry about that: my local project was already cleaned up but my lack of Git knowledge me has probably ruined this PR.Understood about naming convention.I’m London based, my full-time job means I’m almost completely out of contact weekdays. This kind of coding is very much done whenever I can grab a quiet time away from family.I’ve downloaded Telegram: @ToddDtnHopefully this will be a little quicker than comments!Would it be best to abandon this PR and I resubmit a new one?Todd Dalton BFEEditor: edit.brightscreentv.netAgency: @. Dalton BFEEditor: edit.brightscreentv.netAgency: @. 11 Jul 2023, at 10:10 am, Paul Plant @.***> wrote: Hi Todd, We had a good look through this yesterday and whilst there is some really great stuff here, there is also lots of stuff rolled into the PR that we would need to clean out and discuss... whole redundant folders containing images and fonts in the root directory of the PR. Also the variable naming convention is completely different to the one used in the project (we don't use "_" prefix for private vars) and we'd need to ask you to change this to follow the actual project conventions so that it all fits in and doesn't confuse things. What is the easiest way to discuss with you? Facebook Messenger? Telegram? Github comments are a bit slow. Where are you based?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

BrightScreenTV commented 1 year ago

Hi,Sorry about that: my local project was already cleaned up but my lack of Git knowledge me has probably ruined this PR.Understood about naming convention.I’m London based, my full-time job means I’m almost completely out of contact weekdays. This kind of coding is very much done whenever I can grab a quiet time away from family.I’ve downloaded Telegram: @ToddDtnHopefully this will be a little quicker than comments!Would it be best to abandon this PR and I resubmit a new one?Todd Dalton BFEEditor: edit.brightscreentv.netAgency: @. 11 Jul 2023, at 10:10 am, Paul Plant @.> wrote: Hi Todd, We had a good look through this yesterday and whilst there is some really great stuff here, there is also lots of stuff rolled into the PR that we would need to clean out and discuss... whole redundant folders containing images and fonts in the root directory of the PR. Also the variable naming convention is completely different to the one used in the project (we don't use "_" prefix for private vars) and we'd need to ask you to change this to follow the actual project conventions so that it all fits in and doesn't confuse things. What is the easiest way to discuss with you? Facebook Messenger? Telegram? Github comments are a bit slow. Where are you based?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

paulplant commented 1 year ago

Don't worry, the PR is still valid... it's been merged into a feature branch and we can work on it there with you... when it's ready, we'll open a new PR to the develop branch, don't worry.

In fact I might add a new/second feature branch and pull your commits one by one into there...

I'll write to you in Telegram if that's ok and we'll go from there.