New in version 0.28.0

Released 11 months ago

Please remember to uno clean your projects after upgrading Fuse.

Highlights

  • Fixed an issue in preview on macOS Sierra where ScrollView would misbehave and scroll too slowly.
  • Added router.modify to the JavaScript interface. This function can be used to provide more routing options, such as "Replace" mode and "Bypass" transitions.
  • Added CubicBezierEasing which allows you create custom easing curves with two control points.
  • A proper navigation interface is now implemented on Navigator. This allows Page bindings to work for the active navigator page, such as {Page Title}.

But there's so many smaller and larger updates this time that you should totally read the full list!

iOS 10
  • Fixed an issue with Promises resulting in an error: "Invalid private name '@undefined'"
TextInput
  • Fixed an issue on Android & iOS where <TextInput> could be seen for 1 frame on screen when it was supposed to be hidden / behind other visual elements.
New Instance behavior
  • Introduced <Instance>, which instantiates ux:Templates. Equivalent to <Each Count="1">, but reads better in UX and doesn't expose Count or Items.
  • Uno level: Extracted base class Instantiator from Each, which Instance also inherits.
Android Notification Icon

Users of Local & Push notifications on Android can now specify the icon to be used for the notification. This is done in the same fashion as the regular android icons. In your project's unoproj specify:

    {
        "Android": {
            "NotificationIcon": {
                "LDPI": "Icon-ldpi.png",
                "MDPI": "Icon-mdpi.png",
                "HDPI": "Icon-hdpi.png",
                "XHDPI": "Icon-xhdpi.png",
                "XXHDPI": "Icon-xxhdpi.png",
                "XXXHDPI": "Icon-xxxhdpi.png"
            }
        }
    }

The icon must adhere to the Android style guides. In short it must be white on a transparent background, any solid color will be converted to white by the Android build process, something which is outside of Fuse's control.

The behavior around default notification icon has also changed. Before we simply used the app icon. This meant that when the icon had color, the color was removed by android often resulting in an white square. With this change we will either:

  • Use the Android.NotificationIcon as specified above. Or if that is not specified we...
  • Use the Android.Icons setting from your unoproj. Or if that is not specified we...
  • Use the default notification icon, which is a small white Fuse logo.
Observable improvements
  • Added .subscribe(module) which can be used to create a dummy subscription on observables for the lifetime of the given module. This is an alternative to adding the observable to module.exports or using .onValueChanged in cases where you want to access the observable's value in a callback.
Layout info in JS
  • The Placed event now provides metadata to its argument to let you know more about the layout of an element in JS: .x, .y, .width and .height. Usage:
<JavaScript>
    function panel_placed(args) {
        args // contains information about the new size and position 
    }
</JavaScript>
...
<Panel Placed="{panel_placed}"/>
Pointer events in JS
  • Added localX and localY to pointer events in the JS API. This is the coordinate in the local coordinate space of the element that the event occurred on.
Video
  • Added support for rotation defined in the metadata of the video source. Only supported on iOS, Android and OSX. Due to a limitation in the Windows implementation this won't be supported on Windows for a while.
Easing improvements
  • Refactored Easing from an enum into a base class, to allow custom easing curves. (UX interface unchanged, Uno code should also be mostly unaffected).
Router
  • Added gotoRelative and pushRelative functions. These allow relative changes in route without needing to specify the full absolute path.
Shadow
  • Fixed <Shadow> so it still draws the shadow-rectangle when the element's color contains zero-alpha.
  • Fixed the Softness-parameter so it looks consistent across different display densities.
  • <Shadow> elements now understand that it's not always hip to be square! They'll now draw a round shadow rather than a rectangular one if their parent is a <Circle>
Support for resources in triggers
  • Triggers can now have resource nodes (marked with ux:Key) inside, and they will be added to the parent node when the node is active. This allows e.g. per-platform or conditional styling.

Example:

<iOS>
    <Font File="foo-ios.ttf" ux:Key="DefaultFont" />
</iOS>
<Android>
    <Font File="foo-android.ttf" ux:Key="DefaultFont" />
</Android>
<Text Font="{Resource DefaultFont}" />
Container
  • Added Container panel which allows you to build custom containers where children are placed under a custom node deeper in the tree.
Image
  • Added native support for Color on <Image>es that are inside <NativeViewHost>
  • Fixed an issue where <Image> inside <NativeViewHost> would be laid out wrong
Native views
  • Fixed issue where ZOrdering inside <NativeViewHost> did not behave properly
One-way data binding
  • Added one-way (read-only or write-only) binding types: {ReadProperty prop}, {WriteProperty prop}, {Read data} and {Write data}
TextInput
  • Removed ActionStyle from <TextView>. This is a <TextInput> specific property and it did not have any effect on <TextVIew>
  • Fixed iOS issue where AutoCorrect suggestions would not trigger value changed events if a <TextInput> or <TextView> lost focus.
  • Fixed issue where assigning a string with newlines to a <TextView TextWrapping="Wrap" /> would fail to wrap the text.
ImageFill
  • <ImageFills> now repeat the texture if a StretchMode like PixelPrecise or PointPrecise is used.
Animation
  • Fixed issue where animating TextColor did not presever the right init value
Image loading
  • Fixed a crash-bug when loading certain images on iOS
Added more control of PList in unoproj

We have added option to specify the following iOS plist entries from the unoproj file:

  • NSCalendarsUsageDescription
  • NSPhotoLibraryUsageDescription
  • NSBluetoothPeripheralUsageDescription
  • NSCameraUsageDescription
  • NSMicrophoneUsageDescription
  • NSAppleMusicUsageDescription
  • NSContactsUsageDescription
  • NSHomeKitUsageDescription
  • NSLocationAlwaysUsageDescription
  • NSLocationUsageDescription
  • NSLocationWhenInUseUsageDescription
  • NSMotionUsageDescription

They can be used as follows:

"iOS": {
    "PList": {
        "NSCameraUsageDescription": "ReasonA",
        "NSMicrophoneUsageDescription": "ReasonB",
        "NSPhotoLibraryUsageDescription": "ReasonC",
    }
}
Foreign Code

Foreign Java is a little more strict and does a little more type checking during the build.

  1. Action<object>s passed to Java will now have the type Action_UnoObject rather than Action_Object Action<Java.Object>s passed to Java will still have the type Action_Object
  2. If you make a foreign method with an argument with type object. You must pass an Uno object, not a java object.

Here is an example for point 2 that will no longer compile:

[Foreign(Language.Java)]
static string Foo()
@{
   Object jobj = MakeSomeJavaObject();
   @{Bar(object):Call(jobj)};
@}

[Foreign(Language.Java)]
static string Bar(object x)
@{
   ...
@}

The fix for the above would be to change Bar(object x) to Bar(Java.Object x) and @{Bar(object):Call(jobj)} to @{Bar(Java.Object):Call(jobj)}

Gradle Support
  • We can now build signed APKs with Gradle.
  • For users who run into platform specific filepath length limitations whilst build for Android with Gradle, you can now use the --set:AltBuildPath="/tmp" argument to specify the root of your android builds.
Xcode project generation and signing
  • Fixed a crash occuring when running multiple test fixtures on iOS devices
UX Compiler improvements
  • Binding syntax is now supported in shorthands such as <Change foo.bar="{binding}" /> and similar (bugfix).
  • Fixed bug where Font and other types that have required UX attributes (constructor arguments) could not be used as ux:Property