diff --git a/PhoneWordFSharp/PhoneWordFSharp.Droid/PhoneWordFSharp.Droid.fsproj b/PhoneWordFSharp/PhoneWordFSharp.Droid/PhoneWordFSharp.Droid.fsproj index 34cf4fe..90dbc34 100644 --- a/PhoneWordFSharp/PhoneWordFSharp.Droid/PhoneWordFSharp.Droid.fsproj +++ b/PhoneWordFSharp/PhoneWordFSharp.Droid/PhoneWordFSharp.Droid.fsproj @@ -5,7 +5,7 @@ Debug AnyCPU {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{F2A71F9B-5D33-465A-A702-920D77279786} - de4ae3a4-bd59-4e63-8b3b-d2f44ed80386 + {DE4AE3A4-BD59-4E63-8B3B-D2F44ED80386} Library PhoneWordFSharp.Droid Assets @@ -22,10 +22,10 @@ PhoneWordFSharp.Droid db602b22 XAP - Nexus 4 (KitKat) - API 19 + Properties\AndroidManifest.xml true - full false bin\Debug DEBUG @@ -47,6 +47,8 @@ false false true + + @@ -66,7 +68,6 @@ ..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\FormsViewGroup.dll - True @@ -78,32 +79,20 @@ ..\packages\Xamarin.Android.Support.v4.21.0.3.0\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll - True ..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Core.dll - True ..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Platform.dll - True ..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll - True ..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll - True - - - PhoneWordFSharp.Core - {c748221e-7d7d-46b1-a50d-98a8ce92c0b6} - True - - diff --git a/PhoneWordFSharp/PhoneWordFSharp.Droid/Properties/AndroidManifest.xml b/PhoneWordFSharp/PhoneWordFSharp.Droid/Properties/AndroidManifest.xml index 4fd10a8..8d0c901 100644 --- a/PhoneWordFSharp/PhoneWordFSharp.Droid/Properties/AndroidManifest.xml +++ b/PhoneWordFSharp/PhoneWordFSharp.Droid/Properties/AndroidManifest.xml @@ -1,5 +1,6 @@  - - - + + + + \ No newline at end of file diff --git a/UITestDemo/Add.cs b/UITestDemo/Add.cs new file mode 100644 index 0000000..537f8a4 --- /dev/null +++ b/UITestDemo/Add.cs @@ -0,0 +1,12 @@ +using System; + +namespace UITestDemo +{ + public static class Add + { + public static int AddItems(int a, int b) + { + return a + b; + } + } +} diff --git a/UITestDemo/App.cs b/UITestDemo/App.cs new file mode 100644 index 0000000..59b47d1 --- /dev/null +++ b/UITestDemo/App.cs @@ -0,0 +1,49 @@ +using Xamarin.Forms; +using System.Threading.Tasks; + +namespace UITestDemo +{ + public class App : Application + { + INavigation _navigation; + + new public static App Current { + get { + return (App)Application.Current; + } + } + + public App() + { + var navRoot = new NavigationPage(new MainPage() { Title = "Main Page" }); + + _navigation = navRoot.Navigation; + + MainPage = navRoot; + } + + public async Task NavigateToDetailPage() + { + var page = new DetailPage(); + + page.SetValue(NavigationPage.BackButtonTitleProperty, "Back"); + + await _navigation.PushAsync(page); + } + + protected override void OnStart() + { + // Handle when your app starts + } + + protected override void OnSleep() + { + // Handle when your app sleeps + } + + protected override void OnResume() + { + // Handle when your app resumes + } + } +} diff --git a/UITestDemo/DetailPage.xaml b/UITestDemo/DetailPage.xaml new file mode 100644 index 0000000..596d38c --- /dev/null +++ b/UITestDemo/DetailPage.xaml @@ -0,0 +1,8 @@ + + + + diff --git a/UITestDemo/DetailPage.xaml.cs b/UITestDemo/DetailPage.xaml.cs new file mode 100644 index 0000000..0b93c67 --- /dev/null +++ b/UITestDemo/DetailPage.xaml.cs @@ -0,0 +1,12 @@ +using Xamarin.Forms; + +namespace UITestDemo +{ + public partial class DetailPage : ContentPage + { + public DetailPage() + { + InitializeComponent(); + } + } +} diff --git a/UITestDemo/Droid/Assets/AboutAssets.txt b/UITestDemo/Droid/Assets/AboutAssets.txt new file mode 100644 index 0000000..a9b0638 --- /dev/null +++ b/UITestDemo/Droid/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/UITestDemo/Droid/MainActivity.cs b/UITestDemo/Droid/MainActivity.cs new file mode 100644 index 0000000..830dff3 --- /dev/null +++ b/UITestDemo/Droid/MainActivity.cs @@ -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 UITestDemo.Droid +{ + [Activity(Label = "UITestDemo.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()); + } + } +} + diff --git a/UITestDemo/Droid/Properties/AndroidManifest.xml b/UITestDemo/Droid/Properties/AndroidManifest.xml new file mode 100644 index 0000000..fea936e --- /dev/null +++ b/UITestDemo/Droid/Properties/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/UITestDemo/Droid/Properties/AssemblyInfo.cs b/UITestDemo/Droid/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4660eac --- /dev/null +++ b/UITestDemo/Droid/Properties/AssemblyInfo.cs @@ -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("UITestDemo.Droid")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("jonwood")] +[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("")] + diff --git a/UITestDemo/Droid/Resources/AboutResources.txt b/UITestDemo/Droid/Resources/AboutResources.txt new file mode 100644 index 0000000..10f52d4 --- /dev/null +++ b/UITestDemo/Droid/Resources/AboutResources.txt @@ -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. diff --git a/UITestDemo/Droid/Resources/Resource.designer.cs b/UITestDemo/Droid/Resources/Resource.designer.cs new file mode 100644 index 0000000..92a74d9 --- /dev/null +++ b/UITestDemo/Droid/Resources/Resource.designer.cs @@ -0,0 +1,82 @@ +#pragma warning disable 1591 +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 4.0.30319.17020 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +[assembly: Android.Runtime.ResourceDesignerAttribute("UITestDemo.Droid.Resource", IsApplication=true)] + +namespace UITestDemo.Droid +{ + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] + public partial class Resource + { + + static Resource() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + public static void UpdateIdValues() + { + global::Xamarin.Forms.Platform.Resource.String.ApplicationName = global::UITestDemo.Droid.Resource.String.ApplicationName; + global::Xamarin.Forms.Platform.Resource.String.Hello = global::UITestDemo.Droid.Resource.String.Hello; + } + + public partial class Attribute + { + + static Attribute() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Attribute() + { + } + } + + public partial class Drawable + { + + // aapt resource value: 0x7f020000 + public const int icon = 2130837504; + + static Drawable() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Drawable() + { + } + } + + public partial class String + { + + // aapt resource value: 0x7f030001 + public const int ApplicationName = 2130903041; + + // aapt resource value: 0x7f030000 + public const int Hello = 2130903040; + + static String() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private String() + { + } + } + } +} +#pragma warning restore 1591 diff --git a/UITestDemo/Droid/Resources/drawable-hdpi/icon.png b/UITestDemo/Droid/Resources/drawable-hdpi/icon.png new file mode 100644 index 0000000..964f110 Binary files /dev/null and b/UITestDemo/Droid/Resources/drawable-hdpi/icon.png differ diff --git a/UITestDemo/Droid/Resources/drawable-xhdpi/icon.png b/UITestDemo/Droid/Resources/drawable-xhdpi/icon.png new file mode 100644 index 0000000..3c01e60 Binary files /dev/null and b/UITestDemo/Droid/Resources/drawable-xhdpi/icon.png differ diff --git a/UITestDemo/Droid/Resources/drawable-xxhdpi/icon.png b/UITestDemo/Droid/Resources/drawable-xxhdpi/icon.png new file mode 100644 index 0000000..0d8c1c5 Binary files /dev/null and b/UITestDemo/Droid/Resources/drawable-xxhdpi/icon.png differ diff --git a/UITestDemo/Droid/Resources/drawable/icon.png b/UITestDemo/Droid/Resources/drawable/icon.png new file mode 100644 index 0000000..b0ba715 Binary files /dev/null and b/UITestDemo/Droid/Resources/drawable/icon.png differ diff --git a/UITestDemo/Droid/UITestDemo.Droid.csproj b/UITestDemo/Droid/UITestDemo.Droid.csproj new file mode 100644 index 0000000..2a91acb --- /dev/null +++ b/UITestDemo/Droid/UITestDemo.Droid.csproj @@ -0,0 +1,93 @@ + + + + Debug + AnyCPU + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {BB495BF3-D710-4C75-BD32-AC07CA6431E3} + Library + UITestDemo.Droid + Assets + Resources + Properties\AndroidManifest.xml + Resource + Resources\Resource.designer.cs + True + True + UITestDemo.Droid + v5.0 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + None + false + + + full + true + bin\Release + prompt + 4 + false + false + + + + + + + + ..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll + + + ..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\FormsViewGroup.dll + + + ..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Core.dll + + + ..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll + + + ..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Platform.dll + + + ..\packages\Xamarin.Android.Support.v4.22.2.1.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll + + + + + {CBBB0981-6DAE-4C8F-973C-12C4614F41DF} + UITestDemo + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UITestDemo/Droid/packages.config b/UITestDemo/Droid/packages.config new file mode 100644 index 0000000..401f130 --- /dev/null +++ b/UITestDemo/Droid/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/UITestDemo/MainPage.xaml b/UITestDemo/MainPage.xaml new file mode 100644 index 0000000..0bc5658 --- /dev/null +++ b/UITestDemo/MainPage.xaml @@ -0,0 +1,19 @@ + + + + +