diff --git a/src/Xamarin.Android.DesignerTest/DesignerTest.sln b/src/Xamarin.Android.DesignerTest/DesignerTest.sln new file mode 100644 index 0000000..fe81d4e --- /dev/null +++ b/src/Xamarin.Android.DesignerTest/DesignerTest.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "DesignerTest", "DesignerTest\DesignerTest.fsproj", "{444D009C-7FF9-41A9-B92E-697A001F85C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs_test", "cs_test\cs_test.csproj", "{22BC1B43-F146-466A-8116-9972A2420EC4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {444D009C-7FF9-41A9-B92E-697A001F85C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {444D009C-7FF9-41A9-B92E-697A001F85C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {444D009C-7FF9-41A9-B92E-697A001F85C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {444D009C-7FF9-41A9-B92E-697A001F85C4}.Release|Any CPU.Build.0 = Release|Any CPU + {22BC1B43-F146-466A-8116-9972A2420EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22BC1B43-F146-466A-8116-9972A2420EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22BC1B43-F146-466A-8116-9972A2420EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22BC1B43-F146-466A-8116-9972A2420EC4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/Xamarin.Android.DesignerTest/DesignerTest/Assets/AboutAssets.txt b/src/Xamarin.Android.DesignerTest/DesignerTest/Assets/AboutAssets.txt new file mode 100644 index 0000000..a9b0638 --- /dev/null +++ b/src/Xamarin.Android.DesignerTest/DesignerTest/Assets/AboutAssets.txt @@ -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"); diff --git a/src/Xamarin.Android.DesignerTest/DesignerTest/DesignerTest.fsproj b/src/Xamarin.Android.DesignerTest/DesignerTest/DesignerTest.fsproj new file mode 100644 index 0000000..942588c --- /dev/null +++ b/src/Xamarin.Android.DesignerTest/DesignerTest/DesignerTest.fsproj @@ -0,0 +1,80 @@ + + + + Debug + AnyCPU + {444D009C-7FF9-41A9-B92E-697A001F85C4} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{F2A71F9B-5D33-465A-A702-920D77279786} + Library + DesignerTest + DesignerTest + v6.0 + True + Resources\Resource.designer.fs + Resource + Properties\AndroidManifest.xml + Resources + Assets + true + + + true + full + false + bin\Debug + DEBUG + prompt + false + None + + + + true + bin\Release + + prompt + false + false + true + + + + + + + + + + + + + ..\..\..\..\..\..\Library\Frameworks\Xamarin.Android.framework\Versions\6.1.99-76\lib\xbuild-frameworks\MonoAndroid\v1.0\Facades\System.Runtime.dll + + + ..\..\bin\Debug\Xamarin.Android.UIProvider.Runtime.dll + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.DesignerTest/DesignerTest/MainActivity.fs b/src/Xamarin.Android.DesignerTest/DesignerTest/MainActivity.fs new file mode 100644 index 0000000..df3d572 --- /dev/null +++ b/src/Xamarin.Android.DesignerTest/DesignerTest/MainActivity.fs @@ -0,0 +1,49 @@ +namespace DesignerTest + +open System + +open Android.App +open Android.Content +open Android.OS +open Android.Runtime +open Android.Views +open Android.Widget +open Xamarin.Android.UIProvider.Runtime + +//type container1 = Xamarin.Android.FragmentUI<"Test.axml"> +type container2 = Xamarin.Android.ViewUI<"Test.axml"> +//type container3 = Xamarin.Android.ActivityUI<"Test.axml"> + +type MyView = + inherit container2 + //new() as x = { inherit container2()} then x.Initialise() + new(context) as x = + { inherit container2(context) } then x.Initialise() + new(context:Context, attr:Android.Util.IAttributeSet) as x = + { inherit container2(context, attr) } then x.Initialise() + + member x.Initialise() = + let space1 = x.space1 + let tableLayout1 = x.tableLayout1 + tableLayout1.SetBackgroundColor Android.Graphics.Color.Tomato + +[] +type MainActivity () = + inherit Activity () + + let mutable count:int = 1 + + override this.OnCreate (bundle) = + + base.OnCreate (bundle) + + // Set our view from the "main" layout resource + this.SetContentView (Resource_Layout.Main) + + // Get our button from the layout resource, and attach an event to it + let button = this.FindViewById