# SDK Native - Customizations

## Native SDK — Customizations

> **Prerequisite:** Complete the [Native SDK - Quick Start](/android/sdk-native.md) first.

These customizations require **no custom layout XML** — you configure the built-in default renderer or extend it with small tweaks.

***

### 1. Configuration Options

#### 1.1 Scroll Direction

```java
// Horizontal (default)
adView.setOrientation(RecyclerView.HORIZONTAL);

// Vertical list
adView.setOrientation(RecyclerView.VERTICAL);
```

<figure><img src="/files/TcozUKbx7iiatCVbNGej" alt=""><figcaption></figcaption></figure>

#### 1.2 Maximum Number of Campaigns

```java
adView.setMaxCampaigns(5);   // Show at most 5 campaigns
adView.setMaxCampaigns(10);  // Show all (default)
```

#### 1.3 Nested Scrolling

If your `MCNativeAdView` is not inside a `ScrollView`, you can disable nested scrolling (enabled by default):

```java
adView.setNestedScrollingEnabled(false);
```

#### 1.4 Open Campaign Details In-App

By default, tapping a campaign opens in the device's external browser. To keep users inside your app:

```java
MCOfferwallSDK.SetOpenInApp(true);
```

If you enable this, register the WebView activity in your `AndroidManifest.xml`:

```xml
<activity android:name="io.mychips.offerwall.controller.MCOfferwallActivity"
          android:theme="@style/Theme.AppCompat.NoActionBar"/>
```

***

### 2. Change the Currency Icon

The default renderer shows a coin icon next to the reward value.

<figure><img src="/files/WBxFE9Zx9rprSq0xBCin" alt=""><figcaption></figcaption></figure>

You can replace it in two ways:

#### Option A: Set a custom URL

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
val renderer = MCDefaultAdRenderer()
renderer.setCurrencyIconUrl("https://example.com/my_coin.png")
adView.setRenderer(renderer)
adView.load()
```

{% endtab %}

{% tab title="Java" %}

```java
MCDefaultAdRenderer renderer = new MCDefaultAdRenderer();
renderer.setCurrencyIconUrl("https://example.com/my_coin.png");
adView.setRenderer(renderer);
adView.load();
```

{% endtab %}
{% endtabs %}

#### Option B: Use a local drawable

To use a drawable from your app's resources, disable the URL-based icon and set it in `onBindCampaign`:

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
val renderer = object : MCDefaultAdRenderer() {
    override fun onBindCampaign(itemView: View, campaign: MCCampaign, position: Int) {
        super.onBindCampaign(itemView, campaign, position)

        val ivCurrency = itemView.findViewById<ImageView>(
            io.mychips.offerwall.R.id.mc_iv_currency)
        ivCurrency?.setImageResource(R.drawable.my_currency_icon)
    }
}
renderer.setCurrencyIconUrl("")  // disable default CDN icon
adView.setRenderer(renderer)
adView.load()
```

{% endtab %}

{% tab title="Java" %}

```java
MCDefaultAdRenderer renderer = new MCDefaultAdRenderer() {
    @Override
    public void onBindCampaign(View itemView, MCCampaign campaign, int position) {
        super.onBindCampaign(itemView, campaign, position);

        ImageView ivCurrency = itemView.findViewById(
            io.mychips.offerwall.R.id.mc_iv_currency);
        if (ivCurrency != null) {
            ivCurrency.setImageResource(R.drawable.my_currency_icon);
        }
    }
};
renderer.setCurrencyIconUrl("");  // disable default CDN icon
adView.setRenderer(renderer);
adView.load();
```

{% endtab %}
{% endtabs %}

> **Important:** Call `setCurrencyIconUrl("")` when using a local drawable. This prevents the default CDN icon from loading asynchronously and overwriting your resource.

***

### 3. Customize Text Colors

Override `onBindCampaign` and change colors after the default binding:

```java
MCDefaultAdRenderer renderer = new MCDefaultAdRenderer() {
    @Override
    public void onBindCampaign(View itemView, MCCampaign campaign, int position) {
        super.onBindCampaign(itemView, campaign, position);

        TextView tvReward = itemView.findViewById(
            io.mychips.offerwall.R.id.mc_tv_reward);
        if (tvReward != null) {
            tvReward.setTextColor(Color.parseColor("#FF1976D2")); // Blue
        }
    }
};
adView.setRenderer(renderer);
```

