diff options
Diffstat (limited to 'examples/csharp/HelloworldXamarin/Droid/Resources')
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/AboutResources.txt | 44 | ||||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/Resource.designer.cs | 112 | ||||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/layout/Main.axml | 4 | ||||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-hdpi/Icon.png | bin | 0 -> 2201 bytes | |||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-mdpi/Icon.png | bin | 0 -> 1410 bytes | |||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xhdpi/Icon.png | bin | 0 -> 3237 bytes | |||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxhdpi/Icon.png | bin | 0 -> 5414 bytes | |||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxxhdpi/Icon.png | bin | 0 -> 7825 bytes | |||
-rw-r--r-- | examples/csharp/HelloworldXamarin/Droid/Resources/values/Strings.xml | 5 |
9 files changed, 165 insertions, 0 deletions
diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/AboutResources.txt b/examples/csharp/HelloworldXamarin/Droid/Resources/AboutResources.txt new file mode 100644 index 0000000000..10f52d4602 --- /dev/null +++ b/examples/csharp/HelloworldXamarin/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/examples/csharp/HelloworldXamarin/Droid/Resources/Resource.designer.cs b/examples/csharp/HelloworldXamarin/Droid/Resources/Resource.designer.cs new file mode 100644 index 0000000000..0b8a27d3dd --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/Resource.designer.cs @@ -0,0 +1,112 @@ +#pragma warning disable 1591 +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +[assembly: global::Android.Runtime.ResourceDesignerAttribute("HelloworldXamarin.Droid.Resource", IsApplication=true)] + +namespace HelloworldXamarin.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() + { + } + + public partial class Attribute + { + + static Attribute() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Attribute() + { + } + } + + public partial class Id + { + + // aapt resource value: 0x7f050000 + public const int myButton = 2131034112; + + static Id() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Id() + { + } + } + + public partial class Layout + { + + // aapt resource value: 0x7f030000 + public const int Main = 2130903040; + + static Layout() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Layout() + { + } + } + + public partial class Mipmap + { + + // aapt resource value: 0x7f020000 + public const int Icon = 2130837504; + + static Mipmap() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Mipmap() + { + } + } + + public partial class String + { + + // aapt resource value: 0x7f040001 + public const int app_name = 2130968577; + + // aapt resource value: 0x7f040000 + public const int hello = 2130968576; + + static String() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private String() + { + } + } + } +} +#pragma warning restore 1591 diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/layout/Main.axml b/examples/csharp/HelloworldXamarin/Droid/Resources/layout/Main.axml new file mode 100644 index 0000000000..8cb72282b9 --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/layout/Main.axml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> + <Button android:id="@+id/myButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/hello" /> +</LinearLayout> diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-hdpi/Icon.png b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-hdpi/Icon.png Binary files differnew file mode 100644 index 0000000000..f4c804644c --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-hdpi/Icon.png diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-mdpi/Icon.png b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-mdpi/Icon.png Binary files differnew file mode 100644 index 0000000000..ef1e1ee7dc --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-mdpi/Icon.png diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xhdpi/Icon.png b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xhdpi/Icon.png Binary files differnew file mode 100644 index 0000000000..b7e2e57aa9 --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xhdpi/Icon.png diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxhdpi/Icon.png b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxhdpi/Icon.png Binary files differnew file mode 100644 index 0000000000..8d20a38d17 --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxhdpi/Icon.png diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxxhdpi/Icon.png b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxxhdpi/Icon.png Binary files differnew file mode 100644 index 0000000000..6d9919c41a --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/mipmap-xxxhdpi/Icon.png diff --git a/examples/csharp/HelloworldXamarin/Droid/Resources/values/Strings.xml b/examples/csharp/HelloworldXamarin/Droid/Resources/values/Strings.xml new file mode 100644 index 0000000000..0a47c047e2 --- /dev/null +++ b/examples/csharp/HelloworldXamarin/Droid/Resources/values/Strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="hello">Hello World, Click Me!</string> + <string name="app_name">HelloworldXamarin.Droid</string> +</resources> |