Skip to content

Commit

Permalink
ci_v1.5.5 - add orientation flag for open ad load
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhi committed Jun 21, 2023
1 parent 01c4e97 commit 2101ee6
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,35 @@ mActivity.showRewardedInterstitialAd(
```

### ⭐️ If you liked it support me with your stars!

## Developed By

[Akshay Harsoda](https://github.com/AkshayHarsoda) - [[email protected]](https://mail.google.com/mail/u/0/?view=cm&fs=1&[email protected]&su=https://github.com/vickypathak123/Android-Ads-Helper&body=&[email protected]&tf=1)

<a href="https://github.com/AkshayHarsoda" rel="nofollow">
<img alt="Follow me on Google+"
height="50" width="50"
src="https://github.com/vickypathak123/Android-Ads-Helper/blob/master/social/github.png"
style="max-width:100%;">
</a>

<a href="https://www.linkedin.com/in/akshay-harsoda-b66820116" rel="nofollow">
<img alt="Follow me on LinkedIn"
height="50" width="50"
src="https://github.com/vickypathak123/Android-Ads-Helper/blob/master/social/linkedin.png"
style="max-width:100%;">
</a>

<a href="https://twitter.com/Akshayharsoda1" rel="nofollow">
<img alt="Follow me on Twitter"
height="50" width="50"
src="https://github.com/vickypathak123/Android-Ads-Helper/blob/master/social/twitter.png"
style="max-width:100%;">
</a>

<a href="https://www.facebook.com/akshay.harsoda" rel="nofollow">
<img alt="Follow me on Facebook"
height="50" width="50"
src="https://github.com/vickypathak123/Android-Ads-Helper/blob/master/social/facebook.png"
style="max-width:100%;">
</a>
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ object AppOpenAdHelper {
private fun loadNewAd(
fContext: Context,
fModel: OpenAdModel,
fOrientation: Int,
fIndex: Int
) {

Expand All @@ -69,7 +70,7 @@ object AppOpenAdHelper {
fContext,
fModel.adsID,
AdRequest.Builder().build(),
AppOpenAd.APP_OPEN_AD_ORIENTATION_PORTRAIT,
fOrientation,
object : AppOpenAd.AppOpenAdLoadCallback() {

override fun onAdLoaded(appOpenAd: AppOpenAd) {
Expand Down Expand Up @@ -127,6 +128,7 @@ object AppOpenAdHelper {
fContext: Context,
openAdModel: OpenAdModel,
index: Int,
fOrientation: Int,
onAdLoaded: () -> Unit,
onAdFailed: () -> Unit
) {
Expand All @@ -136,6 +138,7 @@ object AppOpenAdHelper {
) {
loadNewAd(
fContext = fContext,
fOrientation = fOrientation,
fModel = openAdModel.apply {
this.listener = object : AdMobAdsListener {

Expand Down Expand Up @@ -188,6 +191,7 @@ object AppOpenAdHelper {
*/
fun loadAd(
fContext: Context,
fOrientation: Int = AppOpenAd.APP_OPEN_AD_ORIENTATION_PORTRAIT,
onAdLoaded: () -> Unit = {}
) {
mOnAdLoaded = onAdLoaded
Expand All @@ -203,6 +207,7 @@ object AppOpenAdHelper {
fContext = fContext,
openAdModel = openAdModel,
index = index,
fOrientation = fOrientation,
onAdLoaded = onAdLoaded,
onAdFailed = {},
)
Expand All @@ -215,6 +220,7 @@ object AppOpenAdHelper {
fContext = fContext,
openAdModel = openAdModel,
index = index,
fOrientation = fOrientation,
onAdLoaded = onAdLoaded,
onAdFailed = {
if ((mAdIdPosition + 1) >= admob_app_open_ad_model_list.size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class AppApplication : AppOpenApplication(), AppOpenApplication.AppLifecycleList
.needToTakeAllTestAdID(true)
.isDebugModeEnable(true)
.needToBlockInterstitialAd(false)

.isNeedToLoadMultipleNativeAdRequest(true)

.isEnableOpenAd(this.getBoolean(IS_OPEN_ADS_ENABLE, true))
.setLifeTimeProductKey("android.test.purchased")
// .setSubscriptionKey("com.screen.mirror.cast.share.tv.device.app.weekly","com.screen.mirror.cast.share.tv.device.app.monthly",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class NativeAdsActivity : BaseBindingActivity<ActivityNativeAdsBinding>() {
fSize = NativeAdsSize.VOICE_GPS,
fLayout = mBinding.flNativeAdPlaceHolderVoiceGps,
isNeedToShowShimmerLayout = true,
topMargin=100,
topMargin=10,
startMargin=100,
bottomMargin=50,
endMargin=50,
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
dependencies_version = '1.5.4'
dependencies_version = '1.5.5'
}
}

Expand Down

0 comments on commit 2101ee6

Please sign in to comment.