Skip to content

Commit cd47279

Browse files
author
Rustam Zaitov
committed
Merge branch 'master' into 1.4.4
2 parents 077a090 + e5fafd3 commit cd47279

File tree

1,094 files changed

+31277
-1338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,094 files changed

+31277
-1338
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NuGet.CommandLine" version="2.8.2" />
4+
</packages>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Any raw assets you want to be deployed with your application can be placed in
2+
this directory (and child directories) and given a Build Action of "AndroidAsset".
3+
4+
These files will be deployed with you package and will be accessible using Android's
5+
AssetManager, like this:
6+
7+
public class ReadAsset : Activity
8+
{
9+
protected override void OnCreate (Bundle bundle)
10+
{
11+
base.OnCreate (bundle);
12+
13+
InputStream input = Assets.Open ("my_asset.txt");
14+
}
15+
}
16+
17+
Additionally, some Android functions will automatically load asset files:
18+
19+
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{F411B29D-D23F-4024-8E78-381BCA54F411}</ProjectGuid>
7+
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>HelloXamarinFormsWorld.Droid</RootNamespace>
11+
<AssemblyName>HelloXamarinFormsWorld.Android</AssemblyName>
12+
<FileAlignment>512</FileAlignment>
13+
<AndroidApplication>true</AndroidApplication>
14+
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
15+
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
16+
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
17+
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
18+
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
19+
<AndroidStoreUncompressedFileExtensions />
20+
<MandroidI18n />
21+
<JavaMaximumHeapSize>
22+
</JavaMaximumHeapSize>
23+
<JavaOptions />
24+
<NuGetPackageImportStamp>befcb92b</NuGetPackageImportStamp>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
27+
<DebugSymbols>true</DebugSymbols>
28+
<DebugType>full</DebugType>
29+
<Optimize>false</Optimize>
30+
<OutputPath>bin\Debug\</OutputPath>
31+
<DefineConstants>DEBUG;TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<AndroidLinkMode>None</AndroidLinkMode>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
37+
<DebugType>pdbonly</DebugType>
38+
<Optimize>true</Optimize>
39+
<OutputPath>bin\Release\</OutputPath>
40+
<DefineConstants>TRACE</DefineConstants>
41+
<ErrorReport>prompt</ErrorReport>
42+
<WarningLevel>4</WarningLevel>
43+
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
44+
</PropertyGroup>
45+
<ItemGroup>
46+
<Reference Include="Mono.Android" />
47+
<Reference Include="mscorlib" />
48+
<Reference Include="System" />
49+
<Reference Include="System.Core" />
50+
<Reference Include="System.Xml.Linq" />
51+
<Reference Include="System.Xml" />
52+
<Reference Include="Xamarin.Forms.Platform.Android">
53+
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
54+
</Reference>
55+
<Reference Include="FormsViewGroup">
56+
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
57+
</Reference>
58+
<Reference Include="Xamarin.Forms.Core">
59+
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
60+
</Reference>
61+
<Reference Include="Xamarin.Forms.Xaml">
62+
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
63+
</Reference>
64+
<Reference Include="Xamarin.Forms.Platform">
65+
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
66+
</Reference>
67+
<Reference Include="Xamarin.Android.Support.v4">
68+
<HintPath>..\packages\Xamarin.Android.Support.v4.22.2.0.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
69+
</Reference>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Compile Include="MainActivity.cs" />
73+
<Compile Include="Resources\Resource.Designer.cs" />
74+
<Compile Include="Properties\AssemblyInfo.cs" />
75+
</ItemGroup>
76+
<ItemGroup>
77+
<None Include="Resources\AboutResources.txt" />
78+
<None Include="Assets\AboutAssets.txt" />
79+
<None Include="packages.config" />
80+
<None Include="Properties\AndroidManifest.xml" />
81+
</ItemGroup>
82+
<ItemGroup>
83+
<AndroidResource Include="Resources\Drawable\Icon.png" />
84+
</ItemGroup>
85+
<ItemGroup>
86+
<ProjectReference Include="..\HelloXamarinFormsWorld\HelloXamarinFormsWorld.csproj">
87+
<Name>HelloXamarinFormsWorld</Name>
88+
<Project>{8F4B43AC-9BB1-4723-8B7C-A8FE4BBDF32F}</Project>
89+
</ProjectReference>
90+
</ItemGroup>
91+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
92+
<Import Project="..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
93+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
94+
Other similar extension points exist, see Microsoft.Common.targets.
95+
<Target Name="BeforeBuild">
96+
</Target>
97+
<Target Name="AfterBuild">
98+
</Target>
99+
-->
100+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Android.App;
2+
using Android.OS;
3+
4+
using Xamarin.Forms;
5+
using Xamarin.Forms.Platform.Android;
6+
7+
namespace HelloXamarinFormsWorld.Droid
8+
{
9+
[Activity(Label = "HelloXamarinFormsWorld", MainLauncher = true)]
10+
public class MainActivity : FormsApplicationActivity
11+
{
12+
protected override void OnCreate(Bundle bundle)
13+
{
14+
base.OnCreate(bundle);
15+
16+
Forms.Init(this, bundle);
17+
18+
LoadApplication (new App ());
19+
}
20+
}
21+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="21" />
4+
<application android:icon="@drawable/icon">
5+
</application>
6+
</manifest>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
using Android.App;
5+
6+
// General Information about an assembly is controlled through the following
7+
// set of attributes. Change these attribute values to modify the information
8+
// associated with an assembly.
9+
[assembly: AssemblyTitle("HelloXamarinFormsWorld.Android")]
10+
[assembly: AssemblyDescription("")]
11+
[assembly: AssemblyConfiguration("")]
12+
[assembly: AssemblyCompany("")]
13+
[assembly: AssemblyProduct("HelloXamarinFormsWorld.Android")]
14+
[assembly: AssemblyCopyright("Copyright © 2014")]
15+
[assembly: AssemblyTrademark("")]
16+
[assembly: AssemblyCulture("")]
17+
[assembly: ComVisible(false)]
18+
19+
// Version information for an assembly consists of the following four values:
20+
//
21+
// Major Version
22+
// Minor Version
23+
// Build Number
24+
// Revision
25+
//
26+
// You can specify all the values or you can default the Build and Revision Numbers
27+
// by using the '*' as shown below:
28+
// [assembly: AssemblyVersion("1.0.*")]
29+
[assembly: AssemblyVersion("1.0.0.0")]
30+
[assembly: AssemblyFileVersion("1.0.0.0")]
31+
32+
// Add some common permissions, these can be removed if not needed
33+
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
34+
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Images, layout descriptions, binary blobs and string dictionaries can be included
2+
in your application as resource files. Various Android APIs are designed to
3+
operate on the resource IDs instead of dealing with images, strings or binary blobs
4+
directly.
5+
6+
For example, a sample Android app that contains a user interface layout (main.xml),
7+
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8+
would keep its resources in the "Resources" directory of the application:
9+
10+
Resources/
11+
drawable-hdpi/
12+
icon.png
13+
14+
drawable-ldpi/
15+
icon.png
16+
17+
drawable-mdpi/
18+
icon.png
19+
20+
layout/
21+
main.xml
22+
23+
values/
24+
strings.xml
25+
26+
In order to get the build system to recognize Android resources, set the build action to
27+
"AndroidResource". The native Android APIs do not operate directly with filenames, but
28+
instead operate on resource IDs. When you compile an Android application that uses resources,
29+
the build system will package the resources for distribution and generate a class called
30+
"Resource" that contains the tokens for each one of the resources included. For example,
31+
for the above Resources layout, this is what the Resource class would expose:
32+
33+
public class Resource {
34+
public class drawable {
35+
public const int icon = 0x123;
36+
}
37+
38+
public class layout {
39+
public const int main = 0x456;
40+
}
41+
42+
public class strings {
43+
public const int first_string = 0xabc;
44+
public const int second_string = 0xbcd;
45+
}
46+
}
47+
48+
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49+
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50+
string in the dictionary file values/strings.xml.
4.05 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Xamarin.Android.Support.v4" version="22.2.0.0" targetFramework="MonoAndroid44" />
4+
<package id="Xamarin.Forms" version="1.4.3.6374" targetFramework="MonoAndroid44" />
5+
</packages>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Application
2+
x:Class="HelloXamarinFormsWorld.WinPhone.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
6+
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
7+
8+
<!--Application Resources-->
9+
<Application.Resources>
10+
<local:LocalizedStrings xmlns:local="clr-namespace:HelloXamarinFormsWorld.WinPhone" x:Key="LocalizedStrings"/>
11+
</Application.Resources>
12+
13+
<Application.ApplicationLifetimeObjects>
14+
<!--Required object that handles lifetime events for the application-->
15+
<shell:PhoneApplicationService
16+
Launching="Application_Launching" Closing="Application_Closing"
17+
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
18+
</Application.ApplicationLifetimeObjects>
19+
20+
</Application>

0 commit comments

Comments
 (0)