Created
July 5, 2018 13:19
-
-
Save jugutier/b35a48a017b0ab390f232dca9a47c3b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.es.thirdparty.taboola; | |
import com.eachscape.managers.LogMgr; | |
import com.taboola.android.api.TaboolaOnClickListener; | |
public class TaboolaOnClickListenerDispatcher implements TaboolaOnClickListener { | |
private static final String TAG = TaboolaOnClickListenerDispatcher.class.getSimpleName(); | |
private static TaboolaOnClickListenerDispatcher sharedInstance; | |
private TaboolaMgrOnClickListener clickListener; | |
private TaboolaOnClickListenerDispatcher() { | |
LogMgr.debug(TAG, "Creating singleton..."); | |
} | |
public static synchronized TaboolaOnClickListenerDispatcher instance() { | |
if (sharedInstance == null) { | |
LogMgr.debug(TAG, "Creating shared instance"); | |
sharedInstance = new TaboolaOnClickListenerDispatcher(); | |
} | |
return sharedInstance; | |
} | |
public void setOnClickListener(TaboolaMgrOnClickListener clickListener) { | |
LogMgr.debug(TAG, "Setting new organic content handler"); | |
this.clickListener = clickListener; | |
} | |
@Override | |
public boolean onItemClick(String placementName, String itemId, String clickUrl, boolean isOrganic) { | |
return clickListener != null && clickListener.onItemClick(placementName, itemId, clickUrl, isOrganic); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment