![]() Same idea here as the Colors.xml, you concentrate your app's measures in one single place.Īdd the following to your to your Strings.xml file:Īdd the following to your Styles.xml file:Ī style resource defines the format and look for a UI. A dimension is specified with a number followed by a unit of measure. What a painful thing to do if you set the colour of this component in each individual layout!Īdd the following to your Dimens.xml file:ĭimens.xml is XML resource that carries a dimension value (with a unit of measure). Let's suppose you have to update the colour of a component in your app that is used in more than 15 layouts. The advantage of using it is that you concentrate your app's colours in one single place rather than having hexadecimal codes spread across your code. A color is a simple resource that is referenced using the value provided in the name attribute. Colors is a XML resource that carries a colour value (a hexadecimal colour). Create a style that inherits from any of the AppCompat themesĪny activity you use Design Support library views in must either use the theme Theme.AppCompat or inherit from Theme.AppCompat found in the AppCompat v7 Support library.Ĭreate the files Colors.xml, Dimens.xml and Styles.xml under the folder /Resources/values in your project.Īdd the following to your Colors.xml file:Īll of your colours should be specified in XML to ensure consistency and make design changes easy to propagate throughout the app. In your Visual Studio project, change the "Minimum Android to target" to Android 5.0 (API Level 21 - Lollipop) by right-clicking on your project in the Solution Explorer > Properties (or by clicking on your project in the Solution Explorer and pressing ALT + ENTER).ģ. See Android Support Design Library > Getting Started for more information. You can still set the Target Framework which your app is compiled against as low as Android 4.0.3 (API Level 15). Using Design Support library requires that your app have its Target Android Version (*targetSdkVersion*) set to Lollipop (5.0 - API Level 21) or higher, or you will have aapt related compile errors. Change the "Minimum Android to target" to Android 5.0 (API Level 21 - Lollipop) Refer to Xamarin Android Support Library - Design for more information. You can use either the Nuget Package Manager ( Tools > Nuget Package Manager > Manage Nuget Packages for Solution.) or install it through Package Manager Console ( Tools > Nuget Package Manager > Package Manager Console): Install Xamarin Android Support Library - Design nuget package Add a parameter named "Theme" to all of the "Activity" classes in your project and set the "Theme" value to any style that inherits from AppCompat theme,ġ.MainActivity.cs) to inherit from 7.App.AppCompatActivity class rather then Activity class Create a Styles.xml file in your project and create a style that inherits from any of the AppCompat themes (i.e.Change the "Minimum Android to target" to Android 5.0 (API Level 21 - Lollipop).Install Xamarin Android Support Library - Design nuget package.To setup Design Android Support Library in your app you need to do the following: This library includes a visual component as the input text with floating text, floating action buttons, TabLayout, and so on. Material design is a new design language introduced with Android Lollipop. The Design Support Library provides APIs to support adding material design components and patterns to your apps. Setting up Design Android Support Library (Material Design) Give it the name "SitecoreMusicApp.Droid". Video DemoĬreate a new Blank App (Android) project by clicking on File > New > Project > Templates > Visual C# > Android > Blank App (Android). ![]() ![]() Additionally, I added a Sitecore package so that you can install it in your local Sitecore instance. It's worth mentioning that this app was inspired by the article Android working with Card View and Recycler View by Ravi Tamada. You can use whichever you prefer since it is API Level 21 or superior Android emulator: 4.5" Lollipop (5.1.1) XHDPI Phone API Level 22 (Lollipop, 5.1.1) 4 GB.Microsoft Visual Studio Community 2015 Version 1.01 Update 3.Internet Information Services (IIS) 10.0.Microsoft Windows 10 Enterprise, 64-bits. ![]() The first part of this article is focused on setting up a Visual Studio 2015 solution, installing dependencies and setting up Design Android Support Library (Material Design). In this series of articles, I want to explore some resources available in Sitecore Mobile SDK and show you how to create a cool app that you can use as a model for further Sitecore-based mobile apps. ![]()
0 Comments
Leave a Reply. |