Skip to content

Commit

Permalink
Preparation for release 2.0.7 (#561)
Browse files Browse the repository at this point in the history
* feat: update version to 2.0.7 and fix Javadoc problem #560

* fix: out stream example problem

* fix: ppm outstream example
  • Loading branch information
ValentinPostindustria authored Jan 16, 2023
1 parent 6696832 commit 82adcfb
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Example/PrebidDemoJava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
implementation project(':PrebidMobile')

// For testing staging releases
// implementation "org.prebid:prebid-mobile-sdk:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk:$prebidSdkVersionName"

// Base
implementation 'androidx.appcompat:appcompat:1.2.0'
Expand Down
8 changes: 4 additions & 4 deletions Example/PrebidDemoKotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ dependencies {
implementation project(':PrebidMobile-maxAdapters')

// For testing staging releases
// implementation "org.prebid:prebid-mobile-sdk:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk-gam-event-handlers:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk-admob-adapters:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk-max-adapters:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk:$prebidSdkVersionName"
// implementation "org.prebid:prebid-mobile-sdk-gam-event-handlers:$prebidSdkVersionName"
// implementation "org.prebid:prebid-mobile-sdk-admob-adapters:$prebidSdkVersionName"
// implementation "org.prebid:prebid-mobile-sdk-max-adapters:$prebidSdkVersionName"

// Standard libraries
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
8 changes: 4 additions & 4 deletions Example/PrebidInternalTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ dependencies {
implementation project(':PrebidMobile-maxAdapters')

// For testing staging releases
// implementation "org.prebid:prebid-mobile-sdk:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk-gam-event-handlers:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk-admob-adapters:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk-max-adapters:$prebidVersionName"
// implementation "org.prebid:prebid-mobile-sdk:$prebidSdkVersionName"
// implementation "org.prebid:prebid-mobile-sdk-gam-event-handlers:$prebidSdkVersionName"
// implementation "org.prebid:prebid-mobile-sdk-admob-adapters:$prebidSdkVersionName"
// implementation "org.prebid:prebid-mobile-sdk-max-adapters:$prebidSdkVersionName"

// Base dependencies
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,117 @@

package org.prebid.mobile.renderingtestapp.plugplay.bidding.gam.rendering

import android.os.Bundle
import android.util.Log
import android.view.View
import org.prebid.mobile.AdSize
import org.prebid.mobile.api.data.VideoPlacementType
import org.prebid.mobile.api.exceptions.AdException
import org.prebid.mobile.api.rendering.BannerView
import org.prebid.mobile.api.rendering.listeners.BannerViewListener
import org.prebid.mobile.eventhandlers.GamBannerEventHandler
import org.prebid.mobile.renderingtestapp.AdFragment
import org.prebid.mobile.renderingtestapp.R
import org.prebid.mobile.renderingtestapp.databinding.FragmentBiddingBannerVideoBinding
import org.prebid.mobile.renderingtestapp.plugplay.config.AdConfiguratorDialogFragment
import org.prebid.mobile.renderingtestapp.utils.BaseEvents

class GamOutstreamFragment : AdFragment(), BannerViewListener {

private val TAG = GamOutstreamFragment::class.java.simpleName

class GamOutstreamFragment : GamBannerFragment() {
override val layoutRes: Int = R.layout.fragment_bidding_banner_video

override fun initBanner(configId: String?, eventHandler: GamBannerEventHandler): BannerView {
val bannerView =
BannerView(requireContext(), configId, eventHandler)
protected var bannerView: BannerView? = null
protected lateinit var events: Events
protected val binding: FragmentBiddingBannerVideoBinding
get() = getBinding()


fun initBanner(configId: String?, eventHandler: GamBannerEventHandler): BannerView {
val bannerView = BannerView(requireContext(), configId, eventHandler)
bannerView.videoPlacementType = VideoPlacementType.IN_BANNER
return bannerView
}

override fun initUi(view: View, savedInstanceState: Bundle?) {
super.initUi(view, savedInstanceState)
events = Events(view)
binding.adIdLabel.text = getString(R.string.label_auid, configId)
binding.btnLoad.setOnClickListener {
resetEventButtons()
loadAd()
}
}

override fun initAd(): Any? {
val eventHandler = GamBannerEventHandler(requireContext(), adUnitId, *getGamAdSizeArray(AdSize(width, height)))
bannerView = initBanner(
configId,
eventHandler
)
bannerView?.addAdditionalSizes(*getAdditionalPrebidBannerSizeArray())
bannerView?.setAutoRefreshDelay(refreshDelay)
bannerView?.setBannerListener(this)
binding.viewContainer.addView(bannerView)
return bannerView
}

override fun loadAd() {
bannerView?.loadAd()
}

override fun configuratorMode(): AdConfiguratorDialogFragment.AdConfiguratorMode? {
return AdConfiguratorDialogFragment.AdConfiguratorMode.BANNER
}

override fun onDestroyView() {
super.onDestroyView()
bannerView?.destroy()
}

override fun onAdFailed(view: BannerView?, exception: AdException?) {
Log.d(TAG, "onAdFailed() called with: view = [$view], throwable = [$exception]")
resetEventButtons()
events.failed(true)
binding.btnLoad.isEnabled = true
}

override fun onAdDisplayed(bannerView: BannerView?) {
events.displayed(true)
Log.d(TAG, "onAdDisplayed() called with: bannerView = [$bannerView]")
}

override fun onAdLoaded(bannerView: BannerView?) {
Log.d(TAG, "onAdLoaded() called with: view = [$view]")
resetEventButtons()
events.loaded(true)
binding.btnLoad.isEnabled = true
}

override fun onAdClicked(view: BannerView?) {
Log.d(TAG, "onAdClicked() called with: view = [$view]")
events.clicked(true)
}

override fun onAdClosed(view: BannerView?) {
Log.d(TAG, "onAdClosed() called with: view = [$view]")
events.closed(true)
}

protected open fun getGamAdSizeArray(initialSize: AdSize) = arrayOf(initialSize)

protected open fun getAdditionalPrebidBannerSizeArray() = emptyArray<AdSize>()

protected class Events(parentView: View) : BaseEvents(parentView) {

fun loaded(b: Boolean) = enable(R.id.btnAdLoaded, b)
fun impression(b: Boolean) = enable(R.id.btnAdImpression, b)
fun clicked(b: Boolean) = enable(R.id.btnAdClicked, b)
fun closed(b: Boolean) = enable(R.id.btnAdClosed, b)
fun failed(b: Boolean) = enable(R.id.btnAdFailed, b)
fun displayed(b: Boolean) = enable(R.id.btnAdDisplayed, b)

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,50 @@

package org.prebid.mobile.renderingtestapp.plugplay.bidding.ppm

import android.widget.RelativeLayout
import android.os.Bundle
import android.view.View
import org.prebid.mobile.AdSize
import org.prebid.mobile.api.data.VideoPlacementType
import org.prebid.mobile.api.exceptions.AdException
import org.prebid.mobile.api.rendering.BannerView
import org.prebid.mobile.api.rendering.listeners.BannerViewListener
import org.prebid.mobile.renderingtestapp.AdFragment
import org.prebid.mobile.renderingtestapp.R
import org.prebid.mobile.renderingtestapp.databinding.FragmentBiddingBannerVideoBinding
import org.prebid.mobile.renderingtestapp.plugplay.config.AdConfiguratorDialogFragment
import org.prebid.mobile.renderingtestapp.utils.BaseEvents

open class PpmVideoFragment : AdFragment(), BannerViewListener {

private val TAG = PpmBannerFragment::class.java.simpleName

open class PpmVideoFragment : PpmBannerFragment(),
BannerViewListener {
override val layoutRes = R.layout.fragment_bidding_banner_video

protected var bannerView: BannerView? = null

protected val binding: FragmentBiddingBannerVideoBinding
get() = getBinding()

protected lateinit var events: Events


override fun initUi(view: View, savedInstanceState: Bundle?) {
super.initUi(view, savedInstanceState)
events = Events(view)
binding.adIdLabel.text = getString(R.string.label_auid, configId)
binding.btnLoad.setOnClickListener {
resetEventButtons()
it.isEnabled = false
loadAd()
}

binding.btnStopRefresh.setOnClickListener {
bannerView?.stopRefresh()
resetEventButtons()
binding.btnLoad.isEnabled = true
}
}

override fun initAd(): Any? {
bannerView = BannerView(
requireContext(),
Expand All @@ -38,4 +71,53 @@ open class PpmVideoFragment : PpmBannerFragment(),
binding.viewContainer.addView(bannerView)
return bannerView
}

override fun loadAd() {
bannerView?.loadAd()
}

override fun configuratorMode(): AdConfiguratorDialogFragment.AdConfiguratorMode? {
return AdConfiguratorDialogFragment.AdConfiguratorMode.BANNER
}

override fun onAdFailed(bannerView: BannerView?, exception: AdException?) {
resetEventButtons()
events.failed(true)
binding.btnLoad.isEnabled = true
}

override fun onAdLoaded(bannerView: BannerView?) {
resetEventButtons()
events.loaded(true)
binding.btnLoad.isEnabled = true
}

override fun onAdClicked(bannerView: BannerView?) {
events.clicked(true)
}

override fun onAdClosed(bannerView: BannerView?) {
events.closed(true)
}

override fun onAdDisplayed(bannerView: BannerView?) {
events.displayed(true)
}

override fun onDestroyView() {
super.onDestroyView()
bannerView?.destroy()
}

protected class Events(parentView: View) : BaseEvents(parentView) {

fun loaded(b: Boolean) = enable(R.id.btnAdLoaded, b)
fun impression(b: Boolean) = enable(R.id.btnAdImpression, b)
fun clicked(b: Boolean) = enable(R.id.btnAdClicked, b)
fun closed(b: Boolean) = enable(R.id.btnAdClosed, b)
fun failed(b: Boolean) = enable(R.id.btnAdFailed, b)
fun displayed(b: Boolean) = enable(R.id.btnAdDisplayed, b)

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/adIdLabel" />

<Button
android:id="@+id/btnStopRefresh"
style="@style/AdEventButton"
android:layout_marginTop="16dp"
android:enabled="true"
android:minHeight="0dp"
android:text="@string/text_stop_refresh"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnLoad" />

<include
android:id="@+id/include"
layout="@layout/events_bids"
Expand All @@ -70,7 +81,7 @@
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnLoad" />
app:layout_constraintTop_toBottomOf="@+id/btnStopRefresh" />


</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
2 changes: 1 addition & 1 deletion PrebidMobile/publisher.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ task javadoc(type: Javadoc, dependsOn: assemble) {
source = android.sourceSets.main.java.srcDirs
source += file('build/generated/source/buildConfig/release/org/prebid/mobile/core/BuildConfig.java').path

classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + configurations.implementation
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))

options.addBooleanOption('-ignore-source-errors', true)
options.addStringOption('Xdoclint:none', '-quiet')
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To work with Prebid Mobile, you will need accesss to a Prebid Server. See [this
Easily include the Prebid Mobile SDK using Maven. Simply add this line to your gradle dependencies:

```
implementation 'org.prebid:prebid-mobile-sdk:2.0.6'
implementation 'org.prebid:prebid-mobile-sdk:2.0.7'
```

## Build from source
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext {
prebidSdkVersionName = "2.0.6"
prebidSdkVersionName = "2.0.7"
prebidSdkMinVersion = 16
prebidSdkTargetVersion = 32
prebidSdkCompileVersion = 32
Expand Down Expand Up @@ -30,6 +30,6 @@ allprojects {
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/orgprebid-1093" }
maven { url "https://oss.sonatype.org/content/repositories/orgprebid-1079" }
}
}
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ org.gradle.daemon=true
org.gradle.caching=true
android.useAndroidX=true
android.enableJetifier=true
android.disableAutomaticComponentCreation=true
#android.useAndroidX and android.enableJetifier are specified in each module separately
#android.useAndroidX and android.enableJetifier are specified in each module separately
4 changes: 2 additions & 2 deletions scripts/Maven/PrebidMobile-admobAdapters-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.prebid</groupId>
<artifactId>prebid-mobile-sdk-admob-adapters</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>

<packaging>jar</packaging>
<name>Prebid Mobile Android SDK</name>
Expand Down Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>org.prebid</groupId>
<artifactId>prebid-mobile-sdk</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion scripts/Maven/PrebidMobile-core-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.prebid</groupId>
<artifactId>prebid-mobile-sdk-core</artifactId>

<version>2.0.6</version>
<version>2.0.7</version>
<packaging>aar</packaging>
<name>Prebid Mobile Android SDK</name>
<description>Prebid Mobile</description>
Expand Down
4 changes: 2 additions & 2 deletions scripts/Maven/PrebidMobile-gamEventHandlers-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.prebid</groupId>
<artifactId>prebid-mobile-sdk-gam-event-handlers</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>

<packaging>jar</packaging>
<name>Prebid Mobile Android SDK</name>
Expand Down Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>org.prebid</groupId>
<artifactId>prebid-mobile-sdk</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 82adcfb

Please sign in to comment.