#### Default Layout View IDs

<table><thead><tr><th width="433">View ID</th><th width="107">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>io.mychips.offerwall.R.id.mc_iv_thumbnail</code></td><td><code>ImageView</code></td><td>Campaign image</td></tr><tr><td><code>io.mychips.offerwall.R.id.mc_tv_name</code></td><td><code>TextView</code></td><td>Campaign name</td></tr><tr><td><code>io.mychips.offerwall.R.id.mc_tv_reward</code></td><td><code>TextView</code></td><td>Reward value</td></tr><tr><td><code>io.mychips.offerwall.R.id.mc_iv_currency</code></td><td><code>ImageView</code></td><td>Currency icon</td></tr><tr><td><code>io.mychips.offerwall.R.id.mc_tv_badge_promo</code></td><td><code>TextView</code></td><td>Promo badge</td></tr><tr><td><code>io.mychips.offerwall.R.id.mc_tv_badge_progress</code></td><td><code>TextView</code></td><td>In Progress badge</td></tr></tbody></table>

***

### 4. Custom Loading View

By default, the SDK shows a pulsing skeleton placeholder while loading.

<figure><img src="/files/YrPjuCW3E9K3zWCeb18u" alt=""><figcaption></figcaption></figure>

You can replace it:

```kotlin
// Simple spinner
val spinner = ProgressBar(this)
adView.setLoadingView(spinner)
```

Or doing something more complex with text as well:

```java
// Spinner + text
LinearLayout loading = new LinearLayout(this);
loading.setOrientation(LinearLayout.VERTICAL);
loading.setGravity(Gravity.CENTER);

ProgressBar spinner = new ProgressBar(this);
loading.addView(spinner);

TextView text = new TextView(this);
text.setText("Loading offers...");
text.setGravity(Gravity.CENTER);
loading.addView(text);

adView.setLoadingView(loading);
```

Pass `null` to restore the default skeleton:

```java
adView.setLoadingView(null);
```

<figure><img src="/files/fHFsG0SKJStbMAPtb7Yr" alt=""><figcaption></figcaption></figure>

***

### 5. Custom Click Handler

Override the default click behavior per-view:

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
adView.setOnCampaignClickListener { campaign, position ->
    // Your custom logic: show a dialog, navigate, etc.
    MCOfferwallSDK.OnClick(campaign)  // or handle it yourself
}
```

{% endtab %}

{% tab title="Java" %}

```java
adView.setOnCampaignClickListener((campaign, position) -> {
    // Your custom logic: show a dialog, navigate, etc.
    MCOfferwallSDK.OnClick(campaign); // or handle it yourself
});
```

{% endtab %}
{% endtabs %}

> **Tip**: You can configure the default click behavior globally without writing a custom click handler. Call `MCOfferwallSDK.SetOpenInApp(true)` to open campaign details in an in-app WebView instead of the> &#x20;external browser. See the [Open Campaign Details In-App](https://docs.mychips.io/android/sdk-native/pages/Thv8MCuBvnLgyuyt7sbe#id-4.-optional-open-campaign-details-in-app).

***

### 6. Loading Lifecycle Listener

Monitor loading state for your own UI logic:

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
adView.setLoadingListener(object : MCNativeAdView.LoadingListener {
    override fun onLoadingStarted() { }
    override fun onCampaignsLoaded(count: Int) { }
    override fun onError(e: Exception) { }
})
```

{% endtab %}

{% tab title="Java" %}

```java
adView.setLoadingListener(new MCNativeAdView.LoadingListener() {
    @Override
    public void onLoadingStarted() { }

    @Override
    public void onCampaignsLoaded(int count) { }

    @Override
    public void onError(Exception e) { }
});
```

{% endtab %}
{% endtabs %}

***

### Next Steps

* Need a completely different card design? See [Custom Layouts →](/android/sdk-native/sdk-native-custom-layout.md)
* Need the full data reference? See [Data Reference →](/android/sdk-native/sdk-native-data-reference.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mychips.io/android/sdk-native/sdk-native-customizations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
