Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion VisualChallenge/VisualChallenge.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Android.Views;
using Android.Widget;
using Android.OS;
using SegmentedControl.FormsPlugin.Android;

namespace VisualChallenge.Droid
{
Expand All @@ -24,7 +25,8 @@ protected override void OnCreate(Bundle savedInstanceState)
global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
global::Xamarin.Forms.FormsMaterial.Init(this, savedInstanceState);
LoadApplication(new App());
SegmentedControlRenderer.Init();
LoadApplication(new App());
}
}
}
2,824 changes: 2,478 additions & 346 deletions VisualChallenge/VisualChallenge.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.0.1.206893</Version>
</PackageReference>
<PackageReference Include="SegmentedControl.FormsPlugin">
<Version>2.0.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down Expand Up @@ -85,6 +88,11 @@
<AndroidResource Include="Resources\drawable-xhdpi\xamagon_preview.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\xamagon_preview.png" />
<AndroidResource Include="Resources\drawable-xxxhdpi\xamagon_preview.png" />
<AndroidResource Include="Resources\drawable\ic_map.png" />
<AndroidResource Include="Resources\drawable\ic_dates.png" />
<AndroidResource Include="Resources\drawable\ic_nonstop.png" />
<AndroidResource Include="Resources\drawable\ic_person.png" />
<AndroidResource Include="Resources\drawable\ic_class.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions VisualChallenge/VisualChallenge.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;

using Foundation;
using SegmentedControl.FormsPlugin.iOS;
using UIKit;

namespace VisualChallenge.iOS
Expand All @@ -25,6 +26,7 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options)
global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init();
global::Xamarin.Forms.FormsMaterial.Init();
SegmentedControlRenderer.Init();
LoadApplication(new App());

return base.FinishedLaunching(app, options);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@
<BundleResource Include="Resources\xamarin_logo%402x.png" />
<BundleResource Include="Resources\xamarin_logo%403x.png" />
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
<BundleResource Include="Resources\ic_map.png" />
<BundleResource Include="Resources\ic_dates.png" />
<BundleResource Include="Resources\ic_nonstop.png" />
<BundleResource Include="Resources\ic_person.png" />
<BundleResource Include="Resources\ic_class.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -136,6 +141,9 @@
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.0.1.206893</Version>
</PackageReference>
<PackageReference Include="SegmentedControl.FormsPlugin">
<Version>2.0.1</Version>
</PackageReference>
</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 @@ -16,17 +16,17 @@
-->
<Shell.Resources>
<ResourceDictionary>
<Color x:Key="NavigationPrimary">#2196F3</Color>
<Color x:Key="NavigationPrimary">White</Color>
<Style x:Key="BaseStyle" TargetType="Element">
<Setter Property="Shell.ShellBackgroundColor" Value="{StaticResource NavigationPrimary}" />
<Setter Property="Shell.ShellBackgroundColor" Value="White" />
<Setter Property="Shell.ShellForegroundColor" Value="White" />
<Setter Property="Shell.ShellTitleColor" Value="White" />
<Setter Property="Shell.ShellTitleColor" Value="#051855" />
<Setter Property="Shell.ShellDisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.ShellUnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.ShellTabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
<Setter Property="Shell.ShellTabBarForegroundColor" Value="White"/>
<Setter Property="Shell.ShellTabBarUnselectedColor" Value="#95FFFFFF"/>
<Setter Property="Shell.ShellTabBarTitleColor" Value="White"/>
<Setter Property="Shell.ShellTabBarTitleColor" Value="#051855"/>
</Style>
<Style TargetType="ShellItem" BasedOn="{StaticResource BaseStyle}" />
</ResourceDictionary>
Expand Down
1 change: 1 addition & 0 deletions VisualChallenge/VisualChallenge/VisualChallenge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.0.1.206893" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.0.1.206893" />
<PackageReference Include="SegmentedControl.FormsPlugin" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
177 changes: 154 additions & 23 deletions VisualChallenge/VisualChallenge/VisualChallengePage.xaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,154 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
x:Class="VisualChallenge.VisualChallengePage"
Shell.NavBarIsVisible="True"
BackgroundColor="White"
Title="Visual Challenge"
>

<!-- If you decide to change out the flexlayout leave the scroll view here
Currently there's a bug in shell that will set margins wrong if the content is not in a scrollview
-->
<ScrollView>
<FlexLayout Margin="20" Direction="Column" AlignContent="Center" JustifyContent="SpaceAround">

<Label Text="Start Here" FontSize="24" HorizontalTextAlignment="Center"/>

<Button Text="Read More About Visual" Clicked="Button_Clicked" />

</FlexLayout>
</ScrollView>
</ContentPage>
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:controls="clr-namespace:SegmentedControl.FormsPlugin.Abstractions;assembly=SegmentedControl.FormsPlugin.Abstractions"
x:Class="VisualChallenge.VisualChallengePage"
Shell.NavBarIsVisible="True"
BackgroundColor="White"
Title="Flights">
<ScrollView VerticalScrollBarVisibility="Never">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="0.5" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Frame Grid.Row="0" BackgroundColor="#B2B2B2" />
<FlexLayout Grid.Row="1" Margin="10" Direction="Column" AlignContent="Start" JustifyContent="Start" >

<controls:SegmentedControl TintColor="#2458E2" SelectedSegment="0" Margin="0,10,0,10">
<controls:SegmentedControl.Children>
<controls:SegmentedControlOption Text="Roundtrip" />
<controls:SegmentedControlOption Text="One way" />
<controls:SegmentedControlOption Text="Multi-city" />
</controls:SegmentedControl.Children>
</controls:SegmentedControl>

<Frame Margin="0,5,0,5" BorderColor="#B2B2B2" Padding="0" CornerRadius="10">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="ic_map" HeightRequest="35" WidthRequest="35" VerticalOptions="Center" HorizontalOptions="Center" Opacity="0.5"/>
<Entry Placeholder="Flying from" BackgroundColor="Transparent" Grid.Column="1" FontSize="20" TextColor="#051855" VerticalOptions="Center" Margin="-15,10,10,10"/>
</Grid>
</Frame>

<Frame Margin="0,5,0,5" BorderColor="#B2B2B2" Padding="0" CornerRadius="10">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="ic_map" HeightRequest="35" WidthRequest="35" VerticalOptions="Center" HorizontalOptions="Center" Opacity="0.5"/>
<Entry Placeholder="Flying to" BackgroundColor="Transparent" Grid.Column="1" FontSize="20" TextColor="#051855" VerticalOptions="Center" Margin="-15,10,10,10"/>
</Grid>
</Frame>

<!-- <Frame Margin="0,5,0,5" BorderColor="#B2B2B2" Padding="0" CornerRadius="10">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.6*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="ic_map" Grid.RowSpan="2" HeightRequest="35" WidthRequest="35" VerticalOptions="Center" HorizontalOptions="Center" Opacity="0.5"/>
<Label Text="Flying to" Grid.Row="0" Grid.Column="1" FontSize="16" TextColor="#747B9B" VerticalOptions="End" Margin="0,10,0,0"/>
<Label Text="Honolulu, HI" Grid.Row="1" Grid.Column="1" FontSize="22" TextColor="#051855" VerticalOptions="Start" Margin="0,5,0,5"/>
</Grid>
</Frame>-->

<Frame Margin="0,5,0,5" BorderColor="#B2B2B2" Padding="0" CornerRadius="10">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.6*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="ic_dates" Grid.RowSpan="2" HeightRequest="35" WidthRequest="35" VerticalOptions="Center" HorizontalOptions="Center" Opacity="0.5"/>
<Label Text="Select dates" Grid.Row="0" Grid.Column="1" FontSize="16" TextColor="#747B9B" VerticalOptions="End" Margin="0,10,0,0"/>
<Label Text="Wed, Mar 27 - Thu, Mar 28" Grid.Row="1" Grid.Column="1" FontSize="22" TextColor="#051855" VerticalOptions="Start" Margin="0,5,0,5"/>
<!--<DatePicker Grid.Row="1" Grid.Column="1" FontSize="22" TextColor="#051855" VerticalOptions="Start" Margin="0,5,5,5"/>-->
</Grid>
</Frame>

<Frame Margin="0,5,0,5" BorderColor="#B2B2B2" Padding="0" CornerRadius="10">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.6*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image Source="ic_person" Grid.RowSpan="2" HeightRequest="35" WidthRequest="35" VerticalOptions="Center" HorizontalOptions="Center" Opacity="0.5"/>
<Label Text="Travelers" Grid.Row="0" Grid.Column="1" FontSize="16" TextColor="#747B9B" VerticalOptions="End" Margin="0,10,0,0"/>
<Label Text="{Binding Value, StringFormat='{} {0} traveler(s)'}" BindingContext="{x:Reference Name=TravelersStepper}" Grid.Row="1" Grid.Column="1" FontSize="22" TextColor="#051855" VerticalOptions="Start" Margin="0,5,0,5"/>
<Stepper x:Name="TravelersStepper" Minimum="1" Maximum="10" Grid.Column="2" Value="1" Grid.RowSpan="2" VerticalOptions="Center" Margin="10"/>
</Grid>
</Frame>

<Frame Margin="0,5,0,5" BorderColor="#B2B2B2" Padding="0" CornerRadius="10">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.6*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="ic_class" Grid.RowSpan="2" HeightRequest="35" WidthRequest="35" VerticalOptions="Center" HorizontalOptions="Center" Opacity="0.5"/>
<Label Text="Preferred class" Grid.Row="0" Grid.Column="1" FontSize="16" TextColor="#747B9B" VerticalOptions="End" Margin="0,0,0,0"/>
<!--<Label Text="Economy" Grid.Row="1" Grid.Column="1" FontSize="22" TextColor="#051855" VerticalOptions="Start" Margin="0,5,0,5"/>-->
<Picker SelectedIndex="0" BackgroundColor="Transparent" Grid.Column="1" Grid.Row="1" FontSize="20" TextColor="#051855" VerticalOptions="Center" Margin="-15,0,10,10">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Economy</x:String>
<x:String>Premium Economy</x:String>
<x:String>Business</x:String>
<x:String>First class</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
</Frame>

<StackLayout Orientation="Horizontal" Margin="10" >
<Label Text="optional" VerticalOptions="Center" TextColor="#48517C" FontSize="Small"/>
<BoxView BackgroundColor="#B2B2B2" HeightRequest="0.5" HorizontalOptions="FillAndExpand" VerticalOptions="Center" />
</StackLayout>

<Frame Margin="0,5,0,5" BorderColor="#B2B2B2" Padding="0" CornerRadius="10">
<Grid RowSpacing="0" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.6*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image Source="ic_nonstop" Grid.RowSpan="2" HeightRequest="35" WidthRequest="35" VerticalOptions="Center" HorizontalOptions="Center" Opacity="0.5"/>
<Label Text="Nonstop flights only" Grid.Row="0" Grid.Column="1" FontSize="16" TextColor="#747B9B" VerticalOptions="End" Margin="0,10,0,0"/>
<Label Text="{Binding IsToggled}" BindingContext="{x:Reference Name=NonStopSwitch}" Grid.Row="1" Grid.Column="1" FontSize="22" TextColor="#051855" VerticalOptions="Start" Margin="0,5,0,5"/>
<Switch x:Name="NonStopSwitch" Grid.Column="2" Grid.RowSpan="2" VerticalOptions="Center" HorizontalOptions="Center" IsToggled="true" Margin="10"/>
</Grid>
</Frame>

</FlexLayout>
<Button Grid.Row="2" BackgroundColor="#2458E2" TextColor="White" FontSize="Medium" Text="Search" Margin="10" Padding="10"/>
</Grid>
</ScrollView>
</ContentPage>
5 changes: 0 additions & 5 deletions VisualChallenge/VisualChallenge/VisualChallengePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,5 @@ public VisualChallengePage()
{
InitializeComponent();
}

private void Button_Clicked(object sender, EventArgs e)
{
Device.OpenUri(new Uri("https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual"));
}
}
}