Skip to content

Commit

Permalink
chore: update to latest forms/visual
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavisau committed May 5, 2019
1 parent 71c01c4 commit 39b0518
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.0.0.293082-pre8" />
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.0.0.293082-pre8</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.0.0.394984-pre10" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.394984-pre10" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,8 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.0.0.293082-pre8" />
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.0.0.293082-pre8</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.0.0.394984-pre10" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.394984-pre10" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions VisualChallenge/VisualChallenge/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
</ShellSection>

<ShellSection Title="TRIPS" Icon="ic_trip.png">
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
</ShellSection>

<ShellSection Title="BOOK" Icon="ic_plane.png">
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
</ShellSection>

<ShellSection Title="DEALS" Icon="ic_offer.png">
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
</ShellSection>

<ShellSection Title="MY QFF" Icon="ic_person_black_24dp.png">
<ShellContent ContentTemplate="{DataTemplate local:VisualChallengePage}"/>
<ShellContent ContentTemplate="{DataTemplate ContentPage}"/>
</ShellSection>

</ShellItem>
Expand Down
4 changes: 2 additions & 2 deletions VisualChallenge/VisualChallenge/VisualChallenge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.0.1.206893" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.1.206893" />
<PackageReference Include="Xamarin.Forms" Version="4.0.0.394984-pre10" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.0.394984-pre10" />
</ItemGroup>

<ItemGroup>
Expand Down
24 changes: 11 additions & 13 deletions VisualChallenge/VisualChallenge/VisualChallengePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,26 @@ public class VisualChallengePage : ContentPage
? "Ciutadella-Md"
: "ciutadella_medium.ttf#Regular";

protected override void OnAppearing()
{
base.OnAppearing();

Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
}

public VisualChallengePage()
{
On<iOS>().SetUseSafeArea(false);

TranslationY = Offset;
BackgroundColor = QantasLightGray;
Visual = VisualMarker.Material;
TranslationY = -1;


On<iOS>().SetUseSafeArea(false);
Shell.SetNavBarIsVisible(this, false);

Content = GetContent();
}

private View GetContent() =>
new Xamarin.Forms.ScrollView
{
Margin = 0,
Margin = new Thickness(0, Inset, 0, Inset),
Content =
new StackLayout
new StackLayout
{
Margin = new Thickness(0, Inset, 0, 0),
Children =
{
HeaderView(),
Expand Down Expand Up @@ -346,5 +341,8 @@ public View TripInteractionCell(string icon, string text) =>
}
}
};

public int Inset => Device.RuntimePlatform == Device.iOS ? -24 : -12;
public int Offset => Device.RuntimePlatform == Device.iOS ? -20 : 0;
}
}

0 comments on commit 39b0518

Please sign in to comment.