├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md └── Samples └── Samples.ShellItemRenderer ├── README.md ├── TodosSample.sln ├── design ├── did_you.png └── did_you_1.jpg └── src ├── TodosSample.Android ├── Assets │ └── AboutAssets.txt ├── Extensions │ └── ImageSourceExtensions.cs ├── MainActivity.cs ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs ├── Renderers │ ├── TodoShellItemRenderer.cs │ └── TodoShellRenderer.cs ├── Resources │ ├── AboutResources.txt │ ├── Resource.designer.cs │ ├── drawable-hdpi │ │ ├── tab_dashboard.png │ │ ├── tab_newtask.png │ │ └── tab_profile.png │ ├── drawable-mdpi │ │ ├── tab_dashboard.png │ │ ├── tab_newtask.png │ │ └── tab_profile.png │ ├── drawable-xhdpi │ │ ├── tab_dashboard.png │ │ ├── tab_newtask.png │ │ └── tab_profile.png │ ├── drawable-xxhdpi │ │ ├── tab_dashboard.png │ │ ├── tab_newtask.png │ │ └── tab_profile.png │ ├── drawable-xxxhdpi │ │ ├── tab_dashboard.png │ │ ├── tab_newtask.png │ │ └── tab_profile.png │ ├── drawable │ │ ├── tab_about.png │ │ ├── tab_feed.png │ │ └── xamarin_logo.png │ ├── layout │ │ ├── BottomTabLayout.axml │ │ ├── Tabbar.axml │ │ └── Toolbar.axml │ ├── mipmap-anydpi-v26 │ │ ├── icon.xml │ │ └── icon_round.xml │ ├── mipmap-hdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-mdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-xhdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-xxhdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-xxxhdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ └── values │ │ ├── colors.xml │ │ └── styles.xml └── TodosSample.Android.csproj └── TodosSample ├── App.xaml ├── App.xaml.cs ├── AppShell.xaml ├── AppShell.xaml.cs ├── AssemblyInfo.cs ├── Controls └── TodoTabBar.cs ├── TodosSample.csproj └── Views ├── DashboardPage.xaml ├── DashboardPage.xaml.cs ├── NewTaskPage.xaml ├── NewTaskPage.xaml.cs ├── ProfilePage.xaml └── ProfilePage.xaml.cs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [ahoefling] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.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 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Andrew Hoefling 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 | # XamarinShellSamples 2 | Useful Sample Code for Xamarin.Forms Shell 3 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/README.md: -------------------------------------------------------------------------------- 1 | # ShellItemRenderer Sample - Todo App 2 | This sample code is to be used as learning material that goes along with my blog - [Xamarin.Forms Shell: Customizing the TabBar (Android)](https://www.andrewhoefling.com/Blog/Post/xamarin-forms-shell-customizing-the-tabbar-android). 3 | 4 | 5 | # Design 6 | The app is built to simulate the tab-bar at the bottom of this Todo App Design from Dribble 7 | 8 | ![All Screens](design/did_you.png) 9 | 10 | ![One Screen](design/did_you_1.jpg) -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/TodosSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29009.5 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TodosSample", "src\TodosSample\TodosSample.csproj", "{7CA1455E-A749-4351-92F8-4C75E07B9977}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodosSample.Android", "src\TodosSample.Android\TodosSample.Android.csproj", "{11340CCC-F9A2-4C85-A3CD-E36AD305D727}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CC401B5E-2D40-4B37-8592-3CB26E6239EF}" 11 | ProjectSection(SolutionItems) = preProject 12 | README.md = README.md 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {7CA1455E-A749-4351-92F8-4C75E07B9977}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {7CA1455E-A749-4351-92F8-4C75E07B9977}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {7CA1455E-A749-4351-92F8-4C75E07B9977}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {7CA1455E-A749-4351-92F8-4C75E07B9977}.Release|Any CPU.Build.0 = Release|Any CPU 25 | {11340CCC-F9A2-4C85-A3CD-E36AD305D727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {11340CCC-F9A2-4C85-A3CD-E36AD305D727}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {11340CCC-F9A2-4C85-A3CD-E36AD305D727}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 28 | {11340CCC-F9A2-4C85-A3CD-E36AD305D727}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {11340CCC-F9A2-4C85-A3CD-E36AD305D727}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {11340CCC-F9A2-4C85-A3CD-E36AD305D727}.Release|Any CPU.Deploy.0 = Release|Any CPU 31 | EndGlobalSection 32 | GlobalSection(SolutionProperties) = preSolution 33 | HideSolutionNode = FALSE 34 | EndGlobalSection 35 | GlobalSection(ExtensibilityGlobals) = postSolution 36 | SolutionGuid = {DD224D60-E04D-43E9-9649-A187F6F8A1A6} 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/design/did_you.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/design/did_you.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/design/did_you_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/design/did_you_1.jpg -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.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 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Extensions/ImageSourceExtensions.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.Forms; 2 | using Xamarin.Forms.Platform.Android; 3 | 4 | namespace TodosSample.Droid.Extensions 5 | { 6 | internal static class ImageSourceExtensions 7 | { 8 | public static IImageSourceHandler GetHandler(this ImageSource imageSource) 9 | { 10 | if (imageSource is UriImageSource) 11 | return new ImageLoaderSourceHandler(); 12 | else if (imageSource is FileImageSource) 13 | return new FileImageSourceHandler(); 14 | else if (imageSource is StreamImageSource) 15 | return new StreamImagesourceHandler(); 16 | else if (imageSource is FontImageSource) 17 | return new FontImageSourceHandler(); 18 | 19 | return null; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | 10 | namespace TodosSample.Droid 11 | { 12 | [Activity(Label = "TodosSample", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, 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 | 22 | global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental"); 23 | Xamarin.Essentials.Platform.Init(this, savedInstanceState); 24 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState); 25 | LoadApplication(new App()); 26 | } 27 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) 28 | { 29 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); 30 | 31 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.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("TodosSample.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("TodosSample.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 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")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Renderers/TodoShellItemRenderer.cs: -------------------------------------------------------------------------------- 1 | using Android.Graphics; 2 | using Android.OS; 3 | using Android.Support.Design.Widget; 4 | using Android.Views; 5 | using Android.Widget; 6 | using TodosSample.Controls; 7 | using TodosSample.Droid.Extensions; 8 | using Xamarin.Forms.Platform.Android; 9 | 10 | namespace TodosSample.Droid.Renderers 11 | { 12 | public class TodoShellItemRenderer : ShellItemRenderer 13 | { 14 | FrameLayout _shellOverlay; 15 | BottomNavigationView _bottomView; 16 | 17 | public TodoShellItemRenderer(IShellContext shellContext) : base(shellContext) 18 | { 19 | } 20 | 21 | public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 22 | { 23 | var outerlayout = base.OnCreateView(inflater, container, savedInstanceState); 24 | _bottomView = outerlayout.FindViewById(Resource.Id.bottomtab_tabbar); 25 | _shellOverlay = outerlayout.FindViewById(Resource.Id.bottomtab_tabbar_container); 26 | 27 | if (ShellItem is TodoTabBar todoTabBar && todoTabBar.LargeTab != null) 28 | SetupLargeTab(); 29 | 30 | return outerlayout; 31 | } 32 | 33 | private async void SetupLargeTab() 34 | { 35 | var todoTabBar = (TodoTabBar)ShellItem; 36 | var layout = new FrameLayout(Context); 37 | 38 | var imageHandler = todoTabBar.LargeTab.Icon.GetHandler(); 39 | Bitmap bitmap = await imageHandler.LoadImageAsync(todoTabBar.LargeTab.Icon, Context); 40 | var image = new ImageView(Context); 41 | image.SetImageBitmap(bitmap); 42 | 43 | layout.AddView(image); 44 | 45 | var lp = new FrameLayout.LayoutParams(300, 300); 46 | _bottomView.Measure((int)MeasureSpecMode.Unspecified, (int)MeasureSpecMode.Unspecified); 47 | lp.BottomMargin = _bottomView.MeasuredHeight / 2; 48 | 49 | layout.LayoutParameters = lp; 50 | 51 | _shellOverlay.RemoveAllViews(); 52 | _shellOverlay.AddView(layout); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Renderers/TodoShellRenderer.cs: -------------------------------------------------------------------------------- 1 | using Android.Content; 2 | using TodosSample.Droid.Renderers; 3 | using Xamarin.Forms; 4 | using Xamarin.Forms.Platform.Android; 5 | 6 | [assembly: ExportRenderer(typeof(Shell), typeof(TodoShellRenderer))] 7 | namespace TodosSample.Droid.Renderers 8 | { 9 | public class TodoShellRenderer : ShellRenderer 10 | { 11 | public TodoShellRenderer(Context context) : base(context) 12 | { 13 | } 14 | 15 | protected override IShellItemRenderer CreateShellItemRenderer(ShellItem shellItem) 16 | { 17 | return new TodoShellItemRenderer(this); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.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 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-hdpi/tab_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-hdpi/tab_dashboard.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-hdpi/tab_newtask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-hdpi/tab_newtask.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-hdpi/tab_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-hdpi/tab_profile.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-mdpi/tab_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-mdpi/tab_dashboard.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-mdpi/tab_newtask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-mdpi/tab_newtask.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-mdpi/tab_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-mdpi/tab_profile.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xhdpi/tab_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xhdpi/tab_dashboard.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xhdpi/tab_newtask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xhdpi/tab_newtask.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xhdpi/tab_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xhdpi/tab_profile.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxhdpi/tab_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxhdpi/tab_dashboard.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxhdpi/tab_newtask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxhdpi/tab_newtask.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxhdpi/tab_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxhdpi/tab_profile.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxxhdpi/tab_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxxhdpi/tab_dashboard.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxxhdpi/tab_newtask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxxhdpi/tab_newtask.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxxhdpi/tab_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable-xxxhdpi/tab_profile.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable/tab_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable/tab_about.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable/tab_feed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable/tab_feed.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable/xamarin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/drawable/xamarin_logo.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/layout/BottomTabLayout.axml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 17 | 18 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-anydpi-v26/icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-anydpi-v26/icon_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-hdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-hdpi/launcher_foreground.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-mdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-mdpi/launcher_foreground.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeHoefling/XamarinShellSamples/92d1ce892174f5557a5f6b8df3c612d040a5d22b/Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | #3F51B5 5 | #303F9F 6 | #FF4081 7 | 8 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample.Android/TodosSample.Android.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {11340CCC-F9A2-4C85-A3CD-E36AD305D727} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | {6968b3a4-1835-46a3-ac5c-1ae33b475983} 9 | Library 10 | TodosSample.Droid 11 | TodosSample.Android 12 | True 13 | Resources\Resource.designer.cs 14 | Resource 15 | Properties\AndroidManifest.xml 16 | Resources 17 | Assets 18 | false 19 | v9.0 20 | true 21 | Xamarin.Android.Net.AndroidClientHandler 22 | 23 | 24 | 25 | 26 | true 27 | portable 28 | false 29 | bin\Debug 30 | DEBUG; 31 | prompt 32 | 4 33 | None 34 | 35 | 36 | true 37 | portable 38 | true 39 | bin\Release 40 | prompt 41 | 4 42 | true 43 | false 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 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | {96C25E2B-F667-4D21-BB88-58BCF0176863} 106 | TodosSample 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | Designer 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.Forms; 2 | 3 | namespace TodosSample 4 | { 5 | public partial class App : Application 6 | { 7 | 8 | public App() 9 | { 10 | InitializeComponent(); 11 | 12 | MainPage = new AppShell(); 13 | } 14 | 15 | protected override void OnStart() 16 | { 17 | // Handle when your app starts 18 | } 19 | 20 | protected override void OnSleep() 21 | { 22 | // Handle when your app sleeps 23 | } 24 | 25 | protected override void OnResume() 26 | { 27 | // Handle when your app resumes 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Samples/Samples.ShellItemRenderer/src/TodosSample/AppShell.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | #fefefe 15 | 26 |