Skip to content

Commit

Permalink
Refactoring (#29)
Browse files Browse the repository at this point in the history
* Create ItemsPage, add Description property to deals. TODO: Add resources to iOS, create borders between frames

* Create iOS assets

* Add separators

* Apply style inheritance

* Fix and refactor deal page

* Fix UI

Contains minor user interface changes and some spacing corrections

* Change navigation bar colour to white, navigation arrow colour to black

* Add private accessifiers to SelectionChanged methods. Create special sorted by the percentage change between previous cost and current cost

* Add rating count. Create rate button, rate popup. Implement rating change

* Rename FoodPlacesPage and ItemsPage. Create rating reseter

* Add accent colour. Fix deal frame layout and search bar layout

* Add property changed method

* Change status bar colour. Remove unecessary padding

* Add search bar validation

* Order page sketch. Not well tested

* Fix stepper bug

* Add comments. Slight refactoring

* Partially implement search page place choices

* Add new properties. Add a little bit of styling to allPlacesButton

* Update FoodPlacePage.xaml

Make comment more accurate

* Fix food place page

* Rewrite user rating UI

* Rename ItemPage to DealpPage. Make DealPage scroll. Handle exceptions when initializing a deal with 0 quantity

* Add Coordinates struct

* Add rounded corners to home page

* Delete Coordinates struct. Order places by location

* Fix scroll height in a hacky way. Open issue: xamarin/Xamarin.Forms#6451

* Add location permissions for iOS devices

* Add costs struct

* Fix card shadows

* Add indexers. Save data to file

* Fix file read error

* Add groupJoin

* Implement rating setting

* Save ratings to file. Change SelectedStarValue according to the previous rating

* Remove selected item colour. Add PlaceType to FoodPlace to be able to save data

* Add fixed button widths

* Rewrite LINQ queries

Co-authored-by: artur-masalcev <arturmasalcev@gmail.com>
  • Loading branch information
Mantas330BJ and artur-masalcev authored Oct 12, 2021
1 parent 4ff6348 commit 0368b0f
Show file tree
Hide file tree
Showing 58 changed files with 18,609 additions and 3,293 deletions.
3 changes: 3 additions & 0 deletions Wasted.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Android.OS;
using Android.Views;
using AndroidX.Core.Content;
using Acr.UserDialogs;

namespace Wasted.Droid
{
Expand All @@ -14,7 +15,9 @@ protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

Rg.Plugins.Popup.Popup.Init(this);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
UserDialogs.Init(this);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
}
Expand Down
16 changes: 11 additions & 5 deletions Wasted.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?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.wasted">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:label="Wasted.Android" android:theme="@style/MainTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:label="Wasted.Android" android:theme="@style/MainTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
</manifest>
16,837 changes: 14,196 additions & 2,641 deletions Wasted.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

Binary file added Wasted.Android/Resources/drawable/item_due.png
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.
Binary file added Wasted.Android/Resources/drawable/item_quantity.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 Wasted.Android/Resources/drawable/star_fill.png
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.
10 changes: 8 additions & 2 deletions Wasted.Android/Resources/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
<item name="android:navigationBarColor">@android:color/black</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:statusBarColor">@android:color/white</item>"
<item name="android:windowLightStatusBar">true</item>
<item name="colorPrimary">@android:color/white</item>
<item name="colorAccent">@color/blue</item>
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>

<style name="DrawerArrowStyle" parent="@style/Widget.AppCompat.DrawerArrowToggle">
<item name="color">@android:color/black</item>
</style>
</resources>
20 changes: 20 additions & 0 deletions Wasted.Android/Wasted.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Acr.UserDialogs">
<Version>7.1.0.514</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>
Expand Down Expand Up @@ -153,12 +156,29 @@
<Generator>
</Generator>
</AndroidResource>
<AndroidResource Include="Resources\drawable\star_fill.png">
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
<AndroidResource Include="Resources\drawable\star_outline.png">
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Wasted\Wasted.csproj">
<Project>{CD72773B-6891-4AF8-9F2C-DF849075C540}</Project>
<Name>Wasted</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\item_location.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\item_due.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\item_quantity.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
2 changes: 2 additions & 0 deletions Wasted.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Rg.Plugins.Popup.Popup.Init();

global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());

Expand Down
Loading

0 comments on commit 0368b0f

Please sign in to comment.