Skip to content
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

Add basic widget for iOS14 #31

Closed
wants to merge 24 commits into from

Conversation

jorgej-ramos
Copy link

Purpose

The purpose of this PR is to quickly and easily obtain the most important information from RadarCOVID, in the form of a Widget for iOS14.

Approach

Obtaining the values directly from the exposure and preferences repositories, the idea is to build a simple widget that provides the basic exposure information and last update date, as well as the status (active or inactive) of RadarCOVID.

Since I do not have access to the original development account, and the entitlements to develop applications of this type are limited, I have created a fictitious group of applications called group.es.gob.radarcovid, which should be changed at will once this PR is approved.

On the other hand, a change has been introduced to create a suite of UserDefaults without using the bundle name. You can see this change in the struct Config, in which a new static property called userDefaultsSuiteName appears.

Some images


Black spots

Since translations are automated server-side, texts has been hardcoded. This must be fixed if this feature goes on production.

I made a mistake pulling out the branch for this job and had to rebase with git rebase --onto to isolate this branch. That is why the commit date is not correct.

It would be nice to do

  • Create half and full size widgets
  • Include translations

@pvieito
Copy link

pvieito commented Sep 22, 2020

Really cool contribution, I hope the team considers accepting this feature! @alopezh

@Androp0v
Copy link

Great contribution! As a minor UI concern, I would suggest adhering to Apple's Human Interface Guidelines and changing SwiftUI's Capsule() shape for a ContainterRelativeShape() in the widget view so the corner radii of both views are concentric. Per the guidelines:

Coordinate the corner radius of your content with the corner radius of the widget. To ensure that your content looks good within a widget's rounded corners, use a SwiftUI container to apply the correct corner radius. For developer guidance, see ContainerRelativeShape.

@jorgej-ramos
Copy link
Author

Great contribution! As a minor UI concern, I would suggest adhering to Apple's Human Interface Guidelines and changing SwiftUI's Capsule() shape for a ContainterRelativeShape() in the widget view so the corner radii of both views are concentric. Per the guidelines:

Coordinate the corner radius of your content with the corner radius of the widget. To ensure that your content looks good within a widget's rounded corners, use a SwiftUI container to apply the correct corner radius. For developer guidance, see ContainerRelativeShape.

Awesome!
I didn't remember this guideline. Thank you very much for pointing that out, I'll fix it as soon as possible.

@jorgej-ramos
Copy link
Author

jorgej-ramos commented Sep 24, 2020

It's better now. Thanks @Androp0v

@jorgej-ramos
Copy link
Author

Branch has been rebased onto develop for updates

@jorgej-ramos jorgej-ramos force-pushed the add-widget branch 2 times, most recently from 42912b9 to 4251fb2 Compare October 30, 2020 17:22
@jorgej-ramos
Copy link
Author

Closed due to years of inactivity. At least, we tried...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants