This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ngs (#508) * #474 Add setters to the snackbar options #477 Snackbar default settings * Use TimeSpan for Duration Co-authored-by: Gerald Versluis <[email protected]> Co-authored-by: Andrei <[email protected]> Co-authored-by: Vladislav Antonyuk <[email protected]>
- Loading branch information
1 parent
d41a3b0
commit 43b8dbd
Showing
16 changed files
with
213 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
XamarinCommunityToolkit/Views/SnackBar/Options/ActionOptions.shared.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
XamarinCommunityToolkit/Views/SnackBar/Options/ToastOptions.shared.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Xamarin.Forms; | ||
|
||
namespace Xamarin.CommunityToolkit.UI.Views.Options | ||
{ | ||
/// <summary> | ||
/// Toast options | ||
/// </summary> | ||
public class ToastOptions | ||
{ | ||
public ToastOptions() => Result = new TaskCompletionSource<bool>(false); | ||
|
||
/// <summary> | ||
/// Message options: Message, color, font | ||
/// </summary> | ||
public MessageOptions MessageOptions { get; set; } = DefaultMessageOptions; | ||
|
||
public static MessageOptions DefaultMessageOptions { get; set; } = new MessageOptions(); | ||
|
||
/// <summary> | ||
/// Background color. | ||
/// </summary> | ||
public Color BackgroundColor { get; set; } = DefaultBackgroundColor; | ||
|
||
public static Color DefaultBackgroundColor { get; set; } = Color.Default; | ||
|
||
/// <summary> | ||
/// Is Right to left | ||
/// </summary> | ||
public bool IsRtl { get; set; } = DefaultIsRtl; | ||
|
||
public static bool DefaultIsRtl { get; set; } = false; | ||
|
||
/// <summary> | ||
/// The duration for the SnackBar. | ||
/// </summary> | ||
public TimeSpan Duration { get; set; } = DefaultDuration; | ||
|
||
public static TimeSpan DefaultDuration { get; set; } = TimeSpan.FromMilliseconds(3000); | ||
|
||
/// <summary> | ||
/// Result is true if ActionButton is clicked. | ||
/// </summary> | ||
public TaskCompletionSource<bool> Result { get; } | ||
|
||
public void SetResult(bool result) => Result.TrySetResult(result); | ||
} | ||
} |
Oops, something went wrong.