Skip to content

Commit

Permalink
Added StarWars Sample (#63)
Browse files Browse the repository at this point in the history
* Initial commit

* iOS initial screens

* Twitter cover iOS // Droid initial screens

* Android MainView / PlanetsView initial commit

* Fixed splashscreen theme

* Added planet destroyed logic

* Added Acr.UserDialogs and prompt user before destroying

* Added iOS PlanetsView

* Added iOS LaunchScreen and improved PlanetView

* Added Oxyplot sample

* Added Droid PlanetView // Improved droid planets view

* Added BaseViewModel and localized strings through .resx

* Added destroy animation

* Renamed iOS CustomViews -> CustomControls
Simplified target TableViewCell

* Added MenuView options

* Improved Statistics styling // Fixed close command

* Droid PeopleView improvements
Added scroll flag to viewgroups

* Droid MenuView // MenuViewModel improvements

* Added lottie animations (iOS)

* Added lottie animation to Android
Use MvxInteraction on PlanetViewModel
Droid visual improvements

* Use MvxInteraction on iOS

* Added Droid app icons

* improved Droid MenuView header

* Added Droid StatusView // Removed unused code in PlanetView

* Added iOS app icons

* Added SplashScreen
Fixed OxyPlot error
Installed CircleImage plugin

* Android PersonView // PersonViewModel

* Fix droid backstack count

* Added iOS assets // Improved iOS header // Added iOS LaunchScreen

* Improved iOS MenuOption // Added img background to MenuView

* Added iOS missing assets

* Implement iOS PersonView

* Use new MvxNavigationService

* iOS: Add background image to status screen

* Added custom AppStart and use NavigationService from the start

* Rename core project and namespace to match MvvmCross convention

* Renamed paths to match MvvmCross convention

* Added MvxSwipeRefreshLayout and droid custom binding
Fixed droid animation progress
Made MVVM properties private

* Updated iOS list views to include MvxUIRefreshControl

* Edited iOS TwitterCoverImageView: Remove hardcoded width and unused code

* Added .pdf files

* Added artwork and iOS menu

* Improved README file

* Simplify MvxInteraction props

* Simplify layout namespace

* Updated solution to MvvmCross 5.0.5
  • Loading branch information
nmilcoff authored and martijn00 committed Jul 1, 2017
1 parent 32988ff commit df9a33c
Show file tree
Hide file tree
Showing 183 changed files with 16,827 additions and 0 deletions.
Binary file added StarWarsSample/Artwork/Android.pdf
Binary file not shown.
Binary file added StarWarsSample/Artwork/UWP.pdf
Binary file not shown.
Binary file added StarWarsSample/Artwork/iOS.pdf
Binary file not shown.
Binary file added StarWarsSample/Artwork/macOS.pdf
Binary file not shown.
41 changes: 41 additions & 0 deletions StarWarsSample/README.md
@@ -0,0 +1,41 @@
# StarWars Sample!

This is a comprehensive sample that showcases some MvvmCross features and integrations with some other components.

It is currently available for Android and iOS. MacOS and UWP versions are planned as well.

Checkout the "Artwork" folder to look at the designs for those platforms.

## Features

### Shared (Core and all platforms)
- MvxCommands
- [MvxInteraction](https://www.mvvmcross.com/documentation/fundamentals/mvxinteraction)
- `INotifyTaskCompletion` from [Async.Ex](https://github.com/StephenCleary/AsyncEx) (note: use version 3.0.1 or latest with NetStandard)
- Localization through .resx files
- [IMvxNavigationService](https://www.mvvmcross.com/documentation/fundamentals/navigation)
- [Color plugin](https://www.mvvmcross.com/documentation/plugins/color)
- [Visibility plugin](https://www.mvvmcross.com/documentation/plugins/visibility)
- Super simple REST client
- Infinite lists
- Charts from [OxyPlot](http://www.oxyplot.org/)

### Android
- Support packages
- Fragments (also MvxFragmentsPresenter)
- `DrawerLayout`, `CoordinatorLayout`, `CollapsingToolbarLayout`, `MvxRecyclerView`, `MvxSwipeRefreshLayout`
- Custom MvxBindings
- Custom controls
- Infinite lists
- [Lottie animations](https://github.com/martijn00/LottieXamarin)
- DataBinding in .axml and .cs

### iOS
- [MvxIosViewPresenter](https://www.mvvmcross.com/documentation/platform/ios-view-presenter) (tabs)
- `MvxUIRefreshControl`, `MvxTableViewCell`, `MvxSimpleTableViewSource`
- Custom MvxBindings
- Custom controls
- Coded UIs using [FluentLayout](https://github.com/FluentLayout/Cirrious.FluentLayout)
- Infinite lists
- [Lottie animations](https://github.com/martijn00/LottieXamarin)
- DataBinding in .cs
31 changes: 31 additions & 0 deletions StarWarsSample/StarWarsSample.Core/App.cs
@@ -0,0 +1,31 @@
using Acr.UserDialogs;
using MvvmCross.Core.ViewModels;
using MvvmCross.Platform;
using MvvmCross.Platform.IoC;

namespace StarWarsSample.Core
{
public class App : MvxApplication
{
public override void Initialize()
{
CreatableTypes()
.EndingWith("Service")
.AsInterfaces()
.RegisterAsLazySingleton();

CreatableTypes()
.EndingWith("Client")
.AsInterfaces()
.RegisterAsLazySingleton();

Mvx.RegisterSingleton<IUserDialogs>(() => UserDialogs.Instance);

Mvx.ConstructAndRegisterSingleton<IMvxAppStart, AppStart>();
var appStart = Mvx.Resolve<IMvxAppStart>();

// register the appstart object
RegisterAppStart(appStart);
}
}
}
14 changes: 14 additions & 0 deletions StarWarsSample/StarWarsSample.Core/AppColors.cs
@@ -0,0 +1,14 @@
using System;
using MvvmCross.Platform.UI;

namespace StarWarsSample.Core
{
public static class AppColors
{
public static MvxColor PrimaryColor = new MvxColor(26, 26, 26); // #1a1a1a

public static MvxColor DarkPrimaryColor = MvxColors.Black;

public static MvxColor AccentColor = new MvxColor(193, 39, 44); // #C1272C
}
}
22 changes: 22 additions & 0 deletions StarWarsSample/StarWarsSample.Core/AppStart.cs
@@ -0,0 +1,22 @@
using System;
using MvvmCross.Core.Navigation;
using MvvmCross.Core.ViewModels;
using StarWarsSample.Core.ViewModels;

namespace StarWarsSample.Core
{
public class AppStart : MvxNavigatingObject, IMvxAppStart
{
private readonly IMvxNavigationService _mvxNavigationService;

public AppStart(IMvxNavigationService mvxNavigationService)
{
_mvxNavigationService = mvxNavigationService;
}

public void Start(object hint = null)
{
_mvxNavigationService.Navigate<MainViewModel>();
}
}
}
9 changes: 9 additions & 0 deletions StarWarsSample/StarWarsSample.Core/Constants.cs
@@ -0,0 +1,9 @@
using System;

namespace StarWarsSample.Core
{
public static class Constants
{
public const string BaseUrl = "https://swapi.co/api";
}
}
23 changes: 23 additions & 0 deletions StarWarsSample/StarWarsSample.Core/Models/Film.cs
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;

namespace StarWarsSample.Core.Models
{
public class Film
{
public string Title { get; set; }
public int EpisodeId { get; set; }
public string OpeningCrawl { get; set; }
public string Director { get; set; }
public string Producer { get; set; }
public string ReleaseDate { get; set; }
public List<string> Characters { get; set; }
public List<string> Planets { get; set; }
public List<string> Starships { get; set; }
public List<string> Vehicles { get; set; }
public List<string> Species { get; set; }
public string Created { get; set; }
public string Edited { get; set; }
public string Url { get; set; }
}
}
16 changes: 16 additions & 0 deletions StarWarsSample/StarWarsSample.Core/Models/PagedResult.cs
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;

namespace StarWarsSample.Core.Models
{
public class PagedResult<T> where T : class
{
public int Count { get; set; }

public string Next { get; set; }

public string Previous { get; set; }

public IEnumerable<T> Results { get; set; }
}
}
25 changes: 25 additions & 0 deletions StarWarsSample/StarWarsSample.Core/Models/Person.cs
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;

namespace StarWarsSample.Core.Models
{
public class Person
{
public string Name { get; set; }
public string Height { get; set; }
public string Mass { get; set; }
public string HairColor { get; set; }
public string SkinColor { get; set; }
public string EyeColor { get; set; }
public string BirthYear { get; set; }
public string Gender { get; set; }
public string Homeworld { get; set; }
public List<string> Films { get; set; }
public List<string> Species { get; set; }
public List<string> Vehicles { get; set; }
public List<string> Starships { get; set; }
public string Created { get; set; }
public string Edited { get; set; }
public string Url { get; set; }
}
}
23 changes: 23 additions & 0 deletions StarWarsSample/StarWarsSample.Core/Models/Planet.cs
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;

namespace StarWarsSample.Core.Models
{
public class Planet
{
public string Name { get; set; }
public string RotationPeriod { get; set; }
public string OrbitalPeriod { get; set; }
public string Diameter { get; set; }
public string Climate { get; set; }
public string Gravity { get; set; }
public string Terrain { get; set; }
public string SurfaceWater { get; set; }
public string Population { get; set; }
public List<string> Residents { get; set; }
public List<string> Films { get; set; }
public string Created { get; set; }
public string Edited { get; set; }
public string Url { get; set; }
}
}
@@ -0,0 +1,8 @@
using System;
namespace StarWarsSample.Core.MvxInteraction
{
public class DestructionAction
{
public Action OnDestroyed { get; set; }
}
}
26 changes: 26 additions & 0 deletions StarWarsSample/StarWarsSample.Core/Properties/AssemblyInfo.cs
@@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("StarWarsSample.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

0 comments on commit df9a33c

Please sign in to comment.