├── .github
└── workflows
│ ├── create_prerelease.yml
│ ├── create_release.yml
│ └── dotnetcore.yml
├── .gitignore
├── LICENSE.md
├── README.md
├── Xam.Forms.GraceAlert
├── Nuspecs
│ └── Xam.Forms.GraceAlert.nuspec
├── Xam.Forms.Example
│ ├── Xam.Forms.Example.Android
│ │ ├── Assets
│ │ │ └── AboutAssets.txt
│ │ ├── MainActivity.cs
│ │ ├── Properties
│ │ │ ├── AndroidManifest.xml
│ │ │ └── AssemblyInfo.cs
│ │ ├── Resources
│ │ │ ├── AboutResources.txt
│ │ │ ├── Resource.designer.cs
│ │ │ ├── layout
│ │ │ │ ├── Tabbar.axml
│ │ │ │ └── Toolbar.axml
│ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ └── Xam.Forms.Example.Android.csproj
│ ├── Xam.Forms.Example.iOS
│ │ ├── AppDelegate.cs
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── Main.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Resources
│ │ │ └── LaunchScreen.storyboard
│ │ └── Xam.Forms.Example.iOS.csproj
│ └── Xam.Forms.Example
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ └── Xam.Forms.Example.csproj
├── Xam.Forms.GraceAlert.sln
└── Xam.Forms.GraceAlert
│ ├── Extensions.cs
│ ├── GraceAlertView.xaml
│ ├── GraceAlertView.xaml.cs
│ ├── GraceRequest.cs
│ ├── NotificationType.cs
│ └── Xam.Forms.GraceAlert.csproj
├── azure-pipelines.yml
├── droid.gif
└── ios.gif
/.github/workflows/create_prerelease.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: CI
4 |
5 | # Controls when the action will run. Triggers the workflow on push or pull request
6 | # events but only for the master branch
7 | on:
8 | push:
9 | branches: [ develop ]
10 |
11 | env:
12 | next_mode: preminor
13 |
14 |
15 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
16 | jobs:
17 | # This workflow contains a single job called "build"
18 | create_prerelease:
19 | # The type of runner that the job will run on
20 | runs-on: ubuntu-latest
21 |
22 | # Steps represent a sequence of tasks that will be executed as part of the job
23 | steps:
24 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
25 | - uses: actions/checkout@v2
26 |
27 | - id: compute_tag
28 | uses: markjackmilian/compute-tag@master
29 | with:
30 | github_token: ${{ github.token }}
31 | #version_type: preminor
32 |
33 |
34 | - name: SetPrerelease or PreMinor
35 | run: |
36 | if [[ ${{ steps.compute_tag.outputs.previous_tag }} == *"beta"* ]]; then
37 | echo set to prerelease
38 | echo ::set-env name=next_mode::prerelease
39 | fi
40 |
41 | - name: Show Var
42 | run: echo ${{ env.next_mode }}
43 |
44 | - id: compute_tag2
45 | uses: markjackmilian/compute-tag@master
46 | with:
47 | github_token: ${{ github.token }}
48 | version_type: ${{ env.next_mode }}
49 |
50 | - name: create release
51 | uses: actions/create-release@v1
52 | with:
53 | tag_name: ${{ steps.compute_tag2.outputs.next_tag }}
54 | release_name: ${{ steps.compute_tag2.outputs.next_tag }}
55 | prerelease: true
56 | env:
57 | GITHUB_TOKEN: ${{ secrets.PAT }}
58 |
--------------------------------------------------------------------------------
/.github/workflows/create_release.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: CI
4 |
5 | # Controls when the action will run. Triggers the workflow on push or pull request
6 | # events but only for the master branch
7 | on:
8 | push:
9 | branches: [ master ]
10 |
11 |
12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
13 | jobs:
14 | # This workflow contains a single job called "build"
15 | create_prerelease:
16 | # The type of runner that the job will run on
17 | runs-on: ubuntu-latest
18 |
19 | # Steps represent a sequence of tasks that will be executed as part of the job
20 | steps:
21 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22 | - uses: actions/checkout@v2
23 |
24 | - id: compute_tag
25 | uses: markjackmilian/compute-tag@master
26 | with:
27 | github_token: ${{ github.token }}
28 | version_type: patch
29 |
30 | - name: create release
31 | uses: actions/create-release@v1
32 | with:
33 | tag_name: ${{ steps.compute_tag.outputs.next_tag }}
34 | release_name: ${{ steps.compute_tag.outputs.next_tag }}
35 | prerelease: false
36 | env:
37 | GITHUB_TOKEN: ${{ secrets.PAT }}
38 |
--------------------------------------------------------------------------------
/.github/workflows/dotnetcore.yml:
--------------------------------------------------------------------------------
1 | name: .NET Core
2 |
3 | on:
4 | release:
5 | types: [created]
6 |
7 | jobs:
8 | build:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/checkout@v2
14 | - name: Setup .NET Core
15 | uses: actions/setup-dotnet@v1
16 | with:
17 | dotnet-version: 3.1.101
18 |
19 | - name: Install dependencies
20 | run: dotnet restore Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert.csproj
21 |
22 | - name: Build and Pack
23 | run: dotnet pack Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert.csproj --configuration Release --no-restore /p:Version=${GITHUB_REF##*/}
24 |
25 | - name: Upload artifact
26 | uses: actions/upload-artifact@v1.0.0
27 | with:
28 | # Artifact name
29 | name: xam.forms.gracealert
30 | # Directory containing files to upload
31 | path: Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/bin/Release
32 |
33 | - name: Push to nuget
34 | run: dotnet nuget push Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/bin/Release/Xam.Forms.GraceAlert.${GITHUB_REF##*/}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
35 |
36 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 |
33 | # Visual Studio 2015/2017 cache/options directory
34 | .vs/
35 | # Uncomment if you have tasks that create the project's static files in wwwroot
36 | #wwwroot/
37 |
38 | # Visual Studio 2017 auto generated files
39 | Generated\ Files/
40 |
41 | # MSTest test Results
42 | [Tt]est[Rr]esult*/
43 | [Bb]uild[Ll]og.*
44 |
45 | # NUnit
46 | *.VisualState.xml
47 | TestResult.xml
48 | nunit-*.xml
49 |
50 | # Build Results of an ATL Project
51 | [Dd]ebugPS/
52 | [Rr]eleasePS/
53 | dlldata.c
54 |
55 | # Benchmark Results
56 | BenchmarkDotNet.Artifacts/
57 |
58 | # .NET Core
59 | project.lock.json
60 | project.fragment.lock.json
61 | artifacts/
62 |
63 | # StyleCop
64 | StyleCopReport.xml
65 |
66 | # Files built by Visual Studio
67 | *_i.c
68 | *_p.c
69 | *_h.h
70 | *.ilk
71 | *.meta
72 | *.obj
73 | *.iobj
74 | *.pch
75 | *.pdb
76 | *.ipdb
77 | *.pgc
78 | *.pgd
79 | *.rsp
80 | *.sbr
81 | *.tlb
82 | *.tli
83 | *.tlh
84 | *.tmp
85 | *.tmp_proj
86 | *_wpftmp.csproj
87 | *.log
88 | *.vspscc
89 | *.vssscc
90 | .builds
91 | *.pidb
92 | *.svclog
93 | *.scc
94 |
95 | # Chutzpah Test files
96 | _Chutzpah*
97 |
98 | # Visual C++ cache files
99 | ipch/
100 | *.aps
101 | *.ncb
102 | *.opendb
103 | *.opensdf
104 | *.sdf
105 | *.cachefile
106 | *.VC.db
107 | *.VC.VC.opendb
108 |
109 | # Visual Studio profiler
110 | *.psess
111 | *.vsp
112 | *.vspx
113 | *.sap
114 |
115 | # Visual Studio Trace Files
116 | *.e2e
117 |
118 | # TFS 2012 Local Workspace
119 | $tf/
120 |
121 | # Guidance Automation Toolkit
122 | *.gpState
123 |
124 | # ReSharper is a .NET coding add-in
125 | _ReSharper*/
126 | *.[Rr]e[Ss]harper
127 | *.DotSettings.user
128 |
129 | # JustCode is a .NET coding add-in
130 | .JustCode
131 |
132 | # TeamCity is a build add-in
133 | _TeamCity*
134 |
135 | # DotCover is a Code Coverage Tool
136 | *.dotCover
137 |
138 | # AxoCover is a Code Coverage Tool
139 | .axoCover/*
140 | !.axoCover/settings.json
141 |
142 | # Visual Studio code coverage results
143 | *.coverage
144 | *.coveragexml
145 |
146 | # NCrunch
147 | _NCrunch_*
148 | .*crunch*.local.xml
149 | nCrunchTemp_*
150 |
151 | # MightyMoose
152 | *.mm.*
153 | AutoTest.Net/
154 |
155 | # Web workbench (sass)
156 | .sass-cache/
157 |
158 | # Installshield output folder
159 | [Ee]xpress/
160 |
161 | # DocProject is a documentation generator add-in
162 | DocProject/buildhelp/
163 | DocProject/Help/*.HxT
164 | DocProject/Help/*.HxC
165 | DocProject/Help/*.hhc
166 | DocProject/Help/*.hhk
167 | DocProject/Help/*.hhp
168 | DocProject/Help/Html2
169 | DocProject/Help/html
170 |
171 | # Click-Once directory
172 | publish/
173 |
174 | # Publish Web Output
175 | *.[Pp]ublish.xml
176 | *.azurePubxml
177 | # Note: Comment the next line if you want to checkin your web deploy settings,
178 | # but database connection strings (with potential passwords) will be unencrypted
179 | *.pubxml
180 | *.publishproj
181 |
182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
183 | # checkin your Azure Web App publish settings, but sensitive information contained
184 | # in these scripts will be unencrypted
185 | PublishScripts/
186 |
187 | # NuGet Packages
188 | *.nupkg
189 | # NuGet Symbol Packages
190 | *.snupkg
191 | # The packages folder can be ignored because of Package Restore
192 | **/[Pp]ackages/*
193 | # except build/, which is used as an MSBuild target.
194 | !**/[Pp]ackages/build/
195 | # Uncomment if necessary however generally it will be regenerated when needed
196 | #!**/[Pp]ackages/repositories.config
197 | # NuGet v3's project.json files produces more ignorable files
198 | *.nuget.props
199 | *.nuget.targets
200 |
201 | # Microsoft Azure Build Output
202 | csx/
203 | *.build.csdef
204 |
205 | # Microsoft Azure Emulator
206 | ecf/
207 | rcf/
208 |
209 | # Windows Store app package directories and files
210 | AppPackages/
211 | BundleArtifacts/
212 | Package.StoreAssociation.xml
213 | _pkginfo.txt
214 | *.appx
215 | *.appxbundle
216 | *.appxupload
217 |
218 | # Visual Studio cache files
219 | # files ending in .cache can be ignored
220 | *.[Cc]ache
221 | # but keep track of directories ending in .cache
222 | !?*.[Cc]ache/
223 |
224 | # Others
225 | ClientBin/
226 | ~$*
227 | *~
228 | *.dbmdl
229 | *.dbproj.schemaview
230 | *.jfm
231 | *.pfx
232 | *.publishsettings
233 | orleans.codegen.cs
234 |
235 | # Including strong name files can present a security risk
236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
237 | #*.snk
238 |
239 | # Since there are multiple workflows, uncomment next line to ignore bower_components
240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
241 | #bower_components/
242 |
243 | # RIA/Silverlight projects
244 | Generated_Code/
245 |
246 | # Backup & report files from converting an old project file
247 | # to a newer Visual Studio version. Backup files are not needed,
248 | # because we have git ;-)
249 | _UpgradeReport_Files/
250 | Backup*/
251 | UpgradeLog*.XML
252 | UpgradeLog*.htm
253 | ServiceFabricBackup/
254 | *.rptproj.bak
255 |
256 | # SQL Server files
257 | *.mdf
258 | *.ldf
259 | *.ndf
260 |
261 | # Business Intelligence projects
262 | *.rdl.data
263 | *.bim.layout
264 | *.bim_*.settings
265 | *.rptproj.rsuser
266 | *- [Bb]ackup.rdl
267 | *- [Bb]ackup ([0-9]).rdl
268 | *- [Bb]ackup ([0-9][0-9]).rdl
269 |
270 | # Microsoft Fakes
271 | FakesAssemblies/
272 |
273 | # GhostDoc plugin setting file
274 | *.GhostDoc.xml
275 |
276 | # Node.js Tools for Visual Studio
277 | .ntvs_analysis.dat
278 | node_modules/
279 |
280 | # Visual Studio 6 build log
281 | *.plg
282 |
283 | # Visual Studio 6 workspace options file
284 | *.opt
285 |
286 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
287 | *.vbw
288 |
289 | # Visual Studio LightSwitch build output
290 | **/*.HTMLClient/GeneratedArtifacts
291 | **/*.DesktopClient/GeneratedArtifacts
292 | **/*.DesktopClient/ModelManifest.xml
293 | **/*.Server/GeneratedArtifacts
294 | **/*.Server/ModelManifest.xml
295 | _Pvt_Extensions
296 |
297 | # Paket dependency manager
298 | .paket/paket.exe
299 | paket-files/
300 |
301 | # FAKE - F# Make
302 | .fake/
303 |
304 | # CodeRush personal settings
305 | .cr/personal
306 |
307 | # Python Tools for Visual Studio (PTVS)
308 | __pycache__/
309 | *.pyc
310 |
311 | # Cake - Uncomment if you are using it
312 | # tools/**
313 | # !tools/packages.config
314 |
315 | # Tabs Studio
316 | *.tss
317 |
318 | # Telerik's JustMock configuration file
319 | *.jmconfig
320 |
321 | # BizTalk build output
322 | *.btp.cs
323 | *.btm.cs
324 | *.odx.cs
325 | *.xsd.cs
326 |
327 | # OpenCover UI analysis results
328 | OpenCover/
329 |
330 | # Azure Stream Analytics local run output
331 | ASALocalRun/
332 |
333 | # MSBuild Binary and Structured Log
334 | *.binlog
335 |
336 | # NVidia Nsight GPU debugger configuration file
337 | *.nvuser
338 |
339 | # MFractors (Xamarin productivity tool) working folder
340 | .mfractor/
341 |
342 | # Local History for Visual Studio
343 | .localhistory/
344 |
345 | # BeatPulse healthcheck temp database
346 | healthchecksdb
347 |
348 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
349 | MigrationBackup/
350 |
351 | Xam.Forms.GraceAlert/.idea/.idea.Xam.Forms.GraceAlert/.idea/
352 |
353 | .idea/
354 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 |
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2020 Marco
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Welcome to Xam.Forms.GraceAlert
4 |
5 | 
6 | 
7 |
8 | Hi! I'm [Mark Jack Milian](http://markjackmilian.net/) and i'm here to aswer a few questions
9 |
10 |
11 | ## Packages ##
12 |
13 |
14 |
15 | Platform/Feature | Package name | Stable | Status
16 | -----------------------|-------------------------------------------|-----------------------------|------------------------
17 | Core | `Xam.Forms.GraceAlert` | [](https://www.nuget.org/packages/Xam.Forms.GraceAlert) | [](https://dev.azure.com/nightlybuilds-net/Xam.GraceAlert/_build/latest?definitionId=18&branchName=master)|
18 |
19 | All packages are compliant with [Semantic Versioning](https://semver.org/)
20 |
21 |
22 | ## What is Xam.Forms.GraceAlert?
23 |
24 | Is a Xamarin Forms View to show non invasive notification for alert, warning and info.
25 |
26 |
27 | ## How does it works?
28 |
29 | ### Page Structure
30 | Please add a reference of our nuget to your Cross-Platform Xamarin.Forms project.
31 |
32 | Add a GraceAlertView as **first** element of your page and add you "normal" inside GraceAlertView.BodyContent
33 | ```xaml
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | ```
42 | ### Show a notification
43 | To show a notification use the extension method on Page. *Never call the directly methods on GraceAlertView.*
44 | ```xaml
45 | Error(this Page page, string title, string text, bool block = false):Task
46 | Warning(this Page page, string title, string text, bool block = false):Task
47 | Info(this Page page, string title, string text, bool block = false):Task
48 | ```
49 |
50 | If block is true the notification will remain on the screen until you touch it.
51 |
52 | ### Customize notification
53 | Many properties are customizable using implicit style.
54 |
55 | ```xaml
56 |
57 |
58 |
61 |
62 |
63 | ```
64 |
65 |
66 | ## Samples
67 |
68 | - Xamarin.Forms.Example in this repo;
69 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Nuspecs/Xam.Forms.GraceAlert.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Xam.Forms.GraceAlert
5 | 0.2.0
6 | Xam GraceAlert
7 | Marco Milani
8 | Marco Milani
9 | false
10 | https://github.com/markjackmilian/Xam.Forms.GraceAlert
11 | Simple and beautiful notification hub for Xamarin Forms.
12 |
13 | xamarin, gracealert, grace alert,notification, xamarin forms
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.App;
3 | using Android.Content.PM;
4 | using Android.Runtime;
5 | using Android.Views;
6 | using Android.Widget;
7 | using Android.OS;
8 |
9 | namespace Xam.Forms.Example.Android
10 | {
11 | [Activity(Label = "Xam.Forms.Example", Theme = "@style/MainTheme", MainLauncher = true,
12 | ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14 | {
15 | protected override void OnCreate(Bundle savedInstanceState)
16 | {
17 | TabLayoutResource = Resource.Layout.Tabbar;
18 | ToolbarResource = Resource.Layout.Toolbar;
19 |
20 | base.OnCreate(savedInstanceState);
21 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
22 | LoadApplication(new App());
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("Xam.Forms.Example.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("CompanyName")]
13 | [assembly: AssemblyProduct("Xam.Forms.Example.Android")]
14 | [assembly: AssemblyCopyright("Copyright © CompanyName Year")]
15 | [assembly: AssemblyTrademark("CompanyTrademark")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
8 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
26 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.Android/Xam.Forms.Example.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {F6F3CCEB-236C-4CAA-A514-2095336D9788}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Library
9 | Xam.Forms.Example.Android
10 | Xam.Forms.Example.Android
11 | True
12 | Resources\Resource.designer.cs
13 | Resource
14 | Properties\AndroidManifest.xml
15 | Resources
16 | Assets
17 | v9.0
18 | Xamarin.Android.Net.AndroidClientHandler
19 |
20 |
21 | true
22 | portable
23 | false
24 | bin\Debug
25 | DEBUG;
26 | prompt
27 | 4
28 | None
29 |
30 |
31 | true
32 | pdbonly
33 | true
34 | bin\Release
35 | prompt
36 | 4
37 | true
38 | false
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | {F5F26180-0866-434B-AC7A-039AB8104167}
75 | Xam.Forms.Example
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Foundation;
5 | using UIKit;
6 |
7 | namespace Xam.Forms.Example.iOS
8 | {
9 | // The UIApplicationDelegate for the application. This class is responsible for launching the
10 | // User Interface of the application, as well as listening (and optionally responding) to
11 | // application events from iOS.
12 | [Register("AppDelegate")]
13 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
14 | {
15 | //
16 | // This method is invoked when the application has loaded and is ready to run. In this
17 | // method you should instantiate the window, load the UI into it and then make the window
18 | // visible.
19 | //
20 | // You have 17 seconds to return from this method, or iOS will terminate your application.
21 | //
22 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
23 | {
24 | global::Xamarin.Forms.Forms.Init();
25 | LoadApplication(new App());
26 |
27 | return base.FinishedLaunching(app, options);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 12.1
25 | CFBundleDisplayName
26 | Xam.Forms.Example
27 | CFBundleIdentifier
28 | net.markjackmilian.GraceAlert
29 | CFBundleVersion
30 | 1.0
31 | UILaunchStoryboardName
32 | LaunchScreen
33 | CFBundleName
34 | Xam.Forms.Example
35 | XSAppIconAssets
36 | Assets.xcassets/AppIcon.appiconset
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Foundation;
5 | using UIKit;
6 |
7 | namespace Xam.Forms.Example.iOS
8 | {
9 | public class Application
10 | {
11 | // This is the main entry point of the application.
12 | static void Main(string[] args)
13 | {
14 | // if you want to use a different Application Delegate class from "AppDelegate"
15 | // you can specify it here.
16 | UIApplication.Main(args, null, "AppDelegate");
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Xam.Forms.Example.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("CompanyName")]
12 | [assembly: AssemblyProduct("Xam.Forms.Example.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © CompanyName Year")]
14 | [assembly: AssemblyTrademark("CompanyTrademark")]
15 | [assembly: AssemblyCulture("")]
16 | [assembly: ComVisible(false)]
17 |
18 | // Version information for an assembly consists of the following four values:
19 | //
20 | // Major Version
21 | // Minor Version
22 | // Build Number
23 | // Revision
24 | //
25 | // You can specify all the values or you can default the Build and Revision Numbers
26 | // by using the '*' as shown below:
27 | // [assembly: AssemblyVersion("1.0.*")]
28 | [assembly: AssemblyVersion("1.0.0.0")]
29 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example.iOS/Xam.Forms.Example.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {1B2686B9-69B2-48CC-ADB6-29D187A4BE4B}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | Exe
11 | Xam.Forms.Example.iOS
12 | Resources
13 | Xam.Forms.Example.iOS
14 | NSUrlSessionHandler
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\iPhoneSimulator\Debug
21 | DEBUG
22 | prompt
23 | 4
24 | false
25 | x86_64
26 | None
27 | true
28 | VS: WildCard Development
29 | iPhone Developer: Marco Milani (7UUD36ZQVG)
30 |
31 |
32 | none
33 | true
34 | bin\iPhoneSimulator\Release
35 | prompt
36 | 4
37 | None
38 | x86_64
39 | false
40 | VS: WildCard Development
41 | iPhone Developer: Marco Milani (7UUD36ZQVG)
42 |
43 |
44 | true
45 | full
46 | false
47 | bin\iPhone\Debug
48 | DEBUG
49 | prompt
50 | 4
51 | false
52 | ARM64
53 | iPhone Developer: Marco Milani (7UUD36ZQVG)
54 | true
55 | Entitlements.plist
56 | VS: WildCard Development
57 |
58 |
59 | none
60 | true
61 | bin\iPhone\Release
62 | prompt
63 | 4
64 | ARM64
65 | false
66 | iPhone Developer: Marco Milani (7UUD36ZQVG)
67 | Entitlements.plist
68 | VS: WildCard Development
69 |
70 |
71 | none
72 | True
73 | bin\iPhone\Ad-Hoc
74 | prompt
75 | 4
76 | False
77 | ARM64
78 | True
79 | VS: WildCard Development
80 | iPhone Developer: Marco Milani (7UUD36ZQVG)
81 | Entitlements.plist
82 |
83 |
84 | none
85 | True
86 | bin\iPhone\AppStore
87 | prompt
88 | 4
89 | False
90 | ARM64
91 | VS: WildCard Development
92 | iPhone Developer: Marco Milani (7UUD36ZQVG)
93 | Entitlements.plist
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | false
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 | {b60d9d3d-3346-4b58-b2b8-20a34e0c2112}
122 | Xam.Forms.GraceAlert
123 |
124 |
125 | {F5F26180-0866-434B-AC7A-039AB8104167}
126 | Xam.Forms.Example
127 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 |
5 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
6 |
7 | namespace Xam.Forms.Example
8 | {
9 | public partial class App : Application
10 | {
11 | public App()
12 | {
13 | InitializeComponent();
14 |
15 | #if DEBUG
16 | HotReloader.Current.Run(this);
17 | #endif
18 | MainPage = new MainPage();
19 |
20 | }
21 |
22 | protected override void OnStart()
23 | {
24 | // Handle when your app starts
25 | }
26 |
27 | protected override void OnSleep()
28 | {
29 | // Handle when your app sleeps
30 | }
31 |
32 | protected override void OnResume()
33 | {
34 | // Handle when your app resumes
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Xam.Forms.GraceAlert;
7 | using Xamarin.Forms;
8 |
9 | namespace Xam.Forms.Example
10 | {
11 | public partial class MainPage : ContentPage
12 | {
13 | public MainPage()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private async void Block_Error_OnClicked(object sender, EventArgs e)
19 | {
20 | await this.Error("Error","Not very well and.. blocked", true);
21 | }
22 |
23 | private async void Error_OnClicked(object sender, EventArgs e)
24 | {
25 | await this.Error("Error","Not very well.");
26 | }
27 |
28 | private async void Warning_OnClicked(object sender, EventArgs e)
29 | {
30 | await this.Warning("Warning","You could do better");
31 | }
32 |
33 | private async void Info_OnClicked(object sender, EventArgs e)
34 | {
35 | await this.Info("Info","Don't say I didn't tell you");
36 | }
37 |
38 | private async void Success_OnClicked(object sender, EventArgs e)
39 | {
40 | await this.Success("Success","You did it!");
41 | }
42 |
43 | }
44 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.Example/Xam.Forms.Example/Xam.Forms.Example.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 | pdbonly
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xam.Forms.GraceAlert", "Xam.Forms.GraceAlert\Xam.Forms.GraceAlert.csproj", "{B60D9D3D-3346-4B58-B2B8-20A34E0C2112}"
4 | EndProject
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xam.Forms.Example", "Xam.Forms.Example\Xam.Forms.Example\Xam.Forms.Example.csproj", "{F5F26180-0866-434B-AC7A-039AB8104167}"
6 | EndProject
7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xam.Forms.Example.Android", "Xam.Forms.Example\Xam.Forms.Example.Android\Xam.Forms.Example.Android.csproj", "{F6F3CCEB-236C-4CAA-A514-2095336D9788}"
8 | EndProject
9 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xam.Forms.Example.iOS", "Xam.Forms.Example\Xam.Forms.Example.iOS\Xam.Forms.Example.iOS.csproj", "{1B2686B9-69B2-48CC-ADB6-29D187A4BE4B}"
10 | EndProject
11 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example", "Example", "{00AF9E5B-C7F3-403A-AFD1-EEB1EA2ADB89}"
12 | EndProject
13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuspec", "Nuspec", "{D2313D83-C64A-46C2-9CDD-E00A0FAAC975}"
14 | ProjectSection(SolutionItems) = preProject
15 | Nuspecs\Xam.Forms.GraceAlert.nuspec = Nuspecs\Xam.Forms.GraceAlert.nuspec
16 | EndProjectSection
17 | EndProject
18 | Global
19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 | Debug|Any CPU = Debug|Any CPU
21 | Release|Any CPU = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {B60D9D3D-3346-4B58-B2B8-20A34E0C2112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {B60D9D3D-3346-4B58-B2B8-20A34E0C2112}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {B60D9D3D-3346-4B58-B2B8-20A34E0C2112}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {B60D9D3D-3346-4B58-B2B8-20A34E0C2112}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {F5F26180-0866-434B-AC7A-039AB8104167}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {F5F26180-0866-434B-AC7A-039AB8104167}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {F5F26180-0866-434B-AC7A-039AB8104167}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {F5F26180-0866-434B-AC7A-039AB8104167}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {F6F3CCEB-236C-4CAA-A514-2095336D9788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {F6F3CCEB-236C-4CAA-A514-2095336D9788}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {F6F3CCEB-236C-4CAA-A514-2095336D9788}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {F6F3CCEB-236C-4CAA-A514-2095336D9788}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {1B2686B9-69B2-48CC-ADB6-29D187A4BE4B}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
37 | {1B2686B9-69B2-48CC-ADB6-29D187A4BE4B}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
38 | {1B2686B9-69B2-48CC-ADB6-29D187A4BE4B}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
39 | {1B2686B9-69B2-48CC-ADB6-29D187A4BE4B}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
40 | EndGlobalSection
41 | GlobalSection(NestedProjects) = preSolution
42 | {F5F26180-0866-434B-AC7A-039AB8104167} = {00AF9E5B-C7F3-403A-AFD1-EEB1EA2ADB89}
43 | {F6F3CCEB-236C-4CAA-A514-2095336D9788} = {00AF9E5B-C7F3-403A-AFD1-EEB1EA2ADB89}
44 | {1B2686B9-69B2-48CC-ADB6-29D187A4BE4B} = {00AF9E5B-C7F3-403A-AFD1-EEB1EA2ADB89}
45 | EndGlobalSection
46 | EndGlobal
47 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/Extensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Linq;
3 | using System.Runtime.CompilerServices;
4 | using System.Threading.Tasks;
5 | using Xamarin.Forms;
6 | using Xamarin.Forms.PlatformConfiguration;
7 |
8 | namespace Xam.Forms.GraceAlert
9 | {
10 | public static class Extensions
11 | {
12 | ///
13 | /// true if page is in potrait
14 | ///
15 | ///
16 | ///
17 | public static bool IsPotrait(this Page page)
18 | {
19 | return page.Height > page.Width;
20 | }
21 |
22 | ///
23 | /// Return the first instance of GraceAlrtView found on this page
24 | ///
25 | ///
26 | ///
27 | public static GraceAlertView GraceAlert(this Page page)
28 | {
29 | var view = page.LogicalChildren.OfType().FirstOrDefault();
30 | if (view == null)
31 | {
32 | Debug.WriteLine("GraceAlertView not found on page");
33 | return null;
34 | }
35 |
36 | // add pixel for not safe area on ios
37 | AdjustForIos(view, page);
38 | return view;
39 | }
40 |
41 | ///
42 | /// Hide grace alert
43 | ///
44 | public static void HideGrace(this Page page)
45 | {
46 | var graceAlert = page.GraceAlert();
47 | graceAlert.Hide();
48 | }
49 |
50 | ///
51 | /// Show error using graceview on this page
52 | ///
53 | ///
54 | ///
55 | ///
56 | ///
57 | ///
58 | public static async Task Error(this Page page, string title, string text, bool block = false)
59 | {
60 | var graceAlert = page.GraceAlert();
61 | if (graceAlert == null)
62 | {
63 | Debug.WriteLine("GraceAlert not found on page");
64 | return;
65 | }
66 |
67 | await graceAlert.Show(NotificationType.Error, title, text, block);
68 | }
69 |
70 | ///
71 | /// Show warning using graceview on this page
72 | ///
73 | ///
74 | ///
75 | ///
76 | ///
77 | public static async Task Warning(this Page page, string title, string text, bool block = false)
78 | {
79 | var graceAlert = page.GraceAlert();
80 | if (graceAlert == null)
81 | {
82 | Debug.WriteLine("GraceAlert not found on page");
83 | return;
84 | }
85 |
86 | await graceAlert.Show(NotificationType.Warning, title, text,block);
87 | }
88 |
89 | ///
90 | /// Show Info using graceview on this page
91 | ///
92 | ///
93 | ///
94 | ///
95 | ///
96 | public static async Task Info(this Page page, string title, string text, bool block = false)
97 | {
98 | var graceAlert = page.GraceAlert();
99 | if (graceAlert == null)
100 | {
101 | Debug.WriteLine("GraceAlert not found on page");
102 | return;
103 | }
104 |
105 | await graceAlert.Show(NotificationType.Info, title, text,block);
106 | }
107 |
108 | ///
109 | /// Show Info using graceview on this page
110 | ///
111 | ///
112 | ///
113 | ///
114 | ///
115 | public static async Task Success(this Page page, string title, string text, bool block = false)
116 | {
117 | var graceAlert = page.GraceAlert();
118 | if (graceAlert == null)
119 | {
120 | Debug.WriteLine("GraceAlert not found on page");
121 | return;
122 | }
123 |
124 | await graceAlert.Show(NotificationType.Success, title, text,block);
125 | }
126 |
127 | ///
128 | /// Adjust insets for ios
129 | ///
130 | ///
131 | ///
132 | private static void AdjustForIos(GraceAlertView graceView, Page page)
133 | {
134 | if (Device.RuntimePlatform != Device.iOS) return;
135 |
136 | graceView.IsPotrait = page.IsPotrait();
137 | graceView.PageUseSafeArea =
138 | Xamarin.Forms.PlatformConfiguration.iOSSpecific.Page.UsingSafeArea(page.On());
139 | }
140 | }
141 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/GraceAlertView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
29 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/GraceAlertView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Xamarin.Forms;
6 | using Xamarin.Forms.PlatformConfiguration;
7 |
8 | namespace Xam.Forms.GraceAlert
9 | {
10 | public partial class GraceAlertView : Grid
11 | {
12 | private TaskCompletionSource _dismissTask;
13 | private int _defaultTranslation = -44;
14 |
15 | private bool _isShowing;
16 | private readonly ConcurrentQueue _requests = new ConcurrentQueue();
17 |
18 | private static readonly Color DefaultWarningColor = Color.FromHex("F6CF46");
19 | private static readonly Color DefaultErrorColor = Color.FromHex("E5465C");
20 | private static readonly Color DefaultInfoColor = Color.LightGray;
21 | private static readonly Color DefaultSuccesColor = Color.FromHex("34755B");
22 |
23 | private static readonly Color DarkTextColor = Color.FromHex("323232");
24 | private static readonly Color LightTextColor = Color.WhiteSmoke;
25 |
26 |
27 | public GraceAlertView()
28 | {
29 | this.InitializeComponent();
30 | }
31 |
32 | public static readonly BindableProperty BodyContentProperty = BindableProperty.Create(nameof(BodyContent),
33 | typeof(ContentView), typeof(GraceAlertView), coerceValue: BodyContentCoerceValue);
34 |
35 | public static readonly BindableProperty DismissTimeProperty = BindableProperty.Create(nameof(DismissTime),
36 | typeof(int), typeof(GraceAlertView),2500);
37 |
38 | public static readonly BindableProperty ErrorColorProperty = BindableProperty.Create(nameof(ErrorColor),
39 | typeof(Color), typeof(GraceAlertView),DefaultErrorColor);
40 |
41 | public static readonly BindableProperty WarningColorProperty = BindableProperty.Create(nameof(WarningColor),
42 | typeof(Color), typeof(GraceAlertView),DefaultWarningColor);
43 |
44 | public static readonly BindableProperty InfoColorProperty = BindableProperty.Create(nameof(InfoColor),
45 | typeof(Color), typeof(GraceAlertView),DefaultInfoColor);
46 |
47 | public static readonly BindableProperty InverseColorProperty = BindableProperty.Create(nameof(InverseColor),
48 | typeof(Color), typeof(GraceAlertView),LightTextColor);
49 |
50 | public static readonly BindableProperty SuccessColorProperty = BindableProperty.Create(nameof(SuccessColor),
51 | typeof(Color), typeof(GraceAlertView),DefaultSuccesColor);
52 |
53 | public static readonly BindableProperty UseLightColorForErrorProperty = BindableProperty.Create(nameof(UseLightColorForError),
54 | typeof(bool), typeof(GraceAlertView),true);
55 |
56 | public static readonly BindableProperty UseLightColorForWarningProperty = BindableProperty.Create(nameof(UseLightColorForWarning),
57 | typeof(bool), typeof(GraceAlertView),false);
58 |
59 | public static readonly BindableProperty UseLightColorForInfoProperty = BindableProperty.Create(nameof(UseLightColorForInfo),
60 | typeof(bool), typeof(GraceAlertView),false);
61 |
62 | public static readonly BindableProperty UseLightColorForSuccessProperty = BindableProperty.Create(nameof(UseLightColorForSuccess),
63 | typeof(bool), typeof(GraceAlertView),true);
64 |
65 |
66 | public ContentView BodyContent
67 | {
68 | get => (ContentView) this.GetValue(BodyContentProperty);
69 | set => this.SetValue(BodyContentProperty, value);
70 | }
71 |
72 | public int DismissTime
73 | {
74 | get => (int) this.GetValue(DismissTimeProperty);
75 | set => this.SetValue(DismissTimeProperty, value);
76 | }
77 |
78 | public Color ErrorColor
79 | {
80 | get => (Color) this.GetValue(ErrorColorProperty);
81 | set => this.SetValue(ErrorColorProperty, value);
82 | }
83 |
84 | public Color WarningColor
85 | {
86 | get => (Color) this.GetValue(WarningColorProperty);
87 | set => this.SetValue(WarningColorProperty, value);
88 | }
89 |
90 | public Color InfoColor
91 | {
92 | get => (Color) this.GetValue(InfoColorProperty);
93 | set => this.SetValue(InfoColorProperty, value);
94 | }
95 | public Color SuccessColor
96 | {
97 | get => (Color) this.GetValue(SuccessColorProperty);
98 | set => this.SetValue(SuccessColorProperty, value);
99 | }
100 |
101 | public Color InverseColor
102 | {
103 | get => (Color) this.GetValue(InverseColorProperty);
104 | set => this.SetValue(InverseColorProperty, value);
105 | }
106 |
107 | public bool UseLightColorForError
108 | {
109 | get => (bool) this.GetValue(UseLightColorForErrorProperty);
110 | set => this.SetValue(UseLightColorForErrorProperty, value);
111 | }
112 |
113 | public bool UseLightColorForWarning
114 | {
115 | get => (bool) this.GetValue(UseLightColorForWarningProperty);
116 | set => this.SetValue(UseLightColorForWarningProperty, value);
117 | }
118 |
119 | public bool UseLightColorForInfo
120 | {
121 | get => (bool) this.GetValue(UseLightColorForInfoProperty);
122 | set => this.SetValue(UseLightColorForInfoProperty, value);
123 | }
124 |
125 | public bool UseLightColorForSuccess
126 | {
127 | get => (bool) this.GetValue(UseLightColorForSuccessProperty);
128 | set => this.SetValue(UseLightColorForSuccessProperty, value);
129 | }
130 |
131 | ///
132 | /// This property is setted by extension method GraceAlert()
133 | ///
134 | public bool PageUseSafeArea { get; set; }
135 |
136 | ///
137 | /// True iif the page is in potrait mode
138 | ///
139 | public bool IsPotrait { get; set; }
140 |
141 | private static object BodyContentCoerceValue(BindableObject bindableObject, object value)
142 | {
143 | if (bindableObject != null && value is ContentView view)
144 | {
145 | var instance = (GraceAlertView) bindableObject;
146 | instance.Body.Content = view;
147 | }
148 |
149 | return value;
150 | }
151 |
152 |
153 | #region METHODS
154 |
155 | public void Hide()
156 | {
157 | this.Notification.IsVisible = false;
158 | }
159 |
160 | public async Task Show(NotificationType type, string title, string message, bool block = false)
161 | {
162 | var request = new GraceRequest(type,title,message, block);
163 | this._requests.Enqueue(request);
164 |
165 | await this.InnerShow();
166 | }
167 |
168 | private async Task InnerShow()
169 | {
170 | // notificatioin is showing skip
171 | if (this._isShowing)
172 | return;
173 |
174 | // no request in queue skip
175 | if (!this._requests.Any()) return;
176 |
177 | // notification is showing
178 | this._isShowing = true;
179 |
180 | this._dismissTask = null;
181 |
182 | var requestFound = this._requests.TryDequeue(out var request);
183 | if (!requestFound) return;
184 |
185 | // manage translation
186 | var translation = _defaultTranslation;
187 | if (!this.PageUseSafeArea && this.IsPotrait)
188 | translation = 0;
189 |
190 | this.Title.TextColor = this.TypeToTextColor(request.Type);
191 | this.Message.TextColor = this.TypeToTextColor(request.Type);
192 |
193 | this.Notification.BackgroundColor = this.TypeToColor(request.Type);
194 | this.Title.Text = request.Title;
195 | this.Message.Text = request.Message;
196 |
197 | this.Notification.IsVisible = true;
198 | await this.Notification.TranslateTo(this.Notification.X, translation);
199 |
200 | // dismissmode
201 | if (request.Block)
202 | {
203 | this._dismissTask = new TaskCompletionSource();
204 | await this._dismissTask.Task;
205 | }
206 | else
207 | await Task.Delay(this.DismissTime);
208 |
209 | await this.Notification.TranslateTo(this.Notification.X, -this.Notification.Height + translation);
210 | this.Notification.IsVisible = false;
211 |
212 | this._isShowing = false;
213 | await this.InnerShow();
214 | }
215 |
216 | private Color TypeToColor(NotificationType type)
217 | {
218 | switch (type)
219 | {
220 | case NotificationType.Error:
221 | return this.ErrorColor;
222 | case NotificationType.Warning:
223 | return this.WarningColor;
224 | case NotificationType.Info:
225 | return this.InfoColor;
226 | case NotificationType.Success:
227 | return this.SuccessColor;
228 | default:
229 | throw new ArgumentOutOfRangeException(nameof(type), type, null);
230 | }
231 | }
232 |
233 | private Color TypeToTextColor(NotificationType type)
234 | {
235 | switch (type)
236 | {
237 | case NotificationType.Error:
238 | return this.UseLightColorForError ? LightTextColor : DarkTextColor;
239 | case NotificationType.Warning:
240 | return this.UseLightColorForWarning ? LightTextColor : DarkTextColor;
241 | case NotificationType.Info:
242 | return this.UseLightColorForInfo ? LightTextColor : DarkTextColor;
243 | case NotificationType.Success:
244 | return this.UseLightColorForSuccess ? LightTextColor : DarkTextColor;
245 | default:
246 | throw new ArgumentOutOfRangeException(nameof(type), type, null);
247 | }
248 | }
249 |
250 | #endregion
251 |
252 | private void TapGestureRecognizer_OnTapped(object sender, EventArgs e)
253 | {
254 | this._dismissTask?.SetResult(true);
255 | }
256 | }
257 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/GraceRequest.cs:
--------------------------------------------------------------------------------
1 | namespace Xam.Forms.GraceAlert
2 | {
3 | class GraceRequest
4 | {
5 | public GraceRequest(NotificationType type, string title, string message, bool block)
6 | {
7 | this.Type = type;
8 | this.Title = title;
9 | this.Message = message;
10 | this.Block = block;
11 | }
12 |
13 | public NotificationType Type { get; }
14 | public string Title { get; }
15 | public string Message { get; }
16 | public bool Block { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/NotificationType.cs:
--------------------------------------------------------------------------------
1 | namespace Xam.Forms.GraceAlert
2 | {
3 | public enum NotificationType
4 | {
5 | Error,
6 | Warning,
7 | Info,
8 | Success
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 | Xam.Forms.GraceAlert
7 | Marco Milani
8 | Grace Alert View for Xamarin Forms
9 | https://github.com/markjackmilian/Xam.Forms.GraceAlert
10 | https://github.com/markjackmilian/Xam.Forms.GraceAlert
11 | xamarin forms, notification, alert
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | # ASP.NET Core (.NET Framework)
2 | # Build and test ASP.NET Core projects targeting the full .NET Framework.
3 | # Add steps that publish symbols, save build artifacts, and more:
4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
5 |
6 | trigger:
7 | - master
8 |
9 | pool:
10 | vmImage: 'windows-latest'
11 |
12 | variables:
13 | graceProj: Xam.Forms.GraceAlert/Xam.Forms.GraceAlert/Xam.Forms.GraceAlert.csproj
14 | solution: '**/*.sln'
15 | buildPlatform: 'Any CPU'
16 | buildConfiguration: 'Release'
17 |
18 | steps:
19 | - task: NuGetToolInstaller@1
20 |
21 | - task: NuGetCommand@2
22 | inputs:
23 | restoreSolution: '$(solution)'
24 |
25 | - task: DotNetCoreCLI@2
26 | displayName: Build Grace
27 | inputs:
28 | command: 'build'
29 | projects: '$(graceProj)'
30 | arguments: '-c $(buildConfiguration)'
31 |
32 | - task: NuGetCommand@2
33 | inputs:
34 | command: 'pack'
35 | packagesToPack: 'Xam.Forms.GraceAlert/Nuspecs/Xam.Forms.GraceAlert.nuspec'
36 | versioningScheme: 'off'
37 |
38 |
39 | - task: PublishBuildArtifacts@1
40 | inputs:
41 | PathtoPublish: '$(Build.ArtifactStagingDirectory)'
42 | ArtifactName: 'drop-xam-grace'
43 |
--------------------------------------------------------------------------------
/droid.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nightlybuilds-net/Xam.Forms.GraceAlert/dfff7fbf326d3dc72564b482ffd96b1f6c7904ca/droid.gif
--------------------------------------------------------------------------------
/ios.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nightlybuilds-net/Xam.Forms.GraceAlert/dfff7fbf326d3dc72564b482ffd96b1f6c7904ca/ios.gif
--------------------------------------------------------------------------------