-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
860fb13
commit a6116e6
Showing
5 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
AlienAdsV2/src/main/java/com/aliendroid/alienads/WortiseOpenAds.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.aliendroid.alienads; | ||
|
||
import android.app.Activity; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.aliendroid.alienads.interfaces.open.OnLoadOpenAppWortise; | ||
import com.wortise.ads.AdError; | ||
import com.wortise.ads.appopen.AppOpenAd; | ||
|
||
public class WortiseOpenAds { | ||
public static AppOpenAd mAppOpenAd; | ||
public static OnLoadOpenAppWortise onLoadOpenAppWortise; | ||
public static void LoadOpenWortise (Activity activity, String idOpen){ | ||
mAppOpenAd = new AppOpenAd(activity, idOpen); | ||
mAppOpenAd.loadAd(); | ||
mAppOpenAd.setAutoReload(true); | ||
mAppOpenAd.setOrientation(AppOpenAd.Orientation.PORTRAIT); | ||
mAppOpenAd.tryToShowAd(activity); | ||
mAppOpenAd.setListener(new AppOpenAd.Listener() { | ||
@Override | ||
public void onAppOpenFailed(@NonNull AppOpenAd appOpenAd, @NonNull AdError adError) { | ||
if (onLoadOpenAppWortise!=null){ | ||
onLoadOpenAppWortise.onAppOpenFailed(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onAppOpenClicked(@NonNull AppOpenAd ad) { | ||
if (onLoadOpenAppWortise!=null){ | ||
onLoadOpenAppWortise.onAppOpenClicked(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onAppOpenDismissed(@NonNull AppOpenAd ad) { | ||
if (onLoadOpenAppWortise!=null){ | ||
onLoadOpenAppWortise.onAppOpenDismissed(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onAppOpenLoaded(@NonNull AppOpenAd ad) { | ||
if (onLoadOpenAppWortise!=null){ | ||
onLoadOpenAppWortise.onAppOpenLoaded(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onAppOpenShown(@NonNull AppOpenAd ad) { | ||
|
||
} | ||
}); | ||
} | ||
|
||
public static void ShowOpenWortise (Activity activity){ | ||
if (mAppOpenAd.isAvailable()) { | ||
mAppOpenAd.showAd(activity); | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
AlienAdsV2/src/main/java/com/aliendroid/alienads/interfaces/open/OnLoadOpenAppWortise.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.aliendroid.alienads.interfaces.open; | ||
|
||
public interface OnLoadOpenAppWortise { | ||
void onAppOpenClicked(); | ||
void onAppOpenFailed(); | ||
void onAppOpenDismissed(); | ||
void onAppOpenLoaded(); | ||
} |
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
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
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