Skip to content

Commit 1cbe67c

Browse files
committed
Putting on LoginRecipe... not done
1 parent eafcc44 commit 1cbe67c

Some content is hidden

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

53 files changed

+44195
-8
lines changed
+19
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 your 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");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
7+
<ProjectGuid>{015EB7E7-078A-4C42-A4A5-75A6C0862F2E}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<RootNamespace>LoginRecipe.Android</RootNamespace>
10+
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
11+
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
12+
<AndroidResgenClass>Resource</AndroidResgenClass>
13+
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
14+
<AndroidApplication>True</AndroidApplication>
15+
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
16+
<AssemblyName>LoginRecipe.Android</AssemblyName>
17+
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
18+
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21+
<DebugSymbols>true</DebugSymbols>
22+
<DebugType>full</DebugType>
23+
<Optimize>false</Optimize>
24+
<OutputPath>bin\Debug</OutputPath>
25+
<DefineConstants>DEBUG;</DefineConstants>
26+
<ErrorReport>prompt</ErrorReport>
27+
<WarningLevel>4</WarningLevel>
28+
<AndroidLinkMode>None</AndroidLinkMode>
29+
<ConsolePause>false</ConsolePause>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32+
<DebugType>full</DebugType>
33+
<Optimize>true</Optimize>
34+
<OutputPath>bin\Release</OutputPath>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
38+
<ConsolePause>false</ConsolePause>
39+
</PropertyGroup>
40+
<ItemGroup>
41+
<Reference Include="System" />
42+
<Reference Include="System.Xml" />
43+
<Reference Include="System.Core" />
44+
<Reference Include="Mono.Android" />
45+
<Reference Include="Xamarin.Forms.Platform.Android">
46+
<HintPath>..\packages\Xamarin.Forms.1.2.2.6243\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
47+
</Reference>
48+
<Reference Include="Xamarin.Forms.Core">
49+
<HintPath>..\packages\Xamarin.Forms.1.2.2.6243\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
50+
</Reference>
51+
<Reference Include="Xamarin.Forms.Xaml">
52+
<HintPath>..\packages\Xamarin.Forms.1.2.2.6243\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
53+
</Reference>
54+
<Reference Include="Xamarin.Android.Support.v4">
55+
<HintPath>..\packages\Xamarin.Android.Support.v4.20.0.0.3\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll</HintPath>
56+
</Reference>
57+
</ItemGroup>
58+
<ItemGroup>
59+
<ProjectReference Include="..\LoginRecipe\LoginRecipe.csproj">
60+
<Project>{6505FDF9-5F93-4540-9C80-5F4D875F1238}</Project>
61+
<Name>LoginRecipe</Name>
62+
</ProjectReference>
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="MainActivity.cs" />
66+
<Compile Include="Resources\Resource.designer.cs" />
67+
<Compile Include="Properties\AssemblyInfo.cs" />
68+
</ItemGroup>
69+
<ItemGroup>
70+
<None Include="Resources\AboutResources.txt" />
71+
<None Include="Assets\AboutAssets.txt" />
72+
<None Include="Properties\AndroidManifest.xml" />
73+
<None Include="packages.config" />
74+
</ItemGroup>
75+
<ItemGroup>
76+
<AndroidResource Include="Resources\layout\Main.axml" />
77+
<AndroidResource Include="Resources\values\Strings.xml" />
78+
<AndroidResource Include="Resources\drawable\Icon.png" />
79+
</ItemGroup>
80+
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
81+
<Import Project="..\packages\Xamarin.Forms.1.2.2.6243\build\portable-win+net45+wp80+MonoAndroid10+MonoTouch10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.2.2.6243\build\portable-win+net45+wp80+MonoAndroid10+MonoTouch10\Xamarin.Forms.targets')" />
82+
</Project>

LoginRecipe/Android/MainActivity.cs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System;
2+
3+
using Android.App;
4+
using Android.Content;
5+
using Android.Content.PM;
6+
using Android.Runtime;
7+
using Android.Views;
8+
using Android.Widget;
9+
using Android.OS;
10+
11+
using Xamarin.Forms.Platform.Android;
12+
13+
14+
namespace LoginRecipe.Android
15+
{
16+
[Activity (Label = "LoginPattern.Android.Android", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
17+
public class MainActivity : AndroidActivity, ILoginManager
18+
{
19+
protected override void OnCreate (Bundle bundle)
20+
{
21+
base.OnCreate (bundle);
22+
23+
Xamarin.Forms.Forms.Init (this, bundle);
24+
25+
SetPage (App.GetSplashPage (this));
26+
}
27+
28+
29+
#region ILoginManager implementation
30+
31+
public void ShowMainPage ()
32+
{
33+
SetPage (App.GetMainPage ());
34+
}
35+
36+
public void Logout()
37+
{
38+
SetPage (App.GetLoginPage (this));
39+
}
40+
41+
public void ShowLoginPage()
42+
{
43+
SetPage (App.GetLoginPage(this));
44+
}
45+
46+
#endregion
47+
}
48+
49+
50+
51+
}
52+
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" android:versionCode="1" android:versionName="1.0" package="LoginRecipe.Android">
3+
<uses-sdk />
4+
<application android:label="LoginRecipe.Android">
5+
</application>
6+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using Android.App;
4+
5+
// Information about this assembly is defined by the following attributes.
6+
// Change them to the values specific to your project.
7+
8+
[assembly: AssemblyTitle ("LoginRecipe.Android")]
9+
[assembly: AssemblyDescription ("")]
10+
[assembly: AssemblyConfiguration ("")]
11+
[assembly: AssemblyCompany ("Xamarin Inc")]
12+
[assembly: AssemblyProduct ("")]
13+
[assembly: AssemblyCopyright ("Admin")]
14+
[assembly: AssemblyTrademark ("")]
15+
[assembly: AssemblyCulture ("")]
16+
17+
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18+
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
19+
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
20+
21+
[assembly: AssemblyVersion ("1.0.0")]
22+
23+
// The following attributes are used to specify the signing key for the assembly,
24+
// if desired. See the Mono documentation for more information about signing.
25+
26+
//[assembly: AssemblyDelaySign(false)]
27+
//[assembly: AssemblyKeyFile("")]
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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.axml),
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/
12+
icon.png
13+
14+
layout/
15+
main.axml
16+
17+
values/
18+
strings.xml
19+
20+
In order to get the build system to recognize Android resources, set the build action to
21+
"AndroidResource". The native Android APIs do not operate directly with filenames, but
22+
instead operate on resource IDs. When you compile an Android application that uses resources,
23+
the build system will package the resources for distribution and generate a class called "R"
24+
(this is an Android convention) that contains the tokens for each one of the resources
25+
included. For example, for the above Resources layout, this is what the R class would expose:
26+
27+
public class R {
28+
public class drawable {
29+
public const int icon = 0x123;
30+
}
31+
32+
public class layout {
33+
public const int main = 0x456;
34+
}
35+
36+
public class strings {
37+
public const int first_string = 0xabc;
38+
public const int second_string = 0xbcd;
39+
}
40+
}
41+
42+
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43+
to reference the layout/main.axml file, or R.strings.first_string to reference the first
44+
string in the dictionary file values/strings.xml.

LoginRecipe/Android/Resources/Resource.designer.cs

+112
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
2.51 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="fill_parent"
5+
android:layout_height="fill_parent"
6+
>
7+
<Button
8+
android:id="@+id/myButton"
9+
android:layout_width="fill_parent"
10+
android:layout_height="wrap_content"
11+
android:text="@string/hello"
12+
/>
13+
</LinearLayout>
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="hello">Hello World, Click Me!</string>
4+
<string name="app_name">LoginRecipe.Android.Android</string>
5+
</resources>

LoginRecipe/Android/packages.config

+5
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="20.0.0.3" targetFramework="MonoAndroid403" />
4+
<package id="Xamarin.Forms" version="1.2.2.6243" targetFramework="MonoAndroid403" />
5+
</packages>

0 commit comments

Comments
 (0)