Before anything make sure your walked through these required steps before starting the integration of Sashimi.

The templates are Android's View subclasses which you need to take care once you got them from our library. But please don't overlay anything that could prevent us to get the clicks events.

Sashimi Templates

We currently provide two ready to use templates:

  • Sashimi Minimal: this template is very compact and only contains essential information.
  • Sashimi Extended: this template is rich template using a part of the minimal format with a creative on top of it.

Templates layout

Preview

These templates are highly customizable to make the Sashimi Ad Units really blend in your application.
Check the AFAdSDKSashimiView class documentation to access to the customizable properties.
If you want more customization, you can create you own Sashimi. Please read the Custom Mode section.

They are bundled with two predefined color schemes, in light and dark modes.

Here are examples of ads using the templates in light and dark modes.

Sashimi Minimal
Sashimi Minimal Light
Sashimi Minimal Dark
Sashimi Extended
Sashimi Extended Light
Sashimi Extended Dark

Architecture

To have an idea of the architecture of the Sashimi templates, take a look at these diagrams.



Sashimi Minimal Layout




Sashimi Extended Layout

Specifications

Dimensions

For each templates we provide sizing recommendations to fully benefit the predefined designs:
* Sashimi Minimal: We recommend a size of 300 x 100
* Sashimi Extended: We recommend a size of 300 x 275

Resizing

Please note that the minimum allowed size for a Sashimi view is 30x30, if your view is smaller than that we will not take your impressions and clicks into account. Please verify your view respect those requirements.

While we recommend those dimensions, the templates are fairly flexible. Below you'll find a symbolized preview of the resize-ability of the Sashimi formats:



Sashimi Minimal




Sashimi Extended

Code Integration

Sashimi ad units become available asynchronously after you called the SDK's prepare() method. See these required steps. Once Sashimi ad units are available for immediate display:

  • The SDK calls onInStreamAdAvailable() in your event handler, if you did define one.
  • Your app, polling numberOfSashimiAdsAvailableForFormat(), will be returned the number of Sashimi ads of that format that are readily available, making it known that you can now display Sashimi ads as well.

To use a Sashimi with a minimal template, request an Android view of a Sashimi as such:

AFAdSDKSashimiView sashimiView = null;

// Request Minimal Sashimi

if (adSdk.numberOfSashimiAdsAvailableForFormat ("SASHIMI_ZONE_ID", AFAdSDKSashimiFormat.AFAdSDKSashimiFormatMinimal) != 0) {
    sashimiView = adSdk.sashimiViewForFormat ("SASHIMI_ZONE_ID", AFAdSDKSashimiFormat.AFAdSDKSashimiFormatMinimal, new AFAdSDK.AFAdSizeProvider () {
        @Override
        public AFAdSize provideSize() {
            AFAdSDK.AFAdSize size = new AFAdSDK.AFAdSize();

            size.width = 300; // Just an example - calculate the actual size in pixels that you need
            size.height = 100;
            return size;
        }
    }, this);
}

if (sashimiView != null) {
   // Insert view in my app's layout...
}

The minimal template shows the app's icon, title, category, tagline and price.

This example checks that an ad of type AFAdSDKSashimiFormat.AFAdSDKSashimiFormatMinimal is available, and if yes, requests that the SDK create an android View with a Sashimi ad in that format. Your app tells the SDK the size of the view that it needs using a AFAdSizeProvider as demonstrated in the example. Note that the size provider will be called every time the app's layout changes (screen orientation changed, menubar appearing or disappearing..) and can therefore supply an updated size as needed. The hardcoded values in the example are just there to keep the sample code small, you will need to calculate the right size for your app.

SASHIMI_ZONE_ID is the zone ID for Sashimi in-stream ads, as provided by Appsfire.

You can also customize the template. To use a dark layout rather than light:

sashimiView.setStyleMode(AFAdSDKSashimiStyleMode.AFAdSDKSashimiMinimalStyleModeDark);

You can also fully set custom colors, for instance:

sashimiView.setContentBackgroundColor(0xff444488);
sashimiView.setTitleTextColor(0xffaaefff);
sashimiView.setCategoryTextColor(0xff88cfff);
sashimiView.setTaglineTextColor(0xffaaefff);
sashimiView.setPriceBackgroundColor(0xff357abd);
sashimiView.setPriceTextColor(0xffaaefff);
sashimiView.setIconBorderColor(0xffaaeeff);

Sashimi ad also come in an extended template that shows all the information from the minimal template, as well as an artfully placed screenshot. To request
an extended Sashimi ad view, use code similar to the following:

// Request extended Sashimi
if (adSdk.numberOfSashimiAdsAvailableForFormat("SASHIMI_ZONE_ID", AFAdSDKSashimiFormat.AFAdSDKSashimiFormatExtended) != 0) {
    sashimiView = adSdk.sashimiViewForFormat ("SASHIMI_ZONE_ID", AFAdSDKSashimiFormat.AFAdSDKSashimiFormatExtended, new AFAdSDK.AFAdSizeProvider () {
        @Override
        public AFAdSize provideSize() {
            ...
        }
    }, this);
    ...
}

Again SASHIMI_ZONE_ID is the zone ID for Sashimi in-stream ads, as provided by Appsfire.

Once you have removed the Sashimi view from your layout, you are required to inform the sdk like so:

m_adSdk.releaseSashimiView (sashimiView);

We recommend that you please check the appsfire_adUnitSampleApp as well, for a fully buildable example of using Sashimi ads.