Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit de9f023

Browse files
authored
New/updated 4.8 samples (#649)
* 4.8 code updates. * Sample updated to 4.8-pre1. * TextTransform example added. * Text transform added. * 4.8-pre2 update. * Brushes support. * Don't need to explicitly set GradientStops. * 4.8-pre3 updates. * Update to 4.8-pre3 * Update to 4.8-pre3 * New sample. * Moved file into correct folder. * Let the default values shine. * Remove AppTheme experimental flag. * Samples updated to 4.8.
1 parent ee51c22 commit de9f023

File tree

233 files changed

+4504
-177
lines changed

Some content is hidden

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

233 files changed

+4504
-177
lines changed

FormsGallery/FormsGallery/FormsGallery.Android/FormsGallery.Android.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
</PropertyGroup>
4646
<ItemGroup>
4747
<PackageReference Include="Xamarin.Forms">
48-
<Version>4.7.0.968</Version>
48+
<Version>4.8.0.1269</Version>
4949
</PackageReference>
5050
<PackageReference Include="Xamarin.Forms.Maps">
51-
<Version>4.7.0.968</Version>
51+
<Version>4.8.0.1269</Version>
5252
</PackageReference>
5353
</ItemGroup>
5454
<ItemGroup>

FormsGallery/FormsGallery/FormsGallery.UWP/FormsGallery.UWP.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
</PropertyGroup>
9191
<ItemGroup>
9292
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.0.12" />
93-
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
94-
<PackageReference Include="Xamarin.Forms.Maps" Version="4.7.0.968" />
93+
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
94+
<PackageReference Include="Xamarin.Forms.Maps" Version="4.8.0.1269" />
9595
</ItemGroup>
9696
<ItemGroup />
9797
<ItemGroup>

FormsGallery/FormsGallery/FormsGallery.iOS/FormsGallery.iOS.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@
144144
</ItemGroup>
145145
<ItemGroup>
146146
<PackageReference Include="Xamarin.Forms">
147-
<Version>4.7.0.968</Version>
147+
<Version>4.8.0.1269</Version>
148148
</PackageReference>
149149
<PackageReference Include="Xamarin.Forms.Maps">
150-
<Version>4.7.0.968</Version>
150+
<Version>4.8.0.1269</Version>
151151
</PackageReference>
152152
</ItemGroup>
153153
<Import Project="..\FormsGallery.Shared\FormsGallery.Shared.projitems" Label="Shared" />

FormsGallery/FormsGallery/FormsGallery/FormsGallery.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
</ItemGroup>
145145

146146
<ItemGroup>
147-
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
148-
<PackageReference Include="Xamarin.Forms.Maps" Version="4.7.0.968" />
147+
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
148+
<PackageReference Include="Xamarin.Forms.Maps" Version="4.8.0.1269" />
149149
</ItemGroup>
150150
</Project>

FormsGallery/FormsGallery/FormsGallery/XamlExamples/CollectionViewDemoPage.xaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
FontAttributes="Bold"
1010
HorizontalOptions="Center" />
1111

12-
<CollectionView ItemsSource="{Binding Monkeys}">
13-
<CollectionView.ItemsLayout>
14-
<GridItemsLayout Orientation="Vertical"
15-
Span="2" />
16-
</CollectionView.ItemsLayout>
12+
<CollectionView ItemsSource="{Binding Monkeys}"
13+
ItemsLayout="VerticalGrid, 2">
1714
<CollectionView.ItemTemplate>
1815
<DataTemplate>
1916
<Grid Padding="10">
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 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");
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
<ProjectGuid>{28836F43-40E2-4E0D-97C2-806387F81907}</ProjectGuid>
7+
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
8+
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>BrushesDemos.Droid</RootNamespace>
11+
<AssemblyName>BrushesDemos.Android</AssemblyName>
12+
<Deterministic>True</Deterministic>
13+
<AndroidApplication>True</AndroidApplication>
14+
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
15+
<AndroidResgenClass>Resource</AndroidResgenClass>
16+
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
17+
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
18+
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
19+
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
20+
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
21+
<AndroidUseAapt2>true</AndroidUseAapt2>
22+
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
23+
<NuGetPackageImportStamp>
24+
</NuGetPackageImportStamp>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
27+
<DebugSymbols>true</DebugSymbols>
28+
<DebugType>portable</DebugType>
29+
<Optimize>false</Optimize>
30+
<OutputPath>bin\Debug</OutputPath>
31+
<DefineConstants>DEBUG;</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<AndroidLinkMode>None</AndroidLinkMode>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
37+
<DebugSymbols>true</DebugSymbols>
38+
<DebugType>portable</DebugType>
39+
<Optimize>true</Optimize>
40+
<OutputPath>bin\Release</OutputPath>
41+
<ErrorReport>prompt</ErrorReport>
42+
<WarningLevel>4</WarningLevel>
43+
<AndroidManagedSymbols>true</AndroidManagedSymbols>
44+
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
45+
</PropertyGroup>
46+
<ItemGroup>
47+
<Reference Include="Mono.Android" />
48+
<Reference Include="System" />
49+
<Reference Include="System.Core" />
50+
<Reference Include="System.Xml.Linq" />
51+
<Reference Include="System.Xml" />
52+
<Reference Include="System.Numerics" />
53+
<Reference Include="System.Numerics.Vectors" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
57+
</ItemGroup>
58+
<ItemGroup>
59+
<Compile Include="MainActivity.cs" />
60+
<Compile Include="Resources\Resource.designer.cs" />
61+
<Compile Include="Properties\AssemblyInfo.cs" />
62+
</ItemGroup>
63+
<ItemGroup>
64+
<None Include="Resources\AboutResources.txt" />
65+
<None Include="Assets\AboutAssets.txt" />
66+
<None Include="Properties\AndroidManifest.xml" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<AndroidResource Include="Resources\layout\Tabbar.xml" />
70+
<AndroidResource Include="Resources\layout\Toolbar.xml" />
71+
<AndroidResource Include="Resources\values\styles.xml" />
72+
<AndroidResource Include="Resources\values\colors.xml" />
73+
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
74+
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
75+
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
76+
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
77+
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
78+
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
79+
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
80+
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
81+
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
82+
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
83+
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
84+
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
85+
</ItemGroup>
86+
<ItemGroup>
87+
<Folder Include="Resources\drawable\" />
88+
</ItemGroup>
89+
<ItemGroup>
90+
<ProjectReference Include="..\BrushesDemos\BrushesDemos.csproj">
91+
<Project>{E360DEF0-8933-4B8F-9A4E-301A23125604}</Project>
92+
<Name>BrushesDemos</Name>
93+
</ProjectReference>
94+
</ItemGroup>
95+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
96+
</Project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Android.App;
2+
using Android.Content.PM;
3+
using Android.OS;
4+
5+
namespace BrushesDemos.Droid
6+
{
7+
[Activity(Label = "BrushesDemos", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
8+
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
9+
{
10+
protected override void OnCreate(Bundle savedInstanceState)
11+
{
12+
TabLayoutResource = Resource.Layout.Tabbar;
13+
ToolbarResource = Resource.Layout.Toolbar;
14+
15+
base.OnCreate(savedInstanceState);
16+
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
17+
LoadApplication(new App());
18+
}
19+
}
20+
}
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" android:versionCode="1" android:versionName="1.0" package="com.companyname.brushesdemos">
3+
<uses-sdk android:minSdkVersion="21" />
4+
<application android:label="BrushesDemos.Android"></application>
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6+
</manifest>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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("BrushesDemos.Android")]
10+
[assembly: AssemblyDescription("")]
11+
[assembly: AssemblyConfiguration("")]
12+
[assembly: AssemblyCompany("")]
13+
[assembly: AssemblyProduct("BrushesDemos.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+
[assembly: AssemblyVersion("1.0.0.0")]
26+
[assembly: AssemblyFileVersion("1.0.0.0")]
27+
28+
// Add some common permissions, these can be removed if not needed
29+
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
30+
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]

0 commit comments

Comments
 (0)