Miscellaneous classes

ContentWidget class


Class responsible for creating the content widget.

Declared In

com.synerise.sdk.content.widgets.ContentWidget

Declaration

public class ContentWidget

Properties

There are no properties.

Initializers

There is a constructor.

public ContentWidget(ContentWidgetOptions contentWidgetOptions, ContentWidgetAppearance contentWidgetAppearance)

Methods

Setter for widget state.

public void setOnContentWidgetListener(OnContentWidgetListener listener)

Method responsible for returning widgetView.

public View getView()

Method to reload data.

public void load()

ContentWidgetAppearance class


Class responsible for configuring the content widget UI.

Declared In

com.synerise.sdk.content.widgets.model.ContentWidgetAppearance

Declaration

public class ContentWidgetAppearance

Properties

Property Type Optional Default Description
layout ContentWidgetBaseLayout no - Content widget layout
itemLayout ContentWidgetBaseItemLayout no - Single item layout

Initializers

There is a constructor.

public ContentWidgetAppearance(ContentWidgetBaseLayout layout, ContentWidgetBaseItemLayout itemLayout)

Methods

There are no methods.


ContentWidgetBaseItemLayout class


Class responsible for card layout configuration.

Declared In

com.synerise.sdk.content.widgets.layout.ContentWidgetBaseItemLayout

Declaration

public abstract class ContentWidgetBaseItemLayout

Inheriting classes

ContentWidgetBasicProductItemLayout

Properties

Property Type Optional Default Description
cardViewCornerRadius float no 0 Card view corner radius
cardViewElevation float no 0 Card view elevation

Initializers

There is only a default constructor.

Methods

There are no methods.

ContentWidgetBaseLayout class


Class responsible for widget layout configuration.

Declared In

com.synerise.sdk.content.widgets.layout.ContentWidgetBaseLayout

Declaration

public abstract class ContentWidgetBaseLayout

Properties

There are no properties.

Initializers

There are no constructors.

Inheriting classes

ContentWidgetGridLayout

ContentWidgetHorizontalSliderLayout

Methods

Sets cardview size. Any unit is acceptable, but remember to use the same unit across the whole widget.

public void setCardViewSize(int width, int height)

Returns the preferred width of a gridView.

public float getPreferredWidth()

Setter for preferredWidth of a gridView.

public void setPreferredWidth(float width)

ContentWidgetBasicProductItemLayout class


Class responsible for the configuration of item layout.

Declared In

com.synerise.sdk.content.widgets.layout.ContentWidgetBasicProductItemLayout

Declaration

public class ContentWidgetBasicProductItemLayout extends ContentWidgetBaseItemLayout

Properties

Property Type Optional Default Description
imageHeightToCardHeightRatio double no 0.6 Image height to card view height ratio. Max value is 1.
imageWidthToCardWidthRatio double no 1 Image width to card view width ratio
imageMargin int no - Image margin in px
itemTitleStyle Typeface no - Title style
itemTitleSize int no 12 Title size
itemTitleColor int no #000 Title color
itemTitleMarginLeft int no 0 Title left margin in dp
itemTitleMarginRight int no 0 Title right margin in dp
itemTitleMarginTop int no 0 Title top margin in dp
itemTitleMarginBottom int no 0 Title bottom margin in dp
itemPriceStyle Typeface no - Price style
itemPriceSize int no 12 Price size
itemPriceColor int no #000 Price color
itemTitleGravity int no Gravity.LEFT Title gravity
itemPriceGravity int no Gravity.LEFT Price gravity
itemPriceMarginLeft int no 0 Price left margin in dp
itemPriceMarginRight int no 0 Price right margin in dp
itemPriceMarginTop int no 0 Price margin top in dp
itemPriceMarginBottom int no 0 Price margin bottom in dp
itemSalePriceStyle Typeface no - Sale price style
itemSalePriceSize int no 12 Sale price size
itemSalePriceColor int no #000 Sale price color
itemSalePriceGravity int no Gravity.LEFT Sale price gravity
itemSalePriceMarginLeft int no 0 Sale price left margin in dp
itemSalePriceMarginRight int no 0 Sale price right margin in dp
itemSalePriceMarginTop int no 0 Sale price top margin in dp
itemSalePriceMarginBottom int no 0 Sale price bottom margin in dp
itemSalePriceOrientation int no LinearLayout.HORIZONTAL Sale price orientation
isItemSalePriceVisible boolean no false Sale price visibility flag
itemActionButton ImageButtonCustomAction no - Image action button
imageButtonCustomActionGravity int no Gravity.TOP Gravity.RIGHT
itemRegularPriceColor int no -1 Regular price color
itemRegularPriceSize int no -1 Regular price size
priceGroupSeparator char no ' ' Price group separator
priceDecimalSeparator char no ‘.’ Price decimal separator

Initializers

There are no initializers.

Methods

Setter for margins in ItemTitle.

public void setItemTitleMargins(int marginLeft, int marginRight, int marginTop, int marginBottom)

Setter for margins in ItemPrice.

public void setItemPriceMargins(int marginLeft, int marginRight, int marginTop, int marginBottom)

Setter for margins in ItemSalePrice.

