Skip to content

Release Notes Gorilla Player 1.5

Leo Rodríguez edited this page Nov 7, 2018 · 1 revision

Overview

This release is focused on three main things:

  1. Making easier to work with Gorilla by introducing the AutoConfig feature and adding some design time data helpers.
  2. Expanding Xamarin Forms feature support (CSS, Resource Dictionaries)
  3. Bug fixing

Very Important: The Gorilla Player mobile app available in stores was removed in this release. It caused much confusion about its usage. Originally was conceived as a basic XAML previewer, something that is much better done nowadays by Visual Studio previewer, so it doesn't make sense to maintain it anymore. For real life scenarios (i.e.: Derived pages, custom renderers, localization, etc.) please use Gorilla SDK. In this release we added the Gorilla SDK AutoConfig which greatly simplifies using it.

Features

Auto Config (BETA)

Manually Configuring Gorilla SDK can be challenging, so we created the SDK auto configuration feature with easiness of use in mind.

You can start using it through a new nuget package:

UXDivers.GorillaPlayer.SDK.AutConfig

Using this package setting up Gorilla is as easy as:

  1. Adding the package to your platform specific project
  2. Define the GORILLA symbol in your project configuration

The animated gif below shows how it works, by setting up Gorilla to preview the Conference Vision app created by David Ortinau for the Build 2018 Conference.

Conference Vision App

And here are the steps you must follow:

  1. Clone the Conference Vision repo
  2. Add Gorilla nuget package UXDivers.Gorilla.SDK.AutoConfig to the ConferenceVision.iOS project
  3. Add GORILLA as an additional symbol to the Debug configuration, so the app starts in Preview Mode
  4. (Optional) Add two files to the ConferenceVision project:
  1. Run the app, connect to the server and start previewing.

Note: This package is still in Beta, so make sure to enable pre-release nugets to see this package available!

The original Gorilla SDK nuget package can still be used for scenarios where further customization is required. For more information about check configuring Gorilla SDK on Gorilla's wiki.

CSS Stylesheets

Added support for CSS stylesheets. Stylesheets can be inline or referenced using the <StyleSheet Source=...> tag. The following gif illustrates this.

Little Things Playground

Resource Dictionaries

Added support for ResourceDictionary Source property and added support for implicit Resource Dictionaries.

Object references within Design Time Data

Now any JSON object defined within the DesignTimeData.json can be referenced in multiple locations of the same file. This avoid the need to duplicate data to be used in different pages of an application.

Referencing an object implies:

  • Defining an identifier to the referenced object. This is done by adding a field $id to the object whose value is the identifier. The identifier must be a string.
  • Referencing the object by creating an object whose only attribute is $ref and its value is the identifier of the object being referenced.

This is done in the same way JSON.NET handle object references by default.

The following illustrates its usage.

{
  "AchievementsView.xaml": {
    "Achievements": [
      {
        "$id": "1",
        "Name": "Xamarin",
        "Icon": "iconXamarin",
        "Url": "https://docs.microsoft.com/en-us/xamarin/xamarin-forms/"
      },
      {
        "$id": "2",
        "Name": "Xamarin University",
        "Icon": "iconXamarinUniversity",
        "Url": "https://university.xamarin.com"
      },

      .....
    ]
  },

  "AchievementItemTemplate.xaml": { 
    "$ref": "1" 
  }
}

Loading Data from file

The value of a field in the DesignTimeData.json can be set to be loaded from a different file. This is useful when loading big text files or in order to split JSON files.

Here's the way you must specify it:

$file$<FIELD_NAME>#<PATH_TO_FILE>

Fields that need to be loaded from a file should start with $file$, followed by the name of the field (MarkdownContent in below's sample), followed by # and followed by the path to the file.

Bellow is an example showing how to load a markdown file into a field named MarkdownContent.

{
  "HomeworkView.xaml": {
    "$file$MarkdownContent#./Resources/Activity_StartHere.md": null 
  }
}

The path could be absolute or relative. The value of the field is the default value in case the file is not found. If the file is a json file it will be parsed as json, otherwise it will be parsed as text.

Custom Navigation Page

Until now, Gorilla only allows to specify which pages should be previewed within a NavigationPage. This uses the default NavigationPage class to wrap the page.

Starting from now it is also possible to specify which class should be used to wrap the page. Typically a subclass of NavigationPage.

This can be done using the navigationPageClass within the navigationPage property of the gorilla.json.

The following example illustrates this:

    "navigationPage": {
        "all": false, 
        "include": [
          {
            "file": "ArticlesClassicViewPage.xaml",
            "navigationPageClass": "UXDivers.Grial.Templates.MessagesNavigationPage, UXDivers.Grial.Templates" 
          },
          {
            "file": "ArticlesFeedPage.xaml",
            "navigationPageClass": "UXDivers.Grial.Templates.EcommerceNavigationPage, UXDivers.Grial.Templates"
          },
          {
            "file": "ArticlesListPage.xaml",
            "navigationPageClass": "UXDivers.Grial.Templates.MoviesNavigationPage, UXDivers.Grial.Templates"
          }
        ],
    ...

The navigationPageClass settings are taken into account even if the navigationPage.all property is set to true.

The navigationPageClass must be specified using the full qualified name of the class. If the assembly is not specified, it will not be able to find it at runtime.

You can also specify the default navigation page class to be used using defaultNavigationPageClass as in the following example:

    "navigationPage": {
      "defaultNavigationPageClass": "UXDivers.Grial.Templates.EcommerceNavigationPage, UXDivers.Grial.Templates",
        "all": true, 
        ...

Bug Fixes

GitHub Description
N/A Fixed order issue while resolving Merged Dictionaries
N/A Consider StyleClass when merging dictionaries
N/A Set english as the default culture when multiple cultures are defined and the current one can't be determined
N/A Fixed Gorilla's UI issues in iPhoneX.
N/A Fixed issues with static resourced within ContentView included in the AvoidExpansion list of Gorilla.json.
N/A Removed limitation of having only one image property per Tag. Now there could be up to 5 images per tag.
#303 Fixed issue causing Error resolving assemblies for modernhttpclient
N/A Fixed issue of DynamicResources being reported as missing when they are not defined.
N/A Fixed issues of Control Templates not being correctly previewed.
N/A Fixed issue of Images used as properties of a Control Template not being correctly previewed.
N/A Fixed issue when added/removed files are not being correctly detected in .NET Standard project.
N/A Improve performance while opening the solution.
N/A Fixed issues with converters returning ImageSource objects.
N/A Fixed errors occurring when the XAML contains nested DataTemplates.
N/A Correctly handle xml-namespaces declared with the using keyword.