├── .gitignore ├── BadgeView.sln ├── Example ├── BadgeViewExample │ ├── App.xaml │ ├── App.xaml.cs │ ├── BadgePage.xaml │ ├── BadgePage.xaml.cs │ └── BadgeViewExample.csproj ├── Droid │ ├── Assets │ │ └── AboutAssets.txt │ ├── BadgeViewExample.Droid.csproj │ ├── MainActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ └── Resources │ │ ├── AboutResources.txt │ │ ├── Resource.designer.cs │ │ ├── drawable-hdpi │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ └── icon.png │ │ ├── drawable │ │ └── icon.png │ │ ├── layout │ │ ├── Tabbar.axml │ │ └── Toolbar.axml │ │ └── values │ │ └── styles.xml └── iOS │ ├── AppDelegate.cs │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── BadgeViewExample.iOS.csproj │ ├── Entitlements.plist │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── Main.cs ├── LICENSE ├── README.md └── src ├── BadgeView.Android ├── BadgeView.Android.csproj ├── CircleViewRenderer.cs ├── Properties │ └── AssemblyInfo.cs └── Resources │ ├── AboutResources.txt │ ├── Resource.designer.cs │ └── values │ └── Strings.xml ├── BadgeView.Nuget └── BadgeView.Nuget.nuproj ├── BadgeView.Shared ├── BadgeView.Shared.csproj ├── BadgeView.Shared.sln ├── BadgeView.xaml ├── BadgeView.xaml.cs └── CircleView.cs └── BadgeView.iOS ├── BadgeView.iOS.csproj ├── CircleViewRenderer.cs └── Properties └── AssemblyInfo.cs /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | 254 | # mFractor 255 | .mfractor/ 256 | 257 | # MacOs 258 | .DS_Store 259 | -------------------------------------------------------------------------------- /BadgeView.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BadgeViewExample", "Example\BadgeViewExample\BadgeViewExample.csproj", "{29B17DB3-1B94-4887-8700-BA7ABDC58E50}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BadgeViewExample.iOS", "Example\iOS\BadgeViewExample.iOS.csproj", "{FACF18C9-5FBF-49AD-AEBE-20D1E161B542}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BadgeViewExample.Droid", "Example\Droid\BadgeViewExample.Droid.csproj", "{C553BEF4-330D-490C-9CCF-8233509A2BD6}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example", "Example", "{D441BD1A-C335-4E32-881D-900113EFB70D}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DCBE8DA3-FFF2-4F20-B16B-C4AB7036CC9A}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BadgeView.Shared", "src\BadgeView.Shared\BadgeView.Shared.csproj", "{3D5011FE-3496-4594-AAA6-08F3CDCE33D6}" 15 | EndProject 16 | Project("{5DD5E4FA-CB73-4610-85AB-557B54E96AA9}") = "BadgeView.Nuget", "src\BadgeView.Nuget\BadgeView.Nuget.nuproj", "{193E088D-D09F-4F85-A455-DE46347C61D8}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BadgeView.iOS", "src\BadgeView.iOS\BadgeView.iOS.csproj", "{5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BadgeView.Android", "src\BadgeView.Android\BadgeView.Android.csproj", "{1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}" 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|Any CPU = Debug|Any CPU 25 | Release|Any CPU = Release|Any CPU 26 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 27 | Release|iPhone = Release|iPhone 28 | Release|iPhoneSimulator = Release|iPhoneSimulator 29 | Debug|iPhone = Debug|iPhone 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 37 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 38 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Release|iPhone.ActiveCfg = Release|Any CPU 39 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Release|iPhone.Build.0 = Release|Any CPU 40 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 41 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 42 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Debug|iPhone.ActiveCfg = Debug|Any CPU 43 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50}.Debug|iPhone.Build.0 = Debug|Any CPU 44 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator 45 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator 46 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Release|Any CPU.ActiveCfg = Release|iPhone 47 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Release|Any CPU.Build.0 = Release|iPhone 48 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 49 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 50 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Release|iPhone.ActiveCfg = Release|iPhone 51 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Release|iPhone.Build.0 = Release|iPhone 52 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 53 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 54 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Debug|iPhone.ActiveCfg = Debug|iPhone 55 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542}.Debug|iPhone.Build.0 = Debug|iPhone 56 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Release|Any CPU.ActiveCfg = Release|Any CPU 59 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Release|Any CPU.Build.0 = Release|Any CPU 60 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 61 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 62 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Release|iPhone.ActiveCfg = Release|Any CPU 63 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Release|iPhone.Build.0 = Release|Any CPU 64 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 65 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 66 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Debug|iPhone.ActiveCfg = Debug|Any CPU 67 | {C553BEF4-330D-490C-9CCF-8233509A2BD6}.Debug|iPhone.Build.0 = Debug|Any CPU 68 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 69 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Debug|Any CPU.Build.0 = Debug|Any CPU 70 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Release|Any CPU.ActiveCfg = Release|Any CPU 71 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Release|Any CPU.Build.0 = Release|Any CPU 72 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 73 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 74 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Release|iPhone.ActiveCfg = Release|Any CPU 75 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Release|iPhone.Build.0 = Release|Any CPU 76 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 77 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 78 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Debug|iPhone.ActiveCfg = Debug|Any CPU 79 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6}.Debug|iPhone.Build.0 = Debug|Any CPU 80 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 81 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 82 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 83 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Release|Any CPU.Build.0 = Release|Any CPU 84 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 85 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 86 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Release|iPhone.ActiveCfg = Release|Any CPU 87 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Release|iPhone.Build.0 = Release|Any CPU 88 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 89 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 90 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Debug|iPhone.ActiveCfg = Debug|Any CPU 91 | {193E088D-D09F-4F85-A455-DE46347C61D8}.Debug|iPhone.Build.0 = Debug|Any CPU 92 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 93 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU 94 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU 95 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Release|Any CPU.Build.0 = Release|Any CPU 96 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 97 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 98 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Release|iPhone.ActiveCfg = Release|Any CPU 99 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Release|iPhone.Build.0 = Release|Any CPU 100 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 101 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 102 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Debug|iPhone.ActiveCfg = Debug|Any CPU 103 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2}.Debug|iPhone.Build.0 = Debug|Any CPU 104 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 105 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Debug|Any CPU.Build.0 = Debug|Any CPU 106 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Release|Any CPU.ActiveCfg = Release|Any CPU 107 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Release|Any CPU.Build.0 = Release|Any CPU 108 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 109 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 110 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Release|iPhone.ActiveCfg = Release|Any CPU 111 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Release|iPhone.Build.0 = Release|Any CPU 112 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 113 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 114 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Debug|iPhone.ActiveCfg = Debug|Any CPU 115 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E}.Debug|iPhone.Build.0 = Debug|Any CPU 116 | EndGlobalSection 117 | GlobalSection(NestedProjects) = preSolution 118 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50} = {D441BD1A-C335-4E32-881D-900113EFB70D} 119 | {C553BEF4-330D-490C-9CCF-8233509A2BD6} = {D441BD1A-C335-4E32-881D-900113EFB70D} 120 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542} = {D441BD1A-C335-4E32-881D-900113EFB70D} 121 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6} = {DCBE8DA3-FFF2-4F20-B16B-C4AB7036CC9A} 122 | {193E088D-D09F-4F85-A455-DE46347C61D8} = {DCBE8DA3-FFF2-4F20-B16B-C4AB7036CC9A} 123 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2} = {DCBE8DA3-FFF2-4F20-B16B-C4AB7036CC9A} 124 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E} = {DCBE8DA3-FFF2-4F20-B16B-C4AB7036CC9A} 125 | EndGlobalSection 126 | EndGlobal 127 | -------------------------------------------------------------------------------- /Example/BadgeViewExample/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Example/BadgeViewExample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.Forms; 2 | using Xamarin.Forms.Xaml; 3 | 4 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)] 5 | namespace BadgeViewExample 6 | { 7 | public partial class App : Application 8 | { 9 | public App() 10 | { 11 | InitializeComponent(); 12 | 13 | MainPage = new BadgePage(); 14 | } 15 | 16 | protected override void OnStart() 17 | { 18 | // Handle when your app starts 19 | } 20 | 21 | protected override void OnSleep() 22 | { 23 | // Handle when your app sleeps 24 | } 25 | 26 | protected override void OnResume() 27 | { 28 | // Handle when your app resumes 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Example/BadgeViewExample/BadgePage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | -------------------------------------------------------------------------------- /Example/BadgeViewExample/BadgePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using Xamarin.Forms; 5 | 6 | namespace BadgeViewExample 7 | { 8 | public partial class BadgePage : ContentPage 9 | { 10 | public BadgePage() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Example/BadgeViewExample/BadgeViewExample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Example/Droid/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 your 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 | -------------------------------------------------------------------------------- /Example/Droid/BadgeViewExample.Droid.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {C553BEF4-330D-490C-9CCF-8233509A2BD6} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | BadgeViewExample.Droid 10 | BadgeViewExample.Droid 11 | v9.0 12 | True 13 | Resources\Resource.designer.cs 14 | Resource 15 | Properties\AndroidManifest.xml 16 | Resources 17 | Assets 18 | true 19 | 20 | 21 | true 22 | full 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 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50} 82 | BadgeViewExample 83 | 84 | 85 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6} 86 | BadgeView.Shared 87 | 88 | 89 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E} 90 | BadgeView.Android 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Example/Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content; 5 | using Android.Content.PM; 6 | using Android.Runtime; 7 | using Android.Views; 8 | using Android.Widget; 9 | using Android.OS; 10 | using BadgeView.Android; 11 | 12 | namespace BadgeViewExample.Droid 13 | { 14 | [Activity(Label = "BadgeViewExample.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 15 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 16 | { 17 | protected override void OnCreate(Bundle bundle) 18 | { 19 | TabLayoutResource = Resource.Layout.Tabbar; 20 | ToolbarResource = Resource.Layout.Toolbar; 21 | 22 | base.OnCreate(bundle); 23 | CircleViewRenderer.Initialize(); 24 | 25 | global::Xamarin.Forms.Forms.Init(this, bundle); 26 | 27 | LoadApplication(new App()); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Example/Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Example/Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using Android.App; 4 | 5 | // Information about this assembly is defined by the following attributes. 6 | // Change them to the values specific to your project. 7 | 8 | [assembly: AssemblyTitle("BadgeViewExample.Droid")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("")] 13 | [assembly: AssemblyCopyright("(c) Alex Dunn")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 20 | 21 | [assembly: AssemblyVersion("1.0.0")] 22 | 23 | // The following attributes are used to specify the signing key for the assembly, 24 | // if desired. See the Mono documentation for more information about signing. 25 | 26 | //[assembly: AssemblyDelaySign(false)] 27 | //[assembly: AssemblyKeyFile("")] 28 | -------------------------------------------------------------------------------- /Example/Droid/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.axml), 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/ 12 | icon.png 13 | 14 | layout/ 15 | main.axml 16 | 17 | values/ 18 | strings.xml 19 | 20 | In order to get the build system to recognize Android resources, set the build action to 21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 22 | instead operate on resource IDs. When you compile an Android application that uses resources, 23 | the build system will package the resources for distribution and generate a class called "R" 24 | (this is an Android convention) that contains the tokens for each one of the resources 25 | included. For example, for the above Resources layout, this is what the R class would expose: 26 | 27 | public class R { 28 | public class drawable { 29 | public const int icon = 0x123; 30 | } 31 | 32 | public class layout { 33 | public const int main = 0x456; 34 | } 35 | 36 | public class strings { 37 | public const int first_string = 0xabc; 38 | public const int second_string = 0xbcd; 39 | } 40 | } 41 | 42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main 43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first 44 | string in the dictionary file values/strings.xml. 45 | -------------------------------------------------------------------------------- /Example/Droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuavePirate/BadgeView/76cc1cbccca59d8e8ab54af523280cd226496fc3/Example/Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Example/Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuavePirate/BadgeView/76cc1cbccca59d8e8ab54af523280cd226496fc3/Example/Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /Example/Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuavePirate/BadgeView/76cc1cbccca59d8e8ab54af523280cd226496fc3/Example/Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /Example/Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuavePirate/BadgeView/76cc1cbccca59d8e8ab54af523280cd226496fc3/Example/Droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /Example/Droid/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Example/Droid/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Example/Droid/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | 6 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /Example/iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using BadgeView.iOS; 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace BadgeViewExample.iOS 9 | { 10 | [Register("AppDelegate")] 11 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 12 | { 13 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 14 | { 15 | global::Xamarin.Forms.Forms.Init(); 16 | LoadApplication(new App()); 17 | 18 | CircleViewRenderer.Initialize(); 19 | return base.FinishedLaunching(app, options); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Example/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "iphone", 5 | "size": "29x29", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "iphone", 10 | "size": "29x29", 11 | "scale": "2x" 12 | }, 13 | { 14 | "idiom": "iphone", 15 | "size": "29x29", 16 | "scale": "3x" 17 | }, 18 | { 19 | "idiom": "iphone", 20 | "size": "40x40", 21 | "scale": "2x" 22 | }, 23 | { 24 | "idiom": "iphone", 25 | "size": "40x40", 26 | "scale": "3x" 27 | }, 28 | { 29 | "idiom": "iphone", 30 | "size": "57x57", 31 | "scale": "1x" 32 | }, 33 | { 34 | "idiom": "iphone", 35 | "size": "57x57", 36 | "scale": "2x" 37 | }, 38 | { 39 | "idiom": "iphone", 40 | "size": "60x60", 41 | "scale": "2x" 42 | }, 43 | { 44 | "idiom": "iphone", 45 | "size": "60x60", 46 | "scale": "3x" 47 | }, 48 | { 49 | "idiom": "ipad", 50 | "size": "29x29", 51 | "scale": "1x" 52 | }, 53 | { 54 | "idiom": "ipad", 55 | "size": "29x29", 56 | "scale": "2x" 57 | }, 58 | { 59 | "idiom": "ipad", 60 | "size": "40x40", 61 | "scale": "1x" 62 | }, 63 | { 64 | "idiom": "ipad", 65 | "size": "40x40", 66 | "scale": "2x" 67 | }, 68 | { 69 | "idiom": "ipad", 70 | "size": "50x50", 71 | "scale": "1x" 72 | }, 73 | { 74 | "idiom": "ipad", 75 | "size": "50x50", 76 | "scale": "2x" 77 | }, 78 | { 79 | "idiom": "ipad", 80 | "size": "72x72", 81 | "scale": "1x" 82 | }, 83 | { 84 | "idiom": "ipad", 85 | "size": "72x72", 86 | "scale": "2x" 87 | }, 88 | { 89 | "idiom": "ipad", 90 | "size": "76x76", 91 | "scale": "1x" 92 | }, 93 | { 94 | "idiom": "ipad", 95 | "size": "76x76", 96 | "scale": "2x" 97 | }, 98 | { 99 | "size": "24x24", 100 | "idiom": "watch", 101 | "scale": "2x", 102 | "role": "notificationCenter", 103 | "subtype": "38mm" 104 | }, 105 | { 106 | "size": "27.5x27.5", 107 | "idiom": "watch", 108 | "scale": "2x", 109 | "role": "notificationCenter", 110 | "subtype": "42mm" 111 | }, 112 | { 113 | "size": "29x29", 114 | "idiom": "watch", 115 | "role": "companionSettings", 116 | "scale": "2x" 117 | }, 118 | { 119 | "size": "29x29", 120 | "idiom": "watch", 121 | "role": "companionSettings", 122 | "scale": "3x" 123 | }, 124 | { 125 | "size": "40x40", 126 | "idiom": "watch", 127 | "scale": "2x", 128 | "role": "appLauncher", 129 | "subtype": "38mm" 130 | }, 131 | { 132 | "size": "44x44", 133 | "idiom": "watch", 134 | "scale": "2x", 135 | "role": "longLook", 136 | "subtype": "42mm" 137 | }, 138 | { 139 | "size": "86x86", 140 | "idiom": "watch", 141 | "scale": "2x", 142 | "role": "quickLook", 143 | "subtype": "38mm" 144 | }, 145 | { 146 | "size": "98x98", 147 | "idiom": "watch", 148 | "scale": "2x", 149 | "role": "quickLook", 150 | "subtype": "42mm" 151 | } 152 | ], 153 | "info": { 154 | "version": 1, 155 | "author": "xcode" 156 | } 157 | } -------------------------------------------------------------------------------- /Example/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/iOS/BadgeViewExample.iOS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | {FACF18C9-5FBF-49AD-AEBE-20D1E161B542} 7 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Exe 9 | BadgeViewExample.iOS 10 | BadgeViewExample.iOS 11 | Resources 12 | 13 | 14 | true 15 | full 16 | false 17 | bin\iPhoneSimulator\Debug 18 | DEBUG;ENABLE_TEST_CLOUD; 19 | prompt 20 | 4 21 | iPhone Developer 22 | true 23 | true 24 | true 25 | 25483 26 | None 27 | i386, x86_64 28 | HttpClientHandler 29 | x86 30 | 31 | 32 | pdbonly 33 | true 34 | bin\iPhone\Release 35 | prompt 36 | 4 37 | iPhone Developer 38 | true 39 | Entitlements.plist 40 | SdkOnly 41 | ARMv7, ARM64 42 | HttpClientHandler 43 | x86 44 | 45 | 46 | pdbonly 47 | true 48 | bin\iPhoneSimulator\Release 49 | prompt 50 | 4 51 | iPhone Developer 52 | true 53 | None 54 | i386, x86_64 55 | HttpClientHandler 56 | x86 57 | 58 | 59 | true 60 | full 61 | false 62 | bin\iPhone\Debug 63 | DEBUG;ENABLE_TEST_CLOUD; 64 | prompt 65 | 4 66 | iPhone Developer 67 | true 68 | true 69 | true 70 | true 71 | true 72 | Entitlements.plist 73 | 56482 74 | SdkOnly 75 | ARMv7, ARM64 76 | HttpClientHandler 77 | x86 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | {29B17DB3-1B94-4887-8700-BA7ABDC58E50} 91 | BadgeViewExample 92 | 93 | 94 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6} 95 | BadgeView.Shared 96 | 97 | 98 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2} 99 | BadgeView.iOS 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /Example/iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Example/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDisplayName 6 | BadgeViewExample 7 | CFBundleName 8 | BadgeViewExample 9 | CFBundleIdentifier 10 | com.suavepirate.BadgeViewExample 11 | CFBundleShortVersionString 12 | 1.0 13 | CFBundleVersion 14 | 1.0 15 | LSRequiresIPhoneOS 16 | 17 | MinimumOSVersion 18 | 12.0 19 | UIDeviceFamily 20 | 21 | 1 22 | 2 23 | 24 | UILaunchStoryboardName 25 | LaunchScreen 26 | UIRequiredDeviceCapabilities 27 | 28 | armv7 29 | 30 | UISupportedInterfaceOrientations 31 | 32 | UIInterfaceOrientationPortrait 33 | UIInterfaceOrientationLandscapeLeft 34 | UIInterfaceOrientationLandscapeRight 35 | 36 | UISupportedInterfaceOrientations~ipad 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationPortraitUpsideDown 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | XSAppIconAssets 44 | Assets.xcassets/AppIcon.appiconset 45 | 46 | 47 | -------------------------------------------------------------------------------- /Example/iOS/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 | -------------------------------------------------------------------------------- /Example/iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace BadgeViewExample.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alex Dunn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BadgeView 2 | A simple Xamarin.Forms control to display a round badge 3 | 4 | Now available on nuget! https://www.nuget.org/packages/BadgeView 5 | 6 | ## Installation 7 | 8 | `Install-Package BadgeView` 9 | 10 | ## Usage 11 | 12 | ``` xml 13 | 14 | 15 | 16 | 19 | 20 | 21 | ``` 22 | 23 | ### With Bindings 24 | 25 | ``` xml 26 | 27 | ``` 28 | 29 | ### Without XAML 30 | 31 | ``` csharp 32 | var badge = new BadgeView() 33 | { 34 | Text = "4", 35 | BadgeColor = Color.Red 36 | }; 37 | ``` 38 | 39 | ## Additional Resources 40 | 41 | Check out my blog post on how to build your own if you want! 42 | https://alexdunn.org/2017/03/15/xamarin-controls-badgeview/ 43 | 44 | ## TODO 45 | 46 | - Add UWP Support 47 | 48 | ## Sponsor 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/BadgeView.Android/BadgeView.Android.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E} 8 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | Library 10 | BadgeView.Android 11 | BadgeView.Android 12 | v9.0 13 | Resources\Resource.designer.cs 14 | Resource 15 | Resources 16 | Assets 17 | true 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug 24 | DEBUG; 25 | prompt 26 | 4 27 | None 28 | 29 | 30 | 31 | 32 | true 33 | pdbonly 34 | true 35 | bin\Release 36 | prompt 37 | 4 38 | true 39 | false 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 | 0.2.0 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6} 88 | BadgeView.Shared 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/BadgeView.Android/CircleViewRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Content; 3 | using Android.Graphics; 4 | using Android.Util; 5 | using BadgeView.Android; 6 | using BadgeView.Shared; 7 | using Xamarin.Forms; 8 | using Xamarin.Forms.Platform.Android; 9 | 10 | [assembly: ExportRenderer(typeof(CircleView), typeof(CircleViewRenderer))] 11 | namespace BadgeView.Android 12 | { 13 | public class CircleViewRenderer : BoxRenderer 14 | { 15 | private float _cornerRadius; 16 | private RectF _bounds; 17 | private Path _path; 18 | public static void Initialize() { } 19 | 20 | public CircleViewRenderer(Context context) : base(context) 21 | { 22 | 23 | } 24 | 25 | protected override void OnElementChanged(ElementChangedEventArgs e) 26 | { 27 | base.OnElementChanged(e); 28 | 29 | if (Element == null) 30 | { 31 | return; 32 | } 33 | var element = (CircleView)Element; 34 | 35 | _cornerRadius = TypedValue.ApplyDimension(ComplexUnitType.Dip, (float)element.BadgeCornerRadius, Context.Resources.DisplayMetrics); 36 | 37 | } 38 | 39 | protected override void OnSizeChanged(int w, int h, int oldw, int oldh) 40 | { 41 | base.OnSizeChanged(w, h, oldw, oldh); 42 | if (w != oldw && h != oldh) 43 | { 44 | _bounds = new RectF(0, 0, w, h); 45 | } 46 | 47 | _path = new Path(); 48 | _path.Reset(); 49 | _path.AddRoundRect(_bounds, _cornerRadius, _cornerRadius, Path.Direction.Cw); 50 | _path.Close(); 51 | } 52 | 53 | public override void Draw(Canvas canvas) 54 | { 55 | canvas.Save(); 56 | canvas.ClipPath(_path); 57 | base.Draw(canvas); 58 | canvas.Restore(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/BadgeView.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("BadgeView.Android")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.0")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /src/BadgeView.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.axml), 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/ 12 | icon.png 13 | 14 | layout/ 15 | main.axml 16 | 17 | values/ 18 | strings.xml 19 | 20 | In order to get the build system to recognize Android resources, set the build action to 21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 22 | instead operate on resource IDs. When you compile an Android application that uses resources, 23 | the build system will package the resources for distribution and generate a class called "R" 24 | (this is an Android convention) that contains the tokens for each one of the resources 25 | included. For example, for the above Resources layout, this is what the R class would expose: 26 | 27 | public class R { 28 | public class drawable { 29 | public const int icon = 0x123; 30 | } 31 | 32 | public class layout { 33 | public const int main = 0x456; 34 | } 35 | 36 | public class strings { 37 | public const int first_string = 0xabc; 38 | public const int second_string = 0xbcd; 39 | } 40 | } 41 | 42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main 43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first 44 | string in the dictionary file values/strings.xml. 45 | -------------------------------------------------------------------------------- /src/BadgeView.Android/Resources/values/Strings.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | BadgeView.Android 4 | 5 | -------------------------------------------------------------------------------- /src/BadgeView.Nuget/BadgeView.Nuget.nuproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {193E088D-D09F-4F85-A455-DE46347C61D8} 8 | A simple Xamarin.Forms BadgeView to use anywhere in your application. Change the color and apply a number to the badge. That's it! 9 | BadgeView 10 | 2017.10.17 11 | SuavePirate 12 | false 13 | false 14 | Exe 15 | BadgeView.Nuget 16 | false 17 | BadgeView.Nuget 18 | v4.5 19 | SuavePirate 20 | Xamarin.Forms BadgeView Badge 21 | BadgeView 22 | Initial Release 23 | A simple Xamarin.Forms BadgeView to use anywhere in your application. 24 | https://github.com/SuavePirate/BadgeView 25 | https://alexdunndev.files.wordpress.com/2017/03/xamagonbadge.png?w=609&h=510&crop=1 26 | https://github.com/SuavePirate/BadgeView/blob/master/LICENSE 27 | 28 | 29 | true 30 | full 31 | bin\Debug 32 | prompt 33 | 34 | 35 | bin\Release 36 | prompt 37 | 38 | 39 | 40 | 0.2.2 41 | All 42 | 43 | 44 | 45 | 46 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6} 47 | BadgeView.Shared 48 | 49 | 50 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2} 51 | BadgeView.iOS 52 | 53 | 54 | {1CA25F7C-F44D-4A73-B71E-B3D7E628A37E} 55 | BadgeView.Android 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/BadgeView.Shared/BadgeView.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/BadgeView.Shared/BadgeView.Shared.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BadgeView.Shared", "BadgeView.Shared.csproj", "{CE7C0015-6506-44E0-977D-3077C3C61046}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {CE7C0015-6506-44E0-977D-3077C3C61046}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {CE7C0015-6506-44E0-977D-3077C3C61046}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {CE7C0015-6506-44E0-977D-3077C3C61046}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {CE7C0015-6506-44E0-977D-3077C3C61046}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | EndGlobal 18 | -------------------------------------------------------------------------------- /src/BadgeView.Shared/BadgeView.xaml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /src/BadgeView.Shared/BadgeView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Xamarin.Forms; 4 | 5 | namespace BadgeView.Shared 6 | { 7 | public partial class BadgeView : Grid 8 | { 9 | public static BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(BadgeView), "0", propertyChanged: (bindable, oldVal, newVal) => 10 | { 11 | var view = (BadgeView)bindable; 12 | view.BadgeLabel.Text = (string)newVal; 13 | }); 14 | 15 | public static BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Color), typeof(BadgeView), Color.White, propertyChanged: (bindable, oldVal, newVal) => 16 | { 17 | var view = (BadgeView)bindable; 18 | view.BadgeLabel.TextColor = (Color)newVal; 19 | }); 20 | 21 | public static BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(BadgeView), Label.FontFamilyProperty.DefaultValue, propertyChanged: (bindable, oldVal, newVal) => 22 | { 23 | var view = (BadgeView)bindable; 24 | view.BadgeLabel.FontFamily = (string)newVal; 25 | }); 26 | 27 | public static BindableProperty BadgeColorProperty = BindableProperty.Create("BadgeColor", typeof(Color), typeof(BadgeView), Color.Blue, propertyChanged: (bindable, oldVal, newVal) => 28 | { 29 | var view = (BadgeView)bindable; 30 | view.BadgeCircle.BackgroundColor = (Color)newVal; 31 | }); 32 | 33 | public string Text 34 | { 35 | get 36 | { 37 | return (string)GetValue(TextProperty); 38 | } 39 | set 40 | { 41 | SetValue(TextProperty, value); 42 | } 43 | } 44 | 45 | public Color TextColor 46 | { 47 | get 48 | { 49 | return (Color)GetValue(TextColorProperty); 50 | } 51 | set 52 | { 53 | SetValue(TextColorProperty, value); 54 | } 55 | } 56 | 57 | public string FontFamily 58 | { 59 | get 60 | { 61 | return (string)GetValue(FontFamilyProperty); 62 | } 63 | set 64 | { 65 | SetValue(FontFamilyProperty, value); 66 | } 67 | } 68 | 69 | public Color BadgeColor 70 | { 71 | get 72 | { 73 | return (Color)GetValue(BadgeColorProperty); 74 | } 75 | set 76 | { 77 | SetValue(BadgeColorProperty, value); 78 | } 79 | } 80 | 81 | public BadgeView() 82 | { 83 | InitializeComponent(); 84 | BadgeLabel.Text = Text; 85 | BadgeLabel.TextColor = TextColor; 86 | BadgeLabel.FontFamily = FontFamily; 87 | BadgeCircle.BackgroundColor = BadgeColor; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/BadgeView.Shared/CircleView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xamarin.Forms; 3 | 4 | namespace BadgeView.Shared 5 | { 6 | public class CircleView : BoxView 7 | { 8 | public static readonly BindableProperty BadgeCornerRadiusProperty = BindableProperty.Create(nameof(BadgeCornerRadius), typeof(double), typeof(CircleView), 0.0); 9 | 10 | public double BadgeCornerRadius 11 | { 12 | get { return (double)GetValue(BadgeCornerRadiusProperty); } 13 | set { SetValue(BadgeCornerRadiusProperty, value); } 14 | } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/BadgeView.iOS/BadgeView.iOS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {5B38BD8B-9E98-449C-B86F-EE305A0A5AE2} 7 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | BadgeView.iOS 10 | BadgeView.iOS 11 | Resources 12 | 13 | 14 | true 15 | full 16 | false 17 | bin\Debug 18 | DEBUG; 19 | prompt 20 | 4 21 | iPhone Developer 22 | true 23 | true 24 | true 25 | true 26 | 28604 27 | NSUrlSessionHandler 28 | false 29 | 30 | 31 | 32 | 33 | pdbonly 34 | true 35 | bin\Release 36 | 37 | prompt 38 | 4 39 | iPhone Developer 40 | true 41 | SdkOnly 42 | NSUrlSessionHandler 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | {3D5011FE-3496-4594-AAA6-08F3CDCE33D6} 65 | BadgeView.Shared 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/BadgeView.iOS/CircleViewRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BadgeView.iOS; 3 | using BadgeView.Shared; 4 | using CoreAnimation; 5 | using CoreGraphics; 6 | using UIKit; 7 | using Xamarin.Forms; 8 | using Xamarin.Forms.Platform.iOS; 9 | 10 | [assembly: ExportRenderer(typeof(CircleView), typeof(CircleViewRenderer))] 11 | namespace BadgeView.iOS 12 | { 13 | public class CircleViewRenderer : BoxRenderer 14 | { 15 | public static void Initialize() { } 16 | protected override void OnElementChanged(ElementChangedEventArgs e) 17 | { 18 | base.OnElementChanged(e); 19 | 20 | if (Element == null) 21 | return; 22 | 23 | Layer.MasksToBounds = true; 24 | Layer.CornerRadius = (float)((CircleView)Element).BadgeCornerRadius / 2.0f; 25 | 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/BadgeView.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("BadgeView.iOS")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | --------------------------------------------------------------------------------