diff --git a/Screenshots/android.png b/Screenshots/android.png new file mode 100644 index 0000000..f421d28 Binary files /dev/null and b/Screenshots/android.png differ diff --git a/Screenshots/mac.png b/Screenshots/mac.png new file mode 100644 index 0000000..41f910e Binary files /dev/null and b/Screenshots/mac.png differ diff --git a/Screenshots/original.png b/Screenshots/original.png new file mode 100644 index 0000000..5edeeac Binary files /dev/null and b/Screenshots/original.png differ diff --git a/VisualChallenge/VisualChallenge.Android/Resources/Resource.designer.cs b/VisualChallenge/VisualChallenge.Android/Resources/Resource.designer.cs index 1f086b3..4727a74 100644 --- a/VisualChallenge/VisualChallenge.Android/Resources/Resource.designer.cs +++ b/VisualChallenge/VisualChallenge.Android/Resources/Resource.designer.cs @@ -1,11 +1,11 @@ #pragma warning disable 1591 //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Este código fue generado por una herramienta. +// Versión de runtime:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si +// se vuelve a generar el código. // //------------------------------------------------------------------------------ diff --git a/VisualChallenge/VisualChallenge.iOS/VisualChallenge.iOS.csproj b/VisualChallenge/VisualChallenge.iOS/VisualChallenge.iOS.csproj index d711192..d4a58e4 100644 --- a/VisualChallenge/VisualChallenge.iOS/VisualChallenge.iOS.csproj +++ b/VisualChallenge/VisualChallenge.iOS/VisualChallenge.iOS.csproj @@ -28,6 +28,7 @@ x86_64 None true +iPhone Developer none diff --git a/VisualChallenge/VisualChallenge/App.xaml.cs b/VisualChallenge/VisualChallenge/App.xaml.cs index 2ab3c58..c651e4c 100644 --- a/VisualChallenge/VisualChallenge/App.xaml.cs +++ b/VisualChallenge/VisualChallenge/App.xaml.cs @@ -1,4 +1,5 @@ -using Xamarin.Forms; +using DLToolkit.Forms.Controls; +using Xamarin.Forms; namespace VisualChallenge { @@ -10,6 +11,7 @@ public App() InitializeComponent(); MainPage = new AppShell(); + FlowListView.Init(); } protected override void OnStart() diff --git a/VisualChallenge/VisualChallenge/Images/ico_sprouts_color.png b/VisualChallenge/VisualChallenge/Images/ico_sprouts_color.png new file mode 100644 index 0000000..806ffbd Binary files /dev/null and b/VisualChallenge/VisualChallenge/Images/ico_sprouts_color.png differ diff --git a/VisualChallenge/VisualChallenge/ViewModels/CropItemViewModel.cs b/VisualChallenge/VisualChallenge/ViewModels/CropItemViewModel.cs new file mode 100644 index 0000000..23a3828 --- /dev/null +++ b/VisualChallenge/VisualChallenge/ViewModels/CropItemViewModel.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; +using Xamarin.Forms; + +namespace VisualChallenge.ViewModels +{ + public class CropItemViewModel : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + public void OnPropertyChanged(string propertyName) + { + this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + private ImageSource imageSource; + + public ImageSource ImageSource + { + get { return imageSource; } + set { imageSource = value; OnPropertyChanged(nameof(ImageSource)); } + } + + private string name; + + public string Name + { + get { return name; } + set { name = value; OnPropertyChanged(nameof(name)); } + } + + private bool isSelected; + + public bool IsSelected + { + get { return isSelected; } + set { isSelected = value; OnPropertyChanged(nameof(IsSelected)); } + } + + } +} diff --git a/VisualChallenge/VisualChallenge/ViewModels/VisualChallengePageViewModel.cs b/VisualChallenge/VisualChallenge/ViewModels/VisualChallengePageViewModel.cs new file mode 100644 index 0000000..65d8570 --- /dev/null +++ b/VisualChallenge/VisualChallenge/ViewModels/VisualChallengePageViewModel.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Text; +using Xamarin.Forms; + +namespace VisualChallenge.ViewModels +{ + public class VisualChallengePageViewModel : INotifyPropertyChanged + { + + public VisualChallengePageViewModel() + { + BuildCrops(); + } + + public event PropertyChangedEventHandler PropertyChanged; + + public void OnPropertyChanged(string propertyName) + { + this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + private ObservableCollection crops; + + public ObservableCollection Crops + { + get { return crops; } + set { crops = value; OnPropertyChanged(nameof(Crops)); } + } + + private void BuildCrops() + { + Crops = new ObservableCollection(); + for(var i = 0; i < 21; i++) + { + Crops.Add(new CropItemViewModel + { + Name = $"Item {i}", + IsSelected = false, + ImageSource = ImageSource.FromResource("VisualChallenge.Images.ico_sprouts_color.png") + }); + } + } + + } +} diff --git a/VisualChallenge/VisualChallenge/VisualChallenge.csproj b/VisualChallenge/VisualChallenge/VisualChallenge.csproj index c971abe..9201461 100644 --- a/VisualChallenge/VisualChallenge/VisualChallenge.csproj +++ b/VisualChallenge/VisualChallenge/VisualChallenge.csproj @@ -11,6 +11,15 @@ + + + + + + + + + diff --git a/VisualChallenge/VisualChallenge/VisualChallengePage.xaml b/VisualChallenge/VisualChallenge/VisualChallengePage.xaml index 305cee4..4530bb1 100644 --- a/VisualChallenge/VisualChallenge/VisualChallengePage.xaml +++ b/VisualChallenge/VisualChallenge/VisualChallengePage.xaml @@ -2,22 +2,57 @@ - - + + -