Skip to content

Commit

Permalink
PropertyDependency Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Rome committed Oct 18, 2015
1 parent f85e959 commit 7475717
Show file tree
Hide file tree
Showing 54 changed files with 1,672 additions and 0 deletions.
19 changes: 19 additions & 0 deletions PropertyDependencyDemo/Droid/Assets/AboutAssets.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".

These files will be deployed with your package and will be accessible using Android's
AssetManager, like this:

public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

InputStream input = Assets.Open ("my_asset.txt");
}
}

Additionally, some Android functions will automatically load asset files:

Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
26 changes: 26 additions & 0 deletions PropertyDependencyDemo/Droid/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;

using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace PropertyDependencyDemo.Droid
{
[Activity (Label = "PropertyDependencyDemo.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

global::Xamarin.Forms.Forms.Init (this, bundle);

LoadApplication (new App ());
}
}
}

6 changes: 6 additions & 0 deletions PropertyDependencyDemo/Droid/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.wintellect.propertydependencydemo">
<uses-sdk android:minSdkVersion="15" />
<application android:label="PropertyDependencyDemo">
</application>
</manifest>
28 changes: 28 additions & 0 deletions PropertyDependencyDemo/Droid/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using Android.App;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle ("PropertyDependencyDemo.Droid")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("Wintellect, LLC")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("2015 Wintellect, LLC")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion ("1.0.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

93 changes: 93 additions & 0 deletions PropertyDependencyDemo/Droid/PropertyDependencyDemo.Droid.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{932823BE-C1C5-475D-A752-15EBDBAC6A63}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>PropertyDependencyDemo.Droid</RootNamespace>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidApplication>True</AndroidApplication>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AssemblyName>PropertyDependencyDemo.Droid</AssemblyName>
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Forms.Platform.Android">
<HintPath>..\packages\Xamarin.Forms.1.5.0.6447\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
</Reference>
<Reference Include="FormsViewGroup">
<HintPath>..\packages\Xamarin.Forms.1.5.0.6447\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.1.5.0.6447\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.1.5.0.6447\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.1.5.0.6447\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..\packages\Xamarin.Android.Support.v4.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PropertyDependencyDemo\PropertyDependencyDemo.csproj">
<Project>{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}</Project>
<Name>PropertyDependencyDemo</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="Assets\AboutAssets.txt" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\layout\" />
<Folder Include="Resources\values\" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\icon.png" />
<AndroidResource Include="Resources\drawable-hdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xhdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.1.5.0.6447\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.5.0.6447\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
</Project>
44 changes: 44 additions & 0 deletions PropertyDependencyDemo/Droid/Resources/AboutResources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.

For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:

Resources/
drawable/
icon.png

layout/
main.axml

values/
strings.xml

In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:

public class R {
public class drawable {
public const int icon = 0x123;
}

public class layout {
public const int main = 0x456;
}

public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}

You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
61 changes: 61 additions & 0 deletions PropertyDependencyDemo/Droid/Resources/Resource.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions PropertyDependencyDemo/Droid/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="23.0.1.3" targetFramework="MonoAndroid60" />
<package id="Xamarin.Forms" version="1.5.0.6447" targetFramework="MonoAndroid60" />
</packages>
71 changes: 71 additions & 0 deletions PropertyDependencyDemo/PropertyDependencyDemo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PropertyDependencyDemo", "PropertyDependencyDemo\PropertyDependencyDemo.csproj", "{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PropertyDependencyDemo.iOS", "iOS\PropertyDependencyDemo.iOS.csproj", "{5CB65EC5-5533-4E4A-B31C-F4320A648341}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PropertyDependencyDemo.Droid", "Droid\PropertyDependencyDemo.Droid.csproj", "{932823BE-C1C5-475D-A752-15EBDBAC6A63}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PropertyDependencyDemo.UITests", "UITests\PropertyDependencyDemo.UITests.csproj", "{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Debug|iPhone.ActiveCfg = Debug|iPhone
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Debug|iPhone.Build.0 = Debug|iPhone
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Release|Any CPU.ActiveCfg = Release|iPhone
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Release|Any CPU.Build.0 = Release|iPhone
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Release|iPhone.ActiveCfg = Release|iPhone
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Release|iPhone.Build.0 = Release|iPhone
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{5CB65EC5-5533-4E4A-B31C-F4320A648341}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Debug|iPhone.Build.0 = Debug|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Release|Any CPU.Build.0 = Release|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Release|iPhone.ActiveCfg = Release|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Release|iPhone.Build.0 = Release|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{62CB0D3F-DD9D-4CEC-A286-6BDC4B31B726}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Debug|iPhone.Build.0 = Debug|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Release|Any CPU.Build.0 = Release|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Release|iPhone.ActiveCfg = Release|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Release|iPhone.Build.0 = Release|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{932823BE-C1C5-475D-A752-15EBDBAC6A63}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Debug|iPhone.Build.0 = Debug|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Release|Any CPU.Build.0 = Release|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Release|iPhone.ActiveCfg = Release|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Release|iPhone.Build.0 = Release|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{9672DE6E-A5F8-41FF-8250-E341ABFAEBFB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Loading

0 comments on commit 7475717

Please sign in to comment.