public void setItemSalePriceMargins(int marginLeft, int marginRight, int marginTop, int marginBottom)

Setter for itemAction.

public void setItemAction(ImageButtonCustomAction itemImageButton)

ContentWidgetGridLayout class


Class responsible for grid layout configuration.

Declared In

com.synerise.sdk.content.widgets.layout.ContentWidgetGridLayout

Declaration

public class ContentWidgetGridLayout extends ContentWidgetBaseLayout

Properties

Property Type Optional Default Description
itemsPerRow int no 1 Number of items per row
cardViewVerticalSpacing int no 0 Card view vertical spacing
includeEdgeSpacing boolean no false Defines if edge spacing is included

Initializers

Constructor with the preferred width of a grid layout.

public ContentWidgetGridLayout(float prefferedWidth)

Methods

Sets cardview size. Any unit is acceptable, but remember to use the same unit across the whole widget.

public void setCardViewSize(int width, int height)

Returns the preferred width of a gridView.

public float getPreferredWidth()

Setter for the preferredWidth of a gridView.

public void setPreferredWidth(float width)

ContentWidgetOptions class


Class responsible for configuration of the data content widget.

Declared In

com.synerise.sdk.content.widgets.model.ContentWidgetOptions com.synerise.sdk.content.widgets.model.ContentWidgetRecommendationsOptions

Declaration

public class ContentWidgetRecommendationsOptions

Properties

Property Type Optional Default Description
activity Activity no - Activity
slug String no - Slug name
attributes HashMap <String, Object> no - Attribute value
ContentWidgetOptionsAttributeKeyProductId String no - Final flag to add to attributes
mapper OnRecommendationModelMapper no - Mapper responsible for mapping RecommendationResponse

Initializers

There is a constructor.

public ContentWidgetRecommendationsOptions(@NonNull Activity activity, @NonNull String slug, OnRecommendationModelMapper mapper)

Methods

There are no methods.


ContentWidgetSliderLayout class


Class responsible for slider layout configuration.

Declared In

com.synerise.sdk.content.widgets.layout.ContentWidgetHorizontalSliderLayout

Declaration

public class ContentWidgetHorizontalSliderLayout extends ContentWidgetBaseLayout

Properties

There are no properties.

Initializers

There is only a default constructor.

Methods

Sets cardview size. Any unit is acceptable, but remember to use the same unit across the whole widget.

public void setCardViewSize(int width, int height)

Returns the preferred width of a gridView.

public float getPreferredWidth()

Setter for the preferredWidth of a gridView.

public void setPreferredWidth(float width)

ApiError class


Class responsible for managing errors.

Declared In

com.synerise.sdk.error.ApiError

Declaration

public class ApiError

Properties

Property Type Optional Default Description
errorBody ApiErrorBody no - API Error Body
httpErrorCategory HttpErrorCategory no - HTTP error category
errorType ErrorType no - Error type
httpCode int no - HTTP error code
throwable Throwable no - Android throwable
Note: All of the properties above are accessible by using getters.

Initializers

There are no initializers.

Methods

Prints stack trace on original Throwable instance.

public void printStackTrace()

ApiErrorBody class


Class responsible for providing the API error body.

Declared In

com.synerise.sdk.error.ApiErrorBody

Declaration

public class ApiErrorBody implements Serializable

Properties

Property Type Optional Default Description
error String no - String representation of the returned HTTP status code
message String no - Error message
path String no - Endpoint path in which the error has occurred
status int no - Error’s HTTP status code
errorCauses List<ApiErrorCause> yes - Optional list of error causes, mostly occurs when 400 http code is returned
Note: All of the properties above are accessible by using getters.

Initializers

There are no initializers.

Methods

There are only getters.


ApiErrorCause class


Class responsible for providing the API error cause.

Declared In

com.synerise.sdk.error.ApiErrorCause

Declaration

public class ApiErrorCause implements Serializable

Properties

Property Type Optional Default Description
field String yes - Main error cause, for example the field which failed validation
message String yes - Error message
code int no - Unique error cause code
rejectedValue String yes - Optional rejected value
Note: All of the properties above are accessible by using getters.

Initializers

There are no initializers.

Methods

There are only getters.


ErrorType enum


This enum contains values for error types.

Declared In

com.synerise.sdk.error.ErrorType

Declaration

public enum ErrorType

Values

Property Description
HTTP_ERROR HTTP error
NETWORK_ERROR Network error
NO_TOKEN No token
UNKNOWN Unknown error type

Methods

There are no methods.

HttpErrorCategory enum


This enum contains values for HTTP error categories.

Declared In

com.synerise.sdk.error.HttpErrorCategory

Declaration

public enum HttpErrorCategory

Values

Property Value Description
BAD_REQUEST 400 Bad request
UNAUTHORIZED 401 Unauthorized (no token, wrong token)
FORBIDDEN 403 Forbidden (insufficient permissions)
NOT_FOUND 404 Resource not found
RANGE_NOT_SATISFIABLE 416 Range not satisfiable
SERVER_ERROR 500-599 Server error
UNKNOWN -1 Unknown error

Methods

Get HTTP error category.

public static HttpErrorCategory getHttpErrorCategory(int code)

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker