Skip to content

Commit

Permalink
uhm
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Jan 21, 2020
1 parent d860578 commit 0305116
Show file tree
Hide file tree
Showing 35 changed files with 341 additions and 413 deletions.
Binary file added KentekenShit.Android/Assets/star_regular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added KentekenShit.Android/Assets/star_solid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions KentekenShit.Android/KentekenShit.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="SkiaSharp.Extended" Version="1.60.0" />
<PackageReference Include="SkiaSharp.Svg" Version="1.60.0" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.1.1" />
<PackageReference Include="sqlite-net-pcl" Version="1.6.292" />
<PackageReference Include="Xamarin.Forms" Version="4.4.0.991477" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
Expand Down Expand Up @@ -97,5 +94,11 @@
<Name>KentekenShit</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Assets\star_regular.png" />
<EmbeddedResource Include="Assets\star_solid.png" />
<EmbeddedResource Include="Resources\drawable\star_regular.png" />
<EmbeddedResource Include="Resources\drawable\star_solid.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</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.
3 changes: 0 additions & 3 deletions KentekenShit.iOS/KentekenShit.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="SkiaSharp.Extended" Version="1.60.0" />
<PackageReference Include="SkiaSharp.Svg" Version="1.60.0" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.1.1" />
<PackageReference Include="sqlite-net-pcl" Version="1.6.292" />
<PackageReference Include="Xamarin.Forms" Version="4.4.0.991477" />
<PackageReference Include="Xamarin.Essentials" Version="1.3.1" />
Expand Down
16 changes: 8 additions & 8 deletions KentekenShit/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using KentekenShit.Services;
using KentekenShit.Views;
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using KentekenShit.Services;
using KentekenShit.Views;

namespace KentekenShit
{
Expand All @@ -11,10 +11,10 @@ public partial class App : Application

public App()
{
InitializeComponent();
InitializeComponent();

DependencyService.Register<MockDataStore>();
MainPage = new MainPage();
DependencyService.Register<MockDataStore>();
MainPage = new MainPage();
}

protected override void OnStart()
Expand Down
2 changes: 1 addition & 1 deletion KentekenShit/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using Xamarin.Forms.Xaml;
using Xamarin.Forms.Xaml;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
Binary file added KentekenShit/Assets/star_regular - Copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added KentekenShit/Assets/star_regular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added KentekenShit/Assets/star_solid - Copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added KentekenShit/Assets/star_solid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 0 additions & 79 deletions KentekenShit/Icon.cs

This file was deleted.

7 changes: 2 additions & 5 deletions KentekenShit/KentekenShit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="SkiaSharp.Extended" Version="1.60.0" />
<PackageReference Include="SkiaSharp.Svg" Version="1.60.0" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.1.1" />
<PackageReference Include="sqlite-net-pcl" Version="1.6.292" />
<PackageReference Include="Xamarin.Forms" Version="4.4.0.991477" />
<PackageReference Include="Xamarin.Essentials" Version="1.3.1" />
Expand All @@ -19,7 +16,7 @@
<EmbeddedResource Update="Views\DetailsPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="Assets\star-regular.svg" />
<EmbeddedResource Include="Assets\star-solid.svg" />
<EmbeddedResource Include="Assets\star_regular.png" />
<EmbeddedResource Include="Assets\star_solid.png" />
</ItemGroup>
</Project>
10 changes: 5 additions & 5 deletions KentekenShit/Models/HomeMenuItem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using System;
using System.Collections.Generic;
using System.Text;

namespace KentekenShit.Models
{
Expand All @@ -16,8 +16,8 @@ public enum MenuItemType
}
public class HomeMenuItem
{
public MenuItemType Id { get; set; }
public MenuItemType Id { get; set; }

public string Title { get; set; }
public string Title { get; set; }
}
}
28 changes: 14 additions & 14 deletions KentekenShit/Models/Item.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
using SQLite;
using System;
using SQLite;
using System;

namespace KentekenShit.Models
{
public class Item
{
[PrimaryKey, AutoIncrement]
public string Id { get; set; }
public string Text { get; set; }
public string Description { get; set; }
public string Id { get; set; }
public string Text { get; set; }
public string Description { get; set; }

public string Plate { get; set; }
public string Make { get; set; }
public string Seets { get; set; }
public string Cylinders { get; set; }
public string Doors { get; set; }
public string Wheels { get; set; }
public string Price { get; set; }
public string TaxiSign { get; set; }
public string Plate { get; set; }
public string Make { get; set; }
public string Seets { get; set; }
public string Cylinders { get; set; }
public string Doors { get; set; }
public string Wheels { get; set; }
public string Price { get; set; }
public string TaxiSign { get; set; }

public bool InFavoirites { get; set; }
public bool InFavoirites { get; set; }
}
}
16 changes: 8 additions & 8 deletions KentekenShit/Services/IDataStore.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace KentekenShit.Services
{
public interface IDataStore<T>
{
Task<bool> AddItemAsync(T item);
Task<bool> UpdateItemAsync(T item);
Task<bool> DeleteItemAsync(string id);
Task<T> GetItemAsync(string id);
Task<List<T>> GetItemsAsync(bool forceRefresh = false);
Task<bool> AddItemAsync(T item);
Task<bool> UpdateItemAsync(T item);
Task<bool> DeleteItemAsync(string id);
Task<T> GetItemAsync(string id);
Task<List<T>> GetItemsAsync(bool forceRefresh = false);
}
}
56 changes: 29 additions & 27 deletions KentekenShit/Services/MockDataStore.cs
Original file line number Diff line number Diff line change
@@ -1,65 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using KentekenShit.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using KentekenShit.Models;

namespace KentekenShit.Services
{
public class MockDataStore : IDataStore<Item>
{
readonly List<Item> items;
readonly List<Item> items;

public MockDataStore()
{
items = new List<Item>()
{
new Item {
new Item
{
Id = Guid.NewGuid().ToString(),
Plate="48XRFF",
Make="Toyota",
Seets="5",
Cylinders="4",
Doors="4",
Wheels="4",
Price="5",
TaxiSign="No",
Plate = "48XRFF",
Make = "Toyota",
Seets = "5",
Cylinders = "4",
Doors = "4",
Wheels = "4",
Price = "5",
TaxiSign = "No",
InFavoirites = true
},
};
};
}

public async Task<bool> AddItemAsync(Item item)
{
items.Add(item);
items.Add(item);

return await Task.FromResult(true);
return await Task.FromResult(true);
}

public async Task<bool> UpdateItemAsync(Item item)
{
var oldItem = items.FirstOrDefault(arg => arg.Id == item.Id);
items.Remove(oldItem);
items.Add(item);
var oldItem = items.FirstOrDefault(arg => arg.Id == item.Id);
items.Remove(oldItem);
items.Add(item);

return await Task.FromResult(true);
return await Task.FromResult(true);
}

public async Task<bool> DeleteItemAsync(string id)
{
var oldItem = items.FirstOrDefault(arg => arg.Id == id);
items.Remove(oldItem);
var oldItem = items.FirstOrDefault(arg => arg.Id == id);
items.Remove(oldItem);

return await Task.FromResult(true);
return await Task.FromResult(true);
}

public async Task<Item> GetItemAsync(string id)
{
return await Task.FromResult(items.FirstOrDefault(s => s.Id == id));
return await Task.FromResult(items.FirstOrDefault(s => s.Id == id));
}

public async Task<List<Item>> GetItemsAsync(bool forceRefresh = false)
{
return await Task.FromResult(items);
return await Task.FromResult(items);
}
}
}
Loading

0 comments on commit 0305116

Please sign in to comment.