Skip to content

Commit 39b0518

Browse files
committed
chore: update to latest forms/visual
1 parent 71c01c4 commit 39b0518

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

VisualChallenge/VisualChallenge.Android/VisualChallenge.Android.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@
4848
<Reference Include="System.Xml" />
4949
</ItemGroup>
5050
<ItemGroup>
51-
<PackageReference Include="Xamarin.Forms" Version="4.0.0.293082-pre8" />
52-
<PackageReference Include="Xamarin.Forms.Visual.Material">
53-
<Version>4.0.0.293082-pre8</Version>
54-
</PackageReference>
51+
<PackageReference Include="Xamarin.Forms" Version="4.0.0.394984-pre10" />
52+
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.394984-pre10" />
5553
</ItemGroup>
5654
<ItemGroup>
5755
<Compile Include="MainActivity.cs" />

VisualChallenge/VisualChallenge.iOS/VisualChallenge.iOS.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,8 @@
180180
<Reference Include="Xamarin.iOS" />
181181
</ItemGroup>
182182
<ItemGroup>
183-
<PackageReference Include="Xamarin.Forms" Version="4.0.0.293082-pre8" />
184-
<PackageReference Include="Xamarin.Forms.Visual.Material">
185-
<Version>4.0.0.293082-pre8</Version>
186-
</PackageReference>
183+
<PackageReference Include="Xamarin.Forms" Version="4.0.0.394984-pre10" />
184+
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.394984-pre10" />
187185
</ItemGroup>
188186
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
189187
<ItemGroup>

VisualChallenge/VisualChallenge/AppShell.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@
4141
</ShellSection>
4242

4343
<ShellSection Title="TRIPS" Icon="ic_trip.png">
44-
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
44+
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
4545
</ShellSection>
4646

4747
<ShellSection Title="BOOK" Icon="ic_plane.png">
48-
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
48+
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
4949
</ShellSection>
5050

5151
<ShellSection Title="DEALS" Icon="ic_offer.png">
52-
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
52+
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
5353
</ShellSection>
5454

5555
<ShellSection Title="MY QFF" Icon="ic_person_black_24dp.png">
56-
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
56+
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
5757
</ShellSection>
5858

5959
</ShellItem>

VisualChallenge/VisualChallenge/VisualChallenge.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Xamarin.Forms" Version="4.0.1.206893" />
15-
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.1.206893" />
14+
<PackageReference Include="Xamarin.Forms" Version="4.0.0.394984-pre10" />
15+
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.394984-pre10" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

VisualChallenge/VisualChallenge/VisualChallengePage.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,26 @@ public class VisualChallengePage : ContentPage
1818
? "Ciutadella-Md"
1919
: "ciutadella_medium.ttf#Regular";
2020

21-
protected override void OnAppearing()
22-
{
23-
base.OnAppearing();
24-
25-
Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
26-
}
27-
2821
public VisualChallengePage()
2922
{
30-
On<iOS>().SetUseSafeArea(false);
31-
23+
TranslationY = Offset;
3224
BackgroundColor = QantasLightGray;
3325
Visual = VisualMarker.Material;
34-
TranslationY = -1;
35-
26+
27+
On<iOS>().SetUseSafeArea(false);
28+
Shell.SetNavBarIsVisible(this, false);
29+
3630
Content = GetContent();
3731
}
3832

3933
private View GetContent() =>
4034
new Xamarin.Forms.ScrollView
4135
{
42-
Margin = 0,
36+
Margin = new Thickness(0, Inset, 0, Inset),
4337
Content =
44-
new StackLayout
38+
new StackLayout
4539
{
40+
Margin = new Thickness(0, Inset, 0, 0),
4641
Children =
4742
{
4843
HeaderView(),
@@ -346,5 +341,8 @@ public View TripInteractionCell(string icon, string text) =>
346341
}
347342
}
348343
};
344+
345+
public int Inset => Device.RuntimePlatform == Device.iOS ? -24 : -12;
346+
public int Offset => Device.RuntimePlatform == Device.iOS ? -20 : 0;
349347
}
350348
}

0 commit comments

Comments
 (0)