├── fastfood.gif ├── ffof.iOS ├── Resources │ ├── Default.png │ ├── Default@2x.png │ ├── Default-568h@2x.png │ ├── Default-Portrait.png │ ├── Default-Portrait@2x.png │ └── LaunchScreen.storyboard ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Icon1024.png │ │ ├── Icon120.png │ │ ├── Icon152.png │ │ ├── Icon167.png │ │ ├── Icon180.png │ │ ├── Icon20.png │ │ ├── Icon29.png │ │ ├── Icon40.png │ │ ├── Icon58.png │ │ ├── Icon60.png │ │ ├── Icon76.png │ │ ├── Icon80.png │ │ ├── Icon87.png │ │ └── Contents.json ├── Entitlements.plist ├── Main.cs ├── AppDelegate.cs ├── Info.plist ├── Properties │ └── AssemblyInfo.cs └── ffof.iOS.csproj ├── ffof.Android ├── Resources │ ├── mipmap-hdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-mdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-xhdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-xxhdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-xxxhdpi │ │ ├── icon.png │ │ └── launcher_foreground.png │ ├── mipmap-anydpi-v26 │ │ ├── icon.xml │ │ └── icon_round.xml │ ├── values │ │ ├── colors.xml │ │ └── styles.xml │ ├── layout │ │ ├── Toolbar.xml │ │ └── Tabbar.xml │ └── AboutResources.txt ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs ├── Assets │ └── AboutAssets.txt ├── MainActivity.cs └── ffof.Android.csproj ├── ffof ├── Resources │ └── fonts │ │ └── materialdesignicons-webfont.ttf ├── AssemblyInfo.cs ├── Models │ ├── CategoryModel.cs │ ├── ProductModel.cs │ └── BrandModel.cs ├── Controls │ ├── BrandView.xaml.cs │ └── BrandView.xaml ├── Views │ ├── CartPage.xaml.cs │ ├── ProductsPage.xaml.cs │ ├── CartPage.xaml │ └── ProductsPage.xaml ├── App.xaml ├── MainPage.xaml.cs ├── App.xaml.cs ├── ViewModels │ ├── CartViewModel.cs │ ├── MainViewModel.cs │ └── ProductsViewModel.cs ├── ffof.csproj ├── BrandView.xaml └── MainPage.xaml ├── Readme.md ├── LICENSE ├── ffof.sln └── .gitignore /fastfood.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/fastfood.gif -------------------------------------------------------------------------------- /ffof.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Resources/Default.png -------------------------------------------------------------------------------- /ffof.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /ffof.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /ffof.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /ffof.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /ffof/Resources/fonts/materialdesignicons-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof/Resources/fonts/materialdesignicons-webfont.ttf -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-hdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-hdpi/launcher_foreground.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-mdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-mdpi/launcher_foreground.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-xhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-xhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-xxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-xxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAXAM/xamarin-forms-fast-food-order-flow/HEAD/ffof.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /ffof/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.Forms; 2 | using Xamarin.Forms.Xaml; 3 | 4 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)] 5 | [assembly: ExportFont("materialdesignicons-webfont.ttf", Alias ="Material")] -------------------------------------------------------------------------------- /ffof.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ffof/Models/CategoryModel.cs: -------------------------------------------------------------------------------- 1 | namespace ffof.Models 2 | { 3 | public class CategoryModel 4 | { 5 | public string PictureUrl { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public string Code { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ffof/Controls/BrandView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Xamarin.Forms; 4 | 5 | namespace ffof.Controls 6 | { 7 | public partial class BrandView : ContentView 8 | { 9 | public BrandView() 10 | { 11 | InitializeComponent(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-anydpi-v26/icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | -------------------------------------------------------------------------------- /ffof/Models/ProductModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace ffof.Models 3 | { 4 | public class ProductModel 5 | { 6 | public string PictureUrl { get; set; } 7 | 8 | public string Name { get; set; } 9 | 10 | public double Pricing { get; set; } 11 | 12 | public string Category { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ffof.Android/Resources/mipmap-anydpi-v26/icon_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | -------------------------------------------------------------------------------- /ffof.Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 5 | #3F51B5 7 | #303F9F 9 | #FF4081 11 | -------------------------------------------------------------------------------- /ffof/Views/CartPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using ffof.ViewModels; 4 | using Xamarin.Forms; 5 | 6 | namespace ffof.Views 7 | { 8 | public partial class CartPage : ContentPage 9 | { 10 | public CartPage() 11 | { 12 | InitializeComponent(); 13 | 14 | BindingContext = new CartViewModel(Navigation); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ffof.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ffof/App.xaml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ffof.Android/Resources/layout/Toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ffof/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using ffof.ViewModels; 3 | using Xamarin.Forms; 4 | 5 | namespace ffof 6 | { 7 | // Learn more about making custom code visible in the Xamarin.Forms previewer 8 | // by visiting https://aka.ms/xamarinforms-previewer 9 | [DesignTimeVisible(false)] 10 | public partial class MainPage : ContentPage 11 | { 12 | public MainPage() 13 | { 14 | InitializeComponent(); 15 | 16 | BindingContext = new MainViewModel(Navigation); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ffof.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace ffof.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Fast Food Order Flow 2 | 3 | Inspired by design [here](https://dribbble.com/shots/10813423-Fast-Food-Order-Flow) by [Salman Shah](https://dribbble.com/DesignAvenger) 4 | 5 | 6 | 7 | # Techniques 8 | - [Xamarin.Forms](https://github.com/xamarin/Xamarin.Forms) 9 | - Rounded View: [PancakeView](https://github.com/sthewissen/Xamarin.Forms.PancakeView) 10 | - Fake data: [Bogus](https://github.com/bchavez/Bogus) 11 | 12 | # Contributors: 13 | - [@tuyen-vuduc](https://github.com/tuyen-vuduc) 14 | 15 | # License 16 | [MIT](./LICENSE) -------------------------------------------------------------------------------- /ffof.Android/Resources/layout/Tabbar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ffof/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ffof.Views; 3 | using Xamarin.Forms; 4 | using Xamarin.Forms.Xaml; 5 | 6 | namespace ffof 7 | { 8 | public partial class App : Application 9 | { 10 | public App() 11 | { 12 | InitializeComponent(); 13 | 14 | MainPage = new NavigationPage(new MainPage()); 15 | 16 | } 17 | 18 | protected override void OnStart() 19 | { 20 | } 21 | 22 | protected override void OnSleep() 23 | { 24 | } 25 | 26 | protected override void OnResume() 27 | { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ffof/Models/BrandModel.cs: -------------------------------------------------------------------------------- 1 | namespace ffof.Models 2 | { 3 | public class BrandModel 4 | { 5 | public string ColorCode { get; set; } 6 | 7 | public string LogoUrl { get; set; } 8 | 9 | public string Name { get; set; } 10 | 11 | public string HighlightUrl { get; set; } 12 | 13 | public string Remark { get; set; } 14 | 15 | public string PricingCategory { get; set; } 16 | 17 | public double Rating { get; set; } 18 | 19 | public int ShortestWaitingTime { get; set; } 20 | 21 | public int LongestWaitingTime { get; set; } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /ffof.Android/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with your package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 NAXAM 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ffof.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace ffof.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init(); 26 | LoadApplication(new App()); 27 | 28 | return base.FinishedLaunching(app, options); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ffof.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("ffof.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("ffof.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | [assembly: AssemblyVersion("1.0.0.0")] 26 | [assembly: AssemblyFileVersion("1.0.0.0")] 27 | 28 | // Add some common permissions, these can be removed if not needed 29 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 30 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 31 | -------------------------------------------------------------------------------- /ffof/ViewModels/CartViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.ObjectModel; 3 | using System.Windows.Input; 4 | using Bogus; 5 | using ffof.Models; 6 | using Xamarin.Forms; 7 | 8 | namespace ffof.ViewModels 9 | { 10 | public class CartViewModel 11 | { 12 | public ObservableCollection Products { get; set; } 13 | 14 | public ObservableCollection RelevantProducts { get; set; } 15 | 16 | public ICommand GoBackCommand { get; set; } 17 | 18 | public CartViewModel(INavigation navigation) 19 | { 20 | var productFaker = new Faker() 21 | .RuleFor(x => x.Pricing, o => o.Random.Double(10, 200)) 22 | .RuleFor(x => x.Name, o => o.Commerce.ProductName()) 23 | .RuleFor(x => x.PictureUrl, o => o.Image.PicsumUrl()); 24 | 25 | var items = productFaker.Generate(5); 26 | Products = new ObservableCollection(items); 27 | 28 | items = productFaker.Generate(10); 29 | RelevantProducts = new ObservableCollection(items); 30 | 31 | GoBackCommand = new Command(() => 32 | { 33 | navigation.PopAsync(); 34 | }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ffof/ffof.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | true 6 | 7 | 8 | 9 | portable 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ffof.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | using System.Collections.Generic; 10 | using System.Reflection; 11 | 12 | namespace ffof.Droid 13 | { 14 | [Activity(Label = "ffof", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 15 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 16 | { 17 | protected override void OnCreate(Bundle savedInstanceState) 18 | { 19 | TabLayoutResource = Resource.Layout.Tabbar; 20 | ToolbarResource = Resource.Layout.Toolbar; 21 | 22 | base.OnCreate(savedInstanceState); 23 | 24 | Xamarin.Essentials.Platform.Init(this, savedInstanceState); 25 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState); 26 | LoadApplication(new App()); 27 | } 28 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) 29 | { 30 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); 31 | 32 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /ffof.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 8.0 25 | CFBundleDisplayName 26 | ffof 27 | CFBundleIdentifier 28 | net.naxam.ffof 29 | CFBundleVersion 30 | 1.0 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | CFBundleName 34 | ffof 35 | XSAppIconAssets 36 | Assets.xcassets/AppIcon.appiconset 37 | 38 | 39 | -------------------------------------------------------------------------------- /ffof.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ffof.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ffof.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ffof.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 35 | 41 | -------------------------------------------------------------------------------- /ffof.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /ffof/ViewModels/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Windows.Input; 3 | using Bogus.DataSets; 4 | using ffof.Models; 5 | using ffof.Views; 6 | using Xamarin.Forms; 7 | 8 | namespace ffof.ViewModels 9 | { 10 | public class MainViewModel 11 | { 12 | public ObservableCollection Brands { get; set; } 13 | 14 | public ICommand ViewProductsCommand { get; set; } 15 | 16 | public MainViewModel(INavigation navigation) 17 | { 18 | var fake = new Bogus.Faker() 19 | .RuleFor(x => x.ColorCode, o => o.PickRandom( 20 | new[] { 21 | Color.AliceBlue.ToHex(), 22 | Color.Aqua.ToHex(), 23 | Color.BlueViolet.ToHex(), 24 | Color.Chocolate.ToHex(), 25 | Color.Cornsilk.ToHex(), 26 | Color.DarkGreen.ToHex(), 27 | Color.DarkOrange.ToHex(), 28 | Color.DeepPink.ToHex(), 29 | Color.Indigo.ToHex(), 30 | } 31 | )) 32 | .RuleFor(x => x.HighlightUrl, o => o.Image.PicsumUrl()) 33 | .RuleFor(x => x.LogoUrl, o => o.Image.PicsumUrl()) 34 | .RuleFor(x => x.LongestWaitingTime, o => o.Random.Int(15, 60)) 35 | .RuleFor(x => x.Name, o => o.Company.CompanyName()) 36 | .RuleFor(x => x.Rating, o => o.Random.Double(0, 1)) 37 | .RuleFor(x => x.Remark, o => o.Lorem.Slug()) 38 | .RuleFor(x => x.ShortestWaitingTime, o => o.Random.Int(3, 12)) 39 | .RuleFor(x => x.PricingCategory, o => o.Random.CollectionItem(new[] { "$", "$$", "$$$", "$$$" })); 40 | 41 | var items = fake.Generate(100); 42 | Brands = new ObservableCollection(items); 43 | 44 | ViewProductsCommand = new Command(brand => 45 | { 46 | navigation.PushAsync(new ProductsPage(brand)); 47 | }); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ffof/BrandView.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 12 | 66 | 67 | -------------------------------------------------------------------------------- /ffof.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "scale": "2x", 5 | "size": "20x20", 6 | "idiom": "iphone", 7 | "filename": "Icon40.png" 8 | }, 9 | { 10 | "scale": "3x", 11 | "size": "20x20", 12 | "idiom": "iphone", 13 | "filename": "Icon60.png" 14 | }, 15 | { 16 | "scale": "2x", 17 | "size": "29x29", 18 | "idiom": "iphone", 19 | "filename": "Icon58.png" 20 | }, 21 | { 22 | "scale": "3x", 23 | "size": "29x29", 24 | "idiom": "iphone", 25 | "filename": "Icon87.png" 26 | }, 27 | { 28 | "scale": "2x", 29 | "size": "40x40", 30 | "idiom": "iphone", 31 | "filename": "Icon80.png" 32 | }, 33 | { 34 | "scale": "3x", 35 | "size": "40x40", 36 | "idiom": "iphone", 37 | "filename": "Icon120.png" 38 | }, 39 | { 40 | "scale": "2x", 41 | "size": "60x60", 42 | "idiom": "iphone", 43 | "filename": "Icon120.png" 44 | }, 45 | { 46 | "scale": "3x", 47 | "size": "60x60", 48 | "idiom": "iphone", 49 | "filename": "Icon180.png" 50 | }, 51 | { 52 | "scale": "1x", 53 | "size": "20x20", 54 | "idiom": "ipad", 55 | "filename": "Icon20.png" 56 | }, 57 | { 58 | "scale": "2x", 59 | "size": "20x20", 60 | "idiom": "ipad", 61 | "filename": "Icon40.png" 62 | }, 63 | { 64 | "scale": "1x", 65 | "size": "29x29", 66 | "idiom": "ipad", 67 | "filename": "Icon29.png" 68 | }, 69 | { 70 | "scale": "2x", 71 | "size": "29x29", 72 | "idiom": "ipad", 73 | "filename": "Icon58.png" 74 | }, 75 | { 76 | "scale": "1x", 77 | "size": "40x40", 78 | "idiom": "ipad", 79 | "filename": "Icon40.png" 80 | }, 81 | { 82 | "scale": "2x", 83 | "size": "40x40", 84 | "idiom": "ipad", 85 | "filename": "Icon80.png" 86 | }, 87 | { 88 | "scale": "1x", 89 | "size": "76x76", 90 | "idiom": "ipad", 91 | "filename": "Icon76.png" 92 | }, 93 | { 94 | "scale": "2x", 95 | "size": "76x76", 96 | "idiom": "ipad", 97 | "filename": "Icon152.png" 98 | }, 99 | { 100 | "scale": "2x", 101 | "size": "83.5x83.5", 102 | "idiom": "ipad", 103 | "filename": "Icon167.png" 104 | }, 105 | { 106 | "scale": "1x", 107 | "size": "1024x1024", 108 | "idiom": "ios-marketing", 109 | "filename": "Icon1024.png" 110 | } 111 | ], 112 | "properties": {}, 113 | "info": { 114 | "version": 1, 115 | "author": "xcode" 116 | } 117 | } -------------------------------------------------------------------------------- /ffof/Controls/BrandView.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 12 | 86 | 87 | -------------------------------------------------------------------------------- /ffof/ViewModels/ProductsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.ComponentModel; 3 | using System.Linq; 4 | using System.Windows.Input; 5 | using Bogus; 6 | using ffof.Models; 7 | using ffof.Views; 8 | using Xamarin.Forms; 9 | 10 | namespace ffof.ViewModels 11 | { 12 | public class ProductsViewModel : INotifyPropertyChanged 13 | { 14 | private bool productShown; 15 | private bool hasCartItems; 16 | 17 | public BrandModel Brand { get; set; } 18 | 19 | public ObservableCollection> Products { get; set; } 20 | 21 | public ObservableCollection Categories { get; set; } 22 | 23 | public bool ProductShown 24 | { 25 | get => productShown; 26 | set 27 | { 28 | productShown = value; 29 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ProductShown))); 30 | } 31 | } 32 | 33 | public bool HasCartItems 34 | { 35 | get => hasCartItems; 36 | set 37 | { 38 | hasCartItems = value; 39 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(HasCartItems))); 40 | } 41 | } 42 | 43 | public ProductModel ShownProduct { get; set; } 44 | 45 | public ICommand ViewProductDetailCommand { get; set; } 46 | 47 | public ICommand AddToCartCommand { get; set; } 48 | 49 | public ICommand ViewCartCommand { get; set; } 50 | 51 | public ICommand GoBackCommand { get; set; } 52 | 53 | public ProductsViewModel(INavigation navigation, BrandModel brand) 54 | { 55 | Brand = brand; 56 | 57 | var categoryFaker = new Faker() 58 | .RuleFor(x => x.Code, o => o.Lorem.Slug(1)) 59 | .RuleFor(x => x.Name, o => o.Commerce.Categories(1)[0]) 60 | .RuleFor(x => x.PictureUrl, o => o.Image.PicsumUrl()); 61 | Categories = new ObservableCollection(categoryFaker.Generate(10)); 62 | 63 | var productFaker = new Faker() 64 | .RuleFor(x => x.Pricing, o => o.Random.Double(10, 200)) 65 | .RuleFor(x => x.Category, o => o.PickRandom(Categories.Select(x => x.Name))) 66 | .RuleFor(x => x.Name, o => o.Commerce.ProductName()) 67 | .RuleFor(x => x.PictureUrl, o => o.Image.PicsumUrl()); 68 | 69 | var items = productFaker.Generate(200); 70 | 71 | Products = new ObservableCollection>( 72 | items.GroupBy(x => x.Category) 73 | ); 74 | 75 | ViewProductDetailCommand = new Command(product => 76 | { 77 | ShownProduct = product; 78 | ProductShown = true; 79 | HasCartItems = true; 80 | }); 81 | 82 | AddToCartCommand = new Command(product => 83 | { 84 | ProductShown = false; 85 | ShownProduct = null; 86 | }); 87 | 88 | GoBackCommand = new Command(() => 89 | { 90 | navigation.PopAsync(); 91 | }); 92 | 93 | ViewCartCommand = new Command(() => 94 | { 95 | navigation.PushAsync(new CartPage()); 96 | }); 97 | } 98 | 99 | public event PropertyChangedEventHandler PropertyChanged; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /ffof.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ffof", "ffof\ffof.csproj", "{31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ffof.Android", "ffof.Android\ffof.Android.csproj", "{B443568E-0969-4093-B0D7-831BA13B9197}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ffof.iOS", "ffof.iOS\ffof.iOS.csproj", "{054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 15 | Release|iPhoneSimulator = Release|iPhoneSimulator 16 | Debug|iPhone = Debug|iPhone 17 | Release|iPhone = Release|iPhone 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 25 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 26 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 27 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 28 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Debug|iPhone.ActiveCfg = Debug|Any CPU 29 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Debug|iPhone.Build.0 = Debug|Any CPU 30 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Release|iPhone.ActiveCfg = Release|Any CPU 31 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF}.Release|iPhone.Build.0 = Release|Any CPU 32 | {B443568E-0969-4093-B0D7-831BA13B9197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {B443568E-0969-4093-B0D7-831BA13B9197}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {B443568E-0969-4093-B0D7-831BA13B9197}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {B443568E-0969-4093-B0D7-831BA13B9197}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {B443568E-0969-4093-B0D7-831BA13B9197}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 37 | {B443568E-0969-4093-B0D7-831BA13B9197}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 38 | {B443568E-0969-4093-B0D7-831BA13B9197}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 39 | {B443568E-0969-4093-B0D7-831BA13B9197}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 40 | {B443568E-0969-4093-B0D7-831BA13B9197}.Debug|iPhone.ActiveCfg = Debug|Any CPU 41 | {B443568E-0969-4093-B0D7-831BA13B9197}.Debug|iPhone.Build.0 = Debug|Any CPU 42 | {B443568E-0969-4093-B0D7-831BA13B9197}.Release|iPhone.ActiveCfg = Release|Any CPU 43 | {B443568E-0969-4093-B0D7-831BA13B9197}.Release|iPhone.Build.0 = Release|Any CPU 44 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator 45 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator 46 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator 47 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Release|Any CPU.Build.0 = Release|iPhoneSimulator 48 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 49 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 50 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 51 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 52 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Debug|iPhone.ActiveCfg = Debug|iPhone 53 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Debug|iPhone.Build.0 = Debug|iPhone 54 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Release|iPhone.ActiveCfg = Release|iPhone 55 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384}.Release|iPhone.Build.0 = Release|iPhone 56 | EndGlobalSection 57 | EndGlobal 58 | -------------------------------------------------------------------------------- /ffof/Views/ProductsPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Diagnostics; 4 | using ffof.Models; 5 | using ffof.ViewModels; 6 | using Xamarin.Forms; 7 | 8 | namespace ffof.Views 9 | { 10 | public partial class ProductsPage : ContentPage 11 | { 12 | 13 | public ProductsPage() 14 | : this(new BrandModel 15 | { 16 | ColorCode = Color.Indigo.ToHex(), 17 | PricingCategory = "$$$", 18 | HighlightUrl = "https://gigamall.com.vn/data/2019/09/20/11493168_Trung-t%C3%A2m-th%C6%B0%C6%A1ng-m%E1%BA%A1i-GIGAMALL-McDonalds-1.jpg", 19 | LogoUrl = "https://gigamall.com.vn/data/2019/09/20/11491513_LOGO-McDonald_s.jpg", 20 | LongestWaitingTime = 20, 21 | Name = "McDonald's", 22 | Rating = 4.5, 23 | Remark = "Burgers, America", 24 | ShortestWaitingTime = 10, 25 | }) 26 | { 27 | } 28 | 29 | public ProductsPage(BrandModel brand) 30 | { 31 | InitializeComponent(); 32 | 33 | BindingContext = new ProductsViewModel(Navigation, brand); 34 | 35 | (BindingContext as INotifyPropertyChanged).PropertyChanged += ProductsPage_PropertyChanged; 36 | 37 | lstProducts.Scrolled += LstProducts_Scrolled; 38 | } 39 | 40 | private void ProductsPage_PropertyChanged(object sender, PropertyChangedEventArgs e) 41 | { 42 | if (e.PropertyName == nameof(ProductsViewModel.ProductShown)) 43 | { 44 | var vm = BindingContext as ProductsViewModel; 45 | 46 | if (originalY < 0) 47 | { 48 | originalY = itemContainer.Y; 49 | } 50 | 51 | if (vm.ProductShown == true) 52 | { 53 | (itemContainer.Parent as VisualElement).IsVisible = true; 54 | itemContainer.TranslateTo(itemContainer.X, originalY); 55 | } 56 | else 57 | { 58 | itemContainer.TranslateTo(itemContainer.X, originalY + itemContainer.Height * 1.1); 59 | (itemContainer.Parent as VisualElement).IsVisible = false; 60 | } 61 | } 62 | } 63 | 64 | private void LstProducts_Scrolled(object sender, ItemsViewScrolledEventArgs e) 65 | { 66 | if (e.VerticalOffset < 152) 67 | { 68 | container.Margin = new Thickness(0, 152, 0, -152); 69 | return; 70 | } 71 | 72 | var baseline = e.VerticalOffset - 152; 73 | var delta = Math.Max(152 - baseline, -(Device.RuntimePlatform == Device.iOS ? 32 : 24)); 74 | 75 | container.Margin = new Thickness(0, delta, 0, Math.Min(-delta, 0)); 76 | } 77 | 78 | double originalY = -1; 79 | double lastPannedY = 0; 80 | 81 | void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e) 82 | { 83 | Debug.WriteLine("Scroll: " + e.StatusType + ":" + e.TotalY); 84 | 85 | if (originalY < 0) 86 | { 87 | originalY = itemContainer.TranslationY; 88 | } 89 | 90 | switch (e.StatusType) 91 | { 92 | case GestureStatus.Started: 93 | return; 94 | case GestureStatus.Canceled: 95 | case GestureStatus.Completed: 96 | if (lastPannedY < itemContainer.Height / 2) 97 | { 98 | itemContainer.TranslateTo(itemContainer.X, originalY); 99 | } 100 | else 101 | { 102 | itemContainer.TranslateTo(itemContainer.X, originalY + itemContainer.Height * 1.1); 103 | 104 | (BindingContext as ProductsViewModel).ProductShown = false; 105 | (BindingContext as ProductsViewModel).ShownProduct = null; 106 | } 107 | return; 108 | default: 109 | break; 110 | } 111 | 112 | lastPannedY = e.TotalY; 113 | 114 | var newY = originalY + Math.Max(e.TotalY, 0); 115 | itemContainer.TranslateTo(itemContainer.X, newY); 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /ffof.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 16 | 17 | 18 | 19 | 21 | 22 | 25 | 26 | 29 | 32 | 33 | 37 | 43 | 47 | 48 | 55 | 61 | 67 | 68 | 69 | 76 | 77 | 84 | 91 | 92 | 93 | 94 | 99 | 100 | 104 | 105 | 106 | 107 | 111 | 112 | -------------------------------------------------------------------------------- /ffof.Android/ffof.Android.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {B443568E-0969-4093-B0D7-831BA13B9197} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | {c9e5eea5-ca05-42a1-839b-61506e0a37df} 9 | Library 10 | ffof.Droid 11 | ffof.Android 12 | True 13 | True 14 | Resources\Resource.designer.cs 15 | Resource 16 | Properties\AndroidManifest.xml 17 | Resources 18 | Assets 19 | v9.0 20 | true 21 | true 22 | Xamarin.Android.Net.AndroidClientHandler 23 | 24 | 25 | 26 | 27 | true 28 | portable 29 | false 30 | bin\Debug 31 | DEBUG; 32 | prompt 33 | 4 34 | None 35 | 36 | 37 | true 38 | portable 39 | true 40 | bin\Release 41 | prompt 42 | 4 43 | true 44 | false 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 1.4.2 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF} 96 | ffof 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /ffof.iOS/ffof.iOS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | 8.0.30703 7 | 2.0 8 | {054D1C13-BEC4-4B86-B7BF-5A1CDCBAE384} 9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | {6143fdea-f3c2-4a09-aafa-6e230626515e} 11 | Exe 12 | ffof.iOS 13 | Resources 14 | ffof.iOS 15 | true 16 | NSUrlSessionHandler 17 | automatic 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\iPhoneSimulator\Debug 24 | DEBUG 25 | prompt 26 | 4 27 | x86_64 28 | None 29 | true 30 | 31 | 32 | none 33 | true 34 | bin\iPhoneSimulator\Release 35 | prompt 36 | 4 37 | None 38 | x86_64 39 | 40 | 41 | true 42 | full 43 | false 44 | bin\iPhone\Debug 45 | DEBUG 46 | prompt 47 | 4 48 | ARM64 49 | iPhone Developer 50 | true 51 | Entitlements.plist 52 | None 53 | -all 54 | 55 | 56 | none 57 | true 58 | bin\iPhone\Release 59 | prompt 60 | 4 61 | ARM64 62 | iPhone Developer 63 | Entitlements.plist 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | false 76 | 77 | 78 | false 79 | 80 | 81 | false 82 | 83 | 84 | false 85 | 86 | 87 | false 88 | 89 | 90 | false 91 | 92 | 93 | false 94 | 95 | 96 | false 97 | 98 | 99 | false 100 | 101 | 102 | false 103 | 104 | 105 | false 106 | 107 | 108 | false 109 | 110 | 111 | false 112 | 113 | 114 | false 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 1.4.2 130 | 131 | 132 | 133 | 134 | 135 | {31BD4EC8-A2CD-4AE5-96B9-BF81586B61FF} 136 | ffof 137 | 138 | 139 | -------------------------------------------------------------------------------- /ffof/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 18 | 19 | 21 | 24 | 27 | 28 | 29 | 34 | 35 | 36 | 38 | 39 | 40 | 42 | 43 | 44 | 62 | 63 | 64 | 65 | 70 | 71 | 73 | 1 74 | 1 75 | 1 76 | 1 77 | 1 78 | 1 79 | 1 80 | 1 81 | 82 | 83 | 84 | 85 | 89 | 90 | 91 | 92 | 93 | 98 | 99 | 101 | 1 102 | 1 103 | 1 104 | 1 105 | 1 106 | 1 107 | 1 108 | 1 109 | 110 | 111 | 112 | 113 | 115 | 119 | 121 | 128 | 132 | 133 | 134 | 136 | 137 |