[Paid] AdManager Native Recycler Extension : An advance recycler view with customizable native ads

AdManager Native Ad Recycler View Extension

A powerful extension to make recycler view with admanager native ads.


:v:Multi Components


image


:recycle: AdManagerNativeRecycler


:purple_square: Methods

Initialize

Initialize recycler view inside an arrangement. Set adAutoRefreshInterval in seconds.

Parameter Type
layout component
layoutManager layout-manager
snapHelper helper
data list
adAfterItem number
adAutoRefreshInterval number

GroupSnapHelper

image

Build custom group snap helper.

Parameter Type
groupCount number

Return Type: helper


LinearLayoutManager

Linear layout manager.

Parameter Type
orientation helper
reverseLayout helper/boolean

Return Type: layout-manager


GridLayoutManager

Grid layout manager.

Parameter Type
spanCount number
orientation helper
reverseLayout helper/boolean

Return Type: layout-manager


StaggeredGridLayoutManager

Staggered Grid Layout Manager.

Parameter Type
spanCount number
orientation helper

Return Type: layout-manager


StopScroll

image

Stop smooth scrolling.


RefreshAd

image

Refresh the native ad manually.


ClearList

image

Clear recycler view items.


NotifyDataSetChanged

image

Notify any registered observers that the data set has changed.


NotifyItemMoved

image

Notify any registered observers that the item reflected at from has been moved to to.

Parameter Type
fromAdapterPosition number
toAdapterPosition number

NotifyItemRangeChanged

image

Notify any registered observers that the currently reflected count items starting at startPosition have been newly inserted.

Parameter Type
adapterPositionStart number
itemCount number

NotifyItemRangeInserted

image

Notify any registered observers that the currently reflected count items starting at startPosition have been newly inserted.

Parameter Type
adapterPositionStart number
itemCount number

NotifyItemRangeRemoved

image

Notify any registered observers that the currently reflected count items starting at startPosition have been removed.

Parameter Type
adapterPositionStart number
itemCount number

GetRootView

image

Get root view using child view.

Parameter Type
component component

Return Type: component


GetAdapterPosition

image

Returns the Adapter position of the item represented by view.

Parameter Type
rootView component

Return Type: number


ItemPosition

image

Get item position from adapter position.

Parameter Type
adapterPosition number

Return Type: number


AdapterPosition

image

Get adapter position from item position.

Parameter Type
itemPosition number

Return Type: number


BindAdContent

Bind ad content with it’s views using tag of child view. NOTE: Bind ad content inside the BindAdView event.

Parameter Type
nativeAdView component
nativeAd nativead
tag text
view helper

PopulateAdView

Populate ad views using tag of child view. NOTE: Populate views inside the CreateAdView event.

Parameter Type
nativeAdView component
tag text
view helper

GetAdContent

Returns the content of native ad.

Parameter Type
nativeAd nativead
view helper

Return Type: any


:yellow_square: Events

CreateView

image

Event raised to create item UI. Don’t bind any data to the UI.

Parameter Type
rootView component

CreateAdView

image

Event raised to create item UI. Don’t bind any data to the UI.

Parameter Type
nativeAdView component

BindView

image

Event raised to bind item data to UI.

Parameter Type
rootView component
itemPosition number
dataItem list
adapterPosition number

BindAdView

image

Event rised to bind ad data to UI.

Parameter Type
nativeAdView component
nativeAd nativead
hasVideoContent boolean
adapterPosition number

ViewAttachedToWindow

image

Called when a item view created by adapter has been attached to a window.

Parameter Type
rootView component
itemPosition number
adapterPosition number

ViewDetachedFromWindow

image

Called when a item view created by adapter has been detached from its window.

Parameter Type
rootView component
adapterPosition number

ScrollStateChanged

image

Event raised when scroll state changes.

Parameter Type
scrollState helper

Scrolled

image

Event raised when scroll event occurs.

Parameter Type
dx number
dy number

LeftSwiped

image

Event raised when scroll event occurs.

Parameter Type
itemPosition number
adapterPosition number

RightSwiped

image

Event raised when scroll event occurs.

Parameter Type
itemPosition number
adapterPosition number

Dragged

image

Event raised when scroll event occurs.

Parameter Type
fromAdapterPosition number
toAdapterPosition number

OverScrolled

image

Event raised when over scroll event occurs.

Parameter Type
state number
offset number

Ad Events


:green_square: Properties


:leaves: AdManagerNativeComponents


:purple_square: Methods

CreateComponent

image

Create a new component inside any parent component.

Parameter Type
parent component
name any
tag text
properties any

GetComponent

image

Get component using tag. Make sure to set RootParent before using.

Parameter Type
parent component
tag text

Return Type: component


SetUniqueId

image

Set unique id of a view.

Parameter Type
component component
uniqueId text

GetUniqueId

image

Get unique id from component.

Parameter Type
component component

Return Type: text


SetProperty

image

Set a property for component.

Parameter Type
component any
name text
value any

SetProperties

image

Set properties of component. You can either use JSON string or dictionary to set properties.

Parameter Type
component any
properties any

GetProperty

image

Get a property value.

Parameter Type
component component
name text

Return Type: any


IsDynamicComponent

image

Returns true if the given component is dynamic.

Parameter Type
component component

Return Type: boolean


GetComponentName

image

Get component name.

Parameter Type
component component

Return Type: text


GetComponentById

image

Make sure to set unique id before using this function.

Parameter Type
uniqueId text

Return Type: component


CreateTemplate

image

Create components using JSON template. Note: If you’re using asset file so the file name should be end with (.json).

Parameter Type
in component
template text/json
parameters list

CreateAdView

image

Create NativeAdView using JSON Schema template. Note: If you’re using asset file so the file name should be end with (.json). Leave the tagForMediaView as empty when you’re not populating MediaView.

Parameter Type
nativeAdView component
template text/json
parameters list
tagForMediaView text

RegisterForClick

image

Register components for click.

Parameter Type
component any
position number

RegisterForLongClick

image

Register components for long click.

Parameter Type
component any
position number

UnregisterListners

image

Unregister click and long click listeners for components.

Parameter Type
component any

AnimateViewOnClick

image

Animate any component on click.

Parameter Type
rootView component
duration number

:yellow_square: Events

Clicked

image

Event invoked when a registered component is clicked.

Parameter Type
component component
position number

LongClicked

image

Event invoked when a registered component is long clicked.

Parameter Type
component component
position number

:green_square: Properties

GetUniqueIds

image

Returns all used uniuqe ids.


:receipt: AdManagerConfiguration


:purple_square: Methods

Initialize

image

Before loading ads, have your app initialize the Google Mobile Ads SDK.

Parameter Type
disableMediation helper/boolean

OpenAdInspector

image

Opens the ad inspector UI. With ad inspector, you can test the setup of a single, third-party waterfall ad source. This allows you to verify that you’ve correctly implemented the third-party mediation adapter and that the ad source is serving as expected.


OpenDebugMenu

image

Opens the debug menu. adUnitId: Any Ad Manager ad unit Id associated with your app.

Parameter Type
adUnitId text

GetInformation

image

It is recommended that you request an update of the consent information at every app launch. This will determine whether or not your user needs to provide consent. Turn of testMode before release on console.


LoadAndShowFormIfRequired

image

Once you’ve determined that you will ask a user for consent, the next step is to determine if a form is available.


CanLoadAds

image

Return true if consent obtained from user or consent not required. NOTE: GetInformation function must be called before using this block.

Return Type: boolean


ResetState

image

In testing your app with the UMP SDK, you may find it helpful to reset the state of the SDK so that you can simulate a user’s first install experience. The SDK provides the reset method to do this.


:yellow_square: Events

AdInspectorClosed

image

Called when the ad inspector UI has been closed.Error information provided in case the ad inspector UI closed due to an error.

Parameter Type
errorCode number
message text
domain text

InitializeSuccess

image

Called when the SDK initialization is complete.

Parameter Type
keyList list
latencyList list
stateList list
descriptionList list

FormDismissed

image

Consent form dismissed.

Parameter Type
errorCode number
errorMessage text

InfoUpdateFailure

image

Failed to update consent information.

Parameter Type
errorCode number
errorMessage text

ReadyToLoadAds

image

If isObtained return true so consent is obtained from user otherwise consent is not required for user.


FormAvailable

image

Consent form available, now show the form.


:green_square: Properties


:tv: Watch Demo Video


See example

KodularItemView.json (4.5 KB)

KodularNativeAdView.json (13.5 KB)


:memo: Extension specifications:


:heavy_dollar_sign: Price: $25 USD
:floppy_disk: Size: 1.48 MB
:android: SDK Version: 23.2.0
:earth_americas: Released On: 2024-07-13T18:00:00Z
:credit_card: Payment methods: Direct Download | PayPal | Skrill | TransferWise (Wise) | Xoom | Airtm | Binance | Crypto | Pyypl | Payment by Card (:credit_card:) | UPI (:india:) | JazzCash (:pakistan:) | Bkash (:bangladesh:)


2 Likes

Thank you for your contribution
Why are your helper block names so long?
Wouldn’t just Orientation be enough?
And for the other helper block: is it really necessary? Why not using a standard boolean true/false block?


Taifun

1 Like

Thanks for your suggestion :blush:

To prevent conflicts with other extension helper blocks when names are same.

I thought it’ll help beginners to setup blocks quickly and prevent them to do mistakes. It’s accept boolean and string boolean values also. However, if community want those blocks without helper blocks I’m ready to provide update.

I do not think, that other Orientation helper blocks would fit into that socket…

Taifun

I’ve faced that issue with FloorAmount helper blocks with in-built helper. It was accepting the in-built helper but thrown runtime error. That’s why I’ve to renamed it as unique.

Well, I guess, you now will get the same error again if somebody will try that…

Didn’t you declare the helper class in the method name as shown in the documentation?

https://docs.google.com/document/u/0/d/1D5K_1JwGzcRFSYFq4n9J8ESK2nJJ_TsNwBtrX8w6-9g/mobilebasic

Example:

@SimpleFunction
 public @Options(Animal.class) String MakeRun(
   @Options(Animal.class) String animal
) {
 // Make the animal run.
}

Taifun

1 Like