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
Binary file added CaroselChallenge.gif
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 @@ -15,7 +15,6 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
Expand Down Expand Up @@ -54,7 +53,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.3.0.819712-pre2" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Essentials" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -96,9 +95,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CarouselViewChallenge\CarouselViewChallenge.csproj">
<Project>{1AD32EAF-CE1F-497F-8598-87F19CDA3D10}</Project>
<Project>{A9F8B9B3-719F-4F40-9044-924E7B921409}</Project>
<Name>CarouselViewChallenge</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.carouselviewchallenge">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:label="CarouselViewChallenge.Android"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:label="CarouselViewChallenge.Android"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\CarouselViewChallenge\CarouselViewChallenge.csproj">
<Project>{1AD32EAF-CE1F-497F-8598-87F19CDA3D10}</Project>
<Project>{A9F8B9B3-719F-4F40-9044-924E7B921409}</Project>
<Name>CarouselViewChallenge</Name>
</ProjectReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>

<ItemGroup>
<None Remove="Resources\blackDrone.png" />
<None Remove="Resources\Drone-Background-PNG.png" />
<None Remove="Resources\Drone-PNG-Background-Image.png" />
<None Remove="Resources\Drone-PNG-Image.png" />
<None Remove="Resources\Drone-PNG-Transparent-Image.png" />
<None Remove="Resources\Drone-PNG-Transparent-Picture.png" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\blackDrone.png" />
<EmbeddedResource Include="Resources\Drone-Background-PNG.png" />
<EmbeddedResource Include="Resources\Drone-PNG-Background-Image.png" />
<EmbeddedResource Include="Resources\Drone-PNG-Image.png" />
<EmbeddedResource Include="Resources\Drone-PNG-Transparent-Image.png" />
<EmbeddedResource Include="Resources\Drone-PNG-Transparent-Picture.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.3.0.819712-pre2" />
<PackageReference Include="Xamarin.Essentials" Version="1.3.0" />
Expand All @@ -20,9 +38,4 @@
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Views\CarouselViewChallengePage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>
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.
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
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using Xamarin.Forms;

namespace CarouselViewChallenge.ViewModels
{
public class ItemClass
{
public string ItemText {get; set;}
public ImageSource Image { get; set; }
public string Description { get; set; }
public string Price { get; set; }
}

public class CaroselViewChallengePageViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

public ObservableCollection<ItemClass> _items { get; set; }

public CaroselViewChallengePageViewModel()
{
_items = new ObservableCollection<ItemClass>
{
new ItemClass
{
ItemText = "Movic Air Platinum",
Image = ImageSource.FromResource("CarouselViewChallenge.Resources.blackDrone.png"),
Description = "Creates highly accurate and detailed models of whatever area is being scanned.",
Price = "Price $714,00"
},
new ItemClass
{
ItemText = "AirCraft",
Image = ImageSource.FromResource("CarouselViewChallenge.Resources.Drone-PNG-Transparent-Picture.png"),
Description = "These models can be used to extrapolate accurate measurements of distance and volume from building locations",
Price = "Price $1.230,00"
},
new ItemClass
{
ItemText = "White Ghost",
Image = ImageSource.FromResource("CarouselViewChallenge.Resources.Drone-PNG-Image.png"),
Description = "Has a distinct advantage over traditional aerial photogrammetry by being able to penetrate dense canopies",
Price = "Price $892,00"
}
};
}

private void OnPropertyChanged(PropertyChangedEventArgs eventArgs)
{
PropertyChanged?.Invoke(this, eventArgs);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,72 @@
mc:Ignorable="d"
x:Class="CarouselViewChallenge.Views.CarouselViewChallengePage">
<ContentPage.Content>
<StackLayout BackgroundColor="#cfd8dc">
<Label Text="You can use this page for the CarouselView Challenge!" HorizontalOptions="Center" VerticalOptions="CenterAndExpand"/>
<StackLayout Padding="5">
<Label Text="Drones"
FontSize="Title"
FontAttributes="Bold"
TextColor="Black"/>
<CarouselView PeekAreaInsets="20"
ItemsSource="{Binding _items}">
<CarouselView.ItemTemplate>
<DataTemplate>
<Frame BackgroundColor="White"
HasShadow="false"
Padding="0,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Frame CornerRadius="5"
BackgroundColor="#2196F3"
Grid.RowSpan="2"/>
<Image Source="{Binding Image}"
Grid.Row="0"
Grid.ColumnSpan="2"
VerticalOptions="Start"/>
<StackLayout Grid.Row="1"
Padding="5,0"
VerticalOptions="Start">
<Label Text="{Binding ItemText}"
FontSize="Title"
TextColor="White"
FontAttributes="Bold"/>
<Label Text="{Binding Description}"
FontSize="Body"
TextColor="#2b2a6f"
FontAttributes="Italic"/>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Price}"
FontSize="Medium"
TextColor="White"
FontAttributes="Bold"
VerticalOptions="Center"
HorizontalOptions="StartAndExpand"/>
<Frame BackgroundColor="#f9144c"
HorizontalOptions="End"
CornerRadius="10"
WidthRequest="40"
HeightRequest="40"
Padding="1">
<Label Text="+"
HorizontalOptions="Center"
VerticalOptions="Center"
FontSize="Title"
TextColor="White"/>
</Frame>
</StackLayout>
</StackLayout>

</Grid>
</Frame>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using CarouselViewChallenge.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

Expand All @@ -12,9 +7,14 @@ namespace CarouselViewChallenge.Views
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CarouselViewChallengePage : ContentPage
{
public CaroselViewChallengePageViewModel ViewModel { get; set; }
public CarouselViewChallengePage()
{
InitializeComponent();

ViewModel = new CaroselViewChallengePageViewModel();

BindingContext = ViewModel;
}
}
}