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
3 changes: 2 additions & 1 deletion VisualChallenge/VisualChallenge.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ protected override void OnCreate(Bundle savedInstanceState)

base.OnCreate(savedInstanceState);

global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
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());
}
}
Expand Down
6,478 changes: 4,535 additions & 1,943 deletions VisualChallenge/VisualChallenge.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
Expand Down Expand Up @@ -49,9 +48,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.6.0.135200-pre1" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>3.6.0.135200-pre1</Version>
<Version>3.6.0.264807</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -90,7 +89,7 @@
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\VisualChallenge\VisualChallenge.csproj">
<Project>{97CAB2B1-D85C-442E-AEFA-06FF5138B907}</Project>
<Project>{DF343C5B-66F1-4EF5-B721-6246D8F1DC39}</Project>
<Name>VisualChallenge</Name>
</ProjectReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.6.0.135200-pre1" />
<PackageReference Include="Xamarin.Forms" Version="3.6.0.264807" />
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>3.6.0.135200-pre1</Version>
<Version>3.6.0.264807</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\VisualChallenge\VisualChallenge.csproj">
<Project>{97CAB2B1-D85C-442E-AEFA-06FF5138B907}</Project>
<Project>{DF343C5B-66F1-4EF5-B721-6246D8F1DC39}</Project>
<Name>VisualChallenge</Name>
</ProjectReference>
</ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions VisualChallenge/VisualChallenge/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
FlyoutBehavior="Disabled"
Title="VisualChallenge"
x:Class="VisualChallenge.AppShell"
Visual="Material"
>
Visual="Material">

<!--
Styles and Resources
Expand Down
3 changes: 3 additions & 0 deletions VisualChallenge/VisualChallenge/VisualChallenge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
<DependentUpon>VisualChallengePage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="ViewModels\BaseViewModel.css" />
</ItemGroup>
</Project>
119 changes: 102 additions & 17 deletions VisualChallenge/VisualChallenge/VisualChallengePage.xaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,104 @@
<?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"
>

<?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">
<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" />

<Grid VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="4*" />
<RowDefinition Height="6*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Frame Grid.Row="0" VerticalOptions="FillAndExpand" BackgroundColor="#f5f5f5" HorizontalOptions="FillAndExpand" Margin="16,16,16,0" Padding="3">
<Image Aspect="AspectFill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Source="https://xamariners.com/wp-content/uploads/2016/12/monkeys-585x418.png" />
</Frame>
<Button BackgroundColor="#d8d8d8" BorderColor="White" BorderWidth="4" TranslationY="15" VerticalOptions="CenterAndExpand" HorizontalOptions="Center" BorderRadius="0" HeightRequest="40" Clicked="OnPhoto_Clicked" WidthRequest="150"
CornerRadius="20" Text="Take Photo" Opacity="0.7" TextColor="White" FontAttributes="Bold" />
<ScrollView Grid.Row="1" VerticalOptions="Center" HorizontalOptions="FillAndExpand" Margin="16,10,16,16" Orientation="Vertical">
<StackLayout>
<StackLayout Orientation="Horizontal">
<StackLayout.HeightRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" />
</StackLayout.HeightRequest>
<Entry HorizontalOptions="FillAndExpand" Placeholder="Entry #1" Keyboard="Text" />
</StackLayout>
<StackLayout Orientation="Horizontal" Margin="0, 5">
<StackLayout.HeightRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" />
</StackLayout.HeightRequest>
<Picker HorizontalOptions="FillAndExpand" Title="Picker 1" TitleColor="#424242">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</StackLayout>
<StackLayout Orientation="Horizontal">
<StackLayout.HeightRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" />
</StackLayout.HeightRequest>
<Picker HorizontalOptions="FillAndExpand" Title="Picker 2">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</StackLayout>
<StackLayout Orientation="Horizontal" Margin="0, 5">
<StackLayout.HeightRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" />
</StackLayout.HeightRequest>
<Picker Title="Picker 3" HorizontalOptions="FillAndExpand">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</StackLayout>
<StackLayout Orientation="Horizontal">
<StackLayout.HeightRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" />
</StackLayout.HeightRequest>
<Picker Title="Picker 4" HorizontalOptions="FillAndExpand">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</StackLayout>
</StackLayout>
</ScrollView>
</Grid>
<StackLayout VerticalOptions="EndAndExpand" Margin="15,0,15,15">
<Button TextColor="White" BorderRadius="20" HeightRequest="40" BackgroundColor="#373f83" Text="Button" VerticalOptions="Center" HorizontalOptions="FillAndExpand" />
</StackLayout>
</FlexLayout>

</ContentPage>
</ContentPage>
15 changes: 12 additions & 3 deletions VisualChallenge/VisualChallenge/VisualChallengePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ public VisualChallengePage()
{
InitializeComponent();
}

private void Button_Clicked(object sender, EventArgs e)
private async void OnPhoto_Clicked(object sender, EventArgs e)
{
Device.OpenUri(new Uri("https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual"));
string[] options = new string[] { "Open Camera", "Gallery" };
var result = await DisplayActionSheet("Imagen", "Cancel", null, options);
if (result == "Open Camera")
{
await DisplayAlert("Options" ,"Camera Selected", "Cancel");
}
if (result == "Gallery")
{
await DisplayAlert("Options", "Gallery","Cancel");
}
}
}
}