Skip to content

Commit

Permalink
N-04 ValueConverters to 158,WP8,iOS7,3.1.1.-beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
kstreet committed Jan 4, 2014
1 parent caada32 commit 0f7e714
Show file tree
Hide file tree
Showing 153 changed files with 1,378 additions and 259 deletions.
13 changes: 8 additions & 5 deletions N-04-ValueConverters/Value.Core/Value.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<RootNamespace>Value.Core</RootNamespace>
<AssemblyName>Value.Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile104</TargetFrameworkProfile>
<TargetFrameworkProfile>Profile158</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
Expand Down Expand Up @@ -40,19 +40,22 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\FirstViewModel.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="Cirrious.CrossCore">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\portable-win+net45+MonoAndroid16+MonoTouch40+sl40+wp71\Cirrious.CrossCore.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.1.1-beta2\lib\portable-win+net45+sl50+wp8+MonoAndroid+MonoTouch\Cirrious.CrossCore.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross">
<HintPath>..\packages\MvvmCross.HotTuna.StarterPack.3.0.4\lib\portable-win+net45+MonoAndroid16+MonoTouch40+sl40+wp71\Cirrious.MvvmCross.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1-beta2\lib\portable-win+net45+sl50+wp8+MonoAndroid+MonoTouch\Cirrious.MvvmCross.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Localization">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\portable-win+net45+MonoAndroid16+MonoTouch40+sl40+wp71\Cirrious.MvvmCross.Localization.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.1.1-beta2\lib\portable-win+net45+sl50+wp8+MonoAndroid+MonoTouch\Cirrious.MvvmCross.Localization.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<Content Include="ToDo-MvvmCross\_ Core.txt" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
6 changes: 4 additions & 2 deletions N-04-ValueConverters/Value.Core/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MvvmCross.HotTuna.CrossCore" version="3.0.4" targetFramework="portable-win+net45+MonoAndroid16+MonoTouch40+sl40+wp71" />
<package id="MvvmCross.HotTuna.StarterPack" version="3.0.4" targetFramework="portable-win+net45+MonoAndroid16+MonoTouch40+sl40+wp71" />
<package id="MvvmCross.HotTuna.CrossCore" version="3.1.1-beta2" targetFramework="portable-win+net45+sl50+wp80+MonoAndroid10+MonoTouch10" />
<package id="MvvmCross.HotTuna.MvvmCrossLibraries" version="3.1.1-beta2" targetFramework="portable-win+net45+sl50+wp80+MonoAndroid10+MonoTouch10" />
<package id="MvvmCross.HotTuna.StarterPack" version="3.1.1-beta2" targetFramework="portable-win+net45+sl50+wp80+MonoAndroid10+MonoTouch10" />
<package id="MvvmCross.PortableSupport" version="3.1.1-beta2" targetFramework="portable-win+net45+sl50+wp80+MonoAndroid10+MonoTouch10" />
</packages>
31 changes: 31 additions & 0 deletions N-04-ValueConverters/Value.Droid/DebugTrace.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Diagnostics;
using Cirrious.CrossCore.Platform;

namespace Value.Droid
{
public class DebugTrace : IMvxTrace
{
public void Trace(MvxTraceLevel level, string tag, Func<string> message)
{
Debug.WriteLine(tag + ":" + level + ":" + message());
}

public void Trace(MvxTraceLevel level, string tag, string message)
{
Debug.WriteLine(tag + ":" + level + ":" + message);
}

public void Trace(MvxTraceLevel level, string tag, string message, params object[] args)
{
try
{
Debug.WriteLine(string.Format(tag + ":" + level + ":" + message, args));
}
catch (FormatException)
{
Trace(MvxTraceLevel.Error, tag, "Exception during trace of {0} {1} {2}", level, message);
}
}
}
}
53 changes: 53 additions & 0 deletions N-04-ValueConverters/Value.Droid/LinkerPleaseInclude.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Collections.Specialized;
using System.Windows.Input;
using Android.Views;
using Android.Widget;

namespace Value.Droid
{
// This class is never actually executed, but when Xamarin linking is enabled it does how to ensure types and properties
// are preserved in the deployed app
public class LinkerPleaseInclude
{
public void Include(Button button)
{
button.Click += (s,e) => button.Text = button.Text + "";
}

public void Include(CheckBox checkBox)
{
checkBox.CheckedChange += (sender, args) => checkBox.Checked = !checkBox.Checked;
}

public void Include(View view)
{
view.Click += (s, e) => view.ContentDescription = view.ContentDescription + "";
}

public void Include(TextView text)
{
text.TextChanged += (sender, args) => text.Text = "" + text.Text;
text.Hint = "" + text.Hint;
}

public void Include(CompoundButton cb)
{
cb.CheckedChange += (sender, args) => cb.Checked = !cb.Checked;
}

public void Include(SeekBar sb)
{
sb.ProgressChanged += (sender, args) => sb.Progress = sb.Progress + 1;
}

public void Include(INotifyCollectionChanged changed)
{
changed.CollectionChanged += (s,e) => { var test = string.Format("{0}{1}{2}{3}{4}", e.Action,e.NewItems, e.NewStartingIndex, e.OldItems, e.OldStartingIndex); } ;
}

public void Include(ICommand command)
{
command.CanExecuteChanged += (s, e) => { if (command.CanExecute(null)) command.Execute(null); };
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
<application></application>
</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 30 additions & 5 deletions N-04-ValueConverters/Value.Droid/Resources/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
<declare-styleable name="MvxImageView">
<attr name="MvxSource" format="string"/>
</declare-styleable>
</resources>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Splash" parent="android:Theme">
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ The steps to get this Android UI working are:
3. Add the MvxBindingAttributes file - make sure it's type is set to 'AndroidResource'
4. Add a splashscreen - both cs file and the axml to the Resources folder
- also remove any other `MainLauncher` activities - eg Activity1
5. Add a views folder and a FirstView view - also add FirstView.axml to the resources folder
6. Be sure to change the 'local:' namespace in the axml file - which may also require adding an AndroidManifest.xml file
5. Add a views folder and a FirstView view - also add FirstView.axml to the resources folder
36 changes: 24 additions & 12 deletions N-04-ValueConverters/Value.Droid/Value.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<AndroidApplication>true</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -39,41 +40,48 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Cirrious.CrossCore">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\MonoAndroid16\Cirrious.CrossCore.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.1.1-beta2\lib\MonoAndroid\Cirrious.CrossCore.dll</HintPath>
</Reference>
<Reference Include="Cirrious.CrossCore.Droid">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\MonoAndroid16\Cirrious.CrossCore.Droid.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.1.1-beta2\lib\MonoAndroid\Cirrious.CrossCore.Droid.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross">
<HintPath>..\packages\MvvmCross.HotTuna.StarterPack.3.0.4\lib\MonoAndroid16\Cirrious.MvvmCross.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1-beta2\lib\MonoAndroid\Cirrious.MvvmCross.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Binding">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\MonoAndroid16\Cirrious.MvvmCross.Binding.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.1.1-beta2\lib\MonoAndroid\Cirrious.MvvmCross.Binding.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Binding.Droid">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\MonoAndroid16\Cirrious.MvvmCross.Binding.Droid.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.1.1-beta2\lib\MonoAndroid\Cirrious.MvvmCross.Binding.Droid.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Droid">
<HintPath>..\packages\MvvmCross.HotTuna.StarterPack.3.0.4\lib\MonoAndroid16\Cirrious.MvvmCross.Droid.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1-beta2\lib\MonoAndroid\Cirrious.MvvmCross.Droid.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Localization">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\MonoAndroid16\Cirrious.MvvmCross.Localization.dll</HintPath>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.1.1-beta2\lib\MonoAndroid\Cirrious.MvvmCross.Localization.dll</HintPath>
</Reference>
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\MonoAndroid16\System.Net.dll</HintPath>
<Reference Include="System.Net">
<Private>True</Private>
<HintPath>..\packages\MvvmCross.PortableSupport.3.1.1-beta2\lib\MonoAndroid\System.Net.dll</HintPath>
</Reference>
<Reference Include="System.Windows">
<HintPath>..\packages\MvvmCross.HotTuna.CrossCore.3.0.4\lib\MonoAndroid16\System.Windows.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\MvvmCross.PortableSupport.3.1.1-beta2\lib\MonoAndroid\System.Windows.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Serialization">
<Private>True</Private>
<HintPath>..\packages\MvvmCross.PortableSupport.3.1.1-beta2\lib\MonoAndroid\System.Xml.Serialization.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="DebugTrace.cs" />
<Compile Include="LinkerPleaseInclude.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setup.cs" />
Expand All @@ -84,10 +92,10 @@
<None Include="packages.config" />
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<AndroidResource Include="Resources\Layout\SplashScreen.axml" />
<AndroidResource Include="Resources\Layout\FirstView.axml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\Layout\SplashScreen.axml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Layout\Main.axml" />
Expand All @@ -105,7 +113,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Properties\AndroidManifest.xml" />
<AndroidResource Include="Resources\Values\SplashStyle.xml" />
<AndroidResource Include="Resources\Values\MvxBindingAttributes.xml" />
<AndroidResource Include="Resources\Drawable\splash.png" />
<Content Include="ToDo-MvvmCross\_ Droid UI.txt" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
6 changes: 4 additions & 2 deletions N-04-ValueConverters/Value.Droid/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MvvmCross.HotTuna.CrossCore" version="3.0.4" targetFramework="MonoAndroid22" />
<package id="MvvmCross.HotTuna.StarterPack" version="3.0.4" targetFramework="MonoAndroid22" />
<package id="MvvmCross.HotTuna.CrossCore" version="3.1.1-beta2" targetFramework="MonoAndroid22" />
<package id="MvvmCross.HotTuna.MvvmCrossLibraries" version="3.1.1-beta2" targetFramework="MonoAndroid22" />
<package id="MvvmCross.HotTuna.StarterPack" version="3.1.1-beta2" targetFramework="MonoAndroid22" />
<package id="MvvmCross.PortableSupport" version="3.1.1-beta2" targetFramework="MonoAndroid22" />
</packages>
31 changes: 31 additions & 0 deletions N-04-ValueConverters/Value.Phone/DebugTrace.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Diagnostics;
using Cirrious.CrossCore.Platform;

namespace Value.Phone
{
public class DebugTrace : IMvxTrace
{
public void Trace(MvxTraceLevel level, string tag, Func<string> message)
{
Debug.WriteLine(tag + ":" + level + ":" + message());
}

public void Trace(MvxTraceLevel level, string tag, string message)
{
Debug.WriteLine(tag + ":" + level + ":" + message);
}

public void Trace(MvxTraceLevel level, string tag, string message, params object[] args)
{
try
{
Debug.WriteLine(string.Format(tag + ":" + level + ":" + message, args));
}
catch (FormatException)
{
Trace(MvxTraceLevel.Error, tag, "Exception during trace of {0} {1} {2}", level, message);
}
}
}
}
Loading

0 comments on commit 0f7e714

Please sign in to comment.