Skip to content

5.2.1

Compare
Choose a tag to compare
@amrox amrox released this 15 Aug 21:46
· 46 commits to master since this release
0620181

New Features

Exit to Search Results page:

Since your users return to your application to finalize a purchase and checkout, the Slyce SDK now provides an additional exit point from our Full UI mode back to your application. In 5.2.0 we introduced the ability to exit when a user navigates to a product detail page. In 5.2.1 we are introducing the ability to exit the Slyce SDK when a search completes. You listen for an event to exit to a search result page and are provided an array-like object with details about the products the Slyce SDK found based on the user-submitted image.
exit to search results 001

To implement an exit from Slyce Full UI mode, you override the default action and display your view.

public class CustomCameraActivity extends SlyceCustomActivity {

    @Override
    public boolean shouldDisplayDefaultItemDetailLayerForItem(SlyceItemDescriptor itemDescriptor) {
        let item = itemDescriptor.getItem();
        // Launch your Activity here after retrieving the desired data from the item descriptors.
        return false;
    }

    @Override
    public boolean shouldDisplayDefaultListLayerForItems(List<SlyceItemDescriptor> itemDescriptors) {
        // Loop through the itemDescriptor to get the needed data
        for (SlyceItemDescriptor itemDescriptor : itemDescriptors) {
            // To get raw item json, use 'itemDescriptor.getItem()'
            itemDescriptor.getItem()
            // Alternatively, to get item ids
            itemDescriptor.getId()
        }
        // Launch your Activity here after retrieving the desired data from the item descriptors.
        return false;
    }
}

Upgrade Note:
If you were previously utilizing the exit to product detail page, you need to include the override for both methods.

Included Color Theming

You can now set custom colors via the Slyce Theme.

Slyce.getInstance(MainActivity.this).setARGBColor(PROPERTY_VALUE_HERE, VALUE_HERE)

Color properties you can set:

  • global_accent_color - Color for any buttons and other elements on a view that are important to highlight.
  • global_error_color - Color for rendering any error messages or views.
  • global_primaryBackground_color - Background color used for the layer header.
  • global_secondaryBackground_color - Background color the content area of the pages.
  • global_primaryForeground_color - Color color for any important labels or elements in a view.
  • global_secondaryForeground_color - Color for any additional labels or elements in a view.

Bug Fixes:

We discovered the way the timezone was being passed was causing some issues calculating some metrics with our analytics. This has been resolved in the 5.2.1 release, and we highly recommend the upgrade if you are utilizing the Slyce Analytics.

API Changes

Initializing Full UI

To more easily start Full UI mode, we removed the need to pass in a list of lens Ids. The lens Ids are now passed in from the remote configuration that the SDK pulls down on initialization. When utilizing picker mode, this allows you to enable or disable the Image Match, Barcode, or Visual Search lens without having to update your code. The previous way has been deprecated but continues to function in 5.2.1. Please update your code to launch full UI mode utilizing Picker or Universal instead of passing a list of Ids.

Deprecated

// Picker Mode
SlyceUI.startSlyceActivity(MainActivity.this, Slyce.getInstance(MainActivity.this), lensIds);

// Universal Mode
SlyceUI.startSlyceActivity(MainActivity.this, Slyce.getInstance(MainActivity.this), LENS_ID_UNIVERSAL);

New Way

// Picker Mode
SlyceUI.startSlyceActivity(MainActivity.this, Slyce.getInstance(MainActivity.this), SlyceActivityMode.PICKER);

// Universal Mode
SlyceUI.startSlyceActivity(MainActivity.this, Slyce.getInstance(MainActivity.this), SlyceActivityMode.UNIVERSAL);