Skip to content

Snooze/dismiss support in toast button builders #3694

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

Merged
6 commits merged into from
Feb 9, 2021

Conversation

andrewleader
Copy link
Contributor

Fixes #3614

The toast button builders we added in 7.0 so far didn't support snooze/dismiss activation, it makes sense to have a single way of constructing a button regardless of the activation type.

Additionally, this helps us converge on using Uri types for images rather than string as mentioned in issue #3614.

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

Had to use a separate button type previously...

new ToastContentBuilder()
                
    .AddButton(new ToastButton()
        .SetContent("Delete")
        .SetImageUri(new Uri("delete.png"))
        .AddArgument("action", "delete")
        .SetBackgroundActivation()

    .AddButton(new ToastButtonDismiss()
        {
            ImageUri = "dismiss.png"
        });

What is the new behavior?

Can use the same button builder, and the image consistently uses Uri type.

new ToastContentBuilder()
                
    .AddButton(new ToastButton()
        .SetContent("Delete")
        .SetImageUri(new Uri("delete.png"))
        .AddArgument("action", "delete")
        .SetBackgroundActivation()

    .AddButton(new ToastButton()
        .SetImageUri(new Uri("dismiss.png"))
        .SetDismissActivation());

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@ghost
Copy link

ghost commented Jan 27, 2021

Thanks andrewleader for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

Copy link
Contributor

@Kyaa-dost Kyaa-dost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewleader, Thanks for all the work and for submitting the PR.

For testing purposes, whenever I am trying to run the sample app it keeps breaking for me the moment I select the Toast sample app and constantly encountering the following error. Wondering if you are able to repro this as well?

image

@andrewleader
Copy link
Contributor Author

Whoops, fixing!

@andrewleader
Copy link
Contributor Author

Alright fixed!

@michael-hawker michael-hawker added the next preview ✈️ Label for marking what we want to include in the next preview release for developers to try. label Feb 8, 2021
@michael-hawker michael-hawker added this to the 7.0 milestone Feb 9, 2021
@ghost
Copy link

ghost commented Feb 9, 2021

Hello @michael-hawker!

Because this pull request has the auto merge :zap: label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@michael-hawker
Copy link
Member

@msftbot merge if @Kyaa-dost approves.

Think we're good @andrewleader, this will be in the next preview dropping once we close our our next-preview labeled items. @Kyaa-dost's just going to check the sample one last time.

@ghost
Copy link

ghost commented Feb 9, 2021

Hello @michael-hawker!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

Copy link
Contributor

@Kyaa-dost Kyaa-dost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andrewleader for the fix. We are looking good 🚀

@Kyaa-dost
Copy link
Contributor

@msftbot nevermind

@ghost
Copy link

ghost commented Feb 9, 2021

Hello @Kyaa-dost!

Because you've told me to reset the custom auto-merge settings, I'll use the configured settings for this repository when I'm merging this pull request.

@ghost ghost merged commit 10fbbad into master Feb 9, 2021
@ghost ghost deleted the aleader/notif-api-consistency branch February 9, 2021 19:50
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merge ⚡ improvements ✨ next preview ✈️ Label for marking what we want to include in the next preview release for developers to try. notifications 🔔
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Consistency of URI usage
3 participants