Skip to content

Commit

Permalink
Release: version 4.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bichen Wang and Nathan Shayefar committed Aug 2, 2016
1 parent 3a9d347 commit bd8a875
Show file tree
Hide file tree
Showing 47 changed files with 1,127 additions and 585 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Version 4.8.0 (August 1, 2016)
- Changed the behavior of `MoPubInterstitial#load()` while an interstitial is loading or has been successfully loaded. Previously, this would discard the currently-caching or cached interstitial -- now the interstitial will be unaffected and will remain in the cache.
- `MoPubInterstitial`s can now be shown only once per successful ad load.
- Modified a number of Native Ads APIs (manual integration) to accept Context instead of Activity. Affected classes/methods include: `MoPubNative`, `AdapterHelper`, `CustomEventNative#loadNativeAd()`, and `MoPubAdRenderer#createAdView()`.

#### Version 4.7.1 (June 10, 2016)
- Fixed deeplink bug.

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The MoPub SDK is available via:
}
dependencies {
compile('com.mopub:mopub-sdk:4.7.0@aar') {
compile('com.mopub:mopub-sdk:4.8.0@aar') {
transitive = true
}
}
Expand Down Expand Up @@ -62,7 +62,9 @@ The MoPub SDK is available via:
## New in this Version
Please view the [changelog](https://github.com/mopub/mopub-android-sdk/blob/master/CHANGELOG.md) for a complete list of additions, fixes, and enhancements in the latest release.
- Fixed deeplink bug.
- Changed the behavior of `MoPubInterstitial#load()` while an interstitial is loading or has been successfully loaded. Previously, this would discard the currently-caching or cached interstitial -- now the interstitial will be unaffected and will remain in the cache.
- `MoPubInterstitial`s can now be shown only once per successful ad load.
- Modified a number of Native Ads APIs (manual integration) to accept Context instead of Activity. Affected classes/methods include: `MoPubNative`, `AdapterHelper`, `CustomEventNative#loadNativeAd()`, and `MoPubAdRenderer#createAdView()`.
## Requirements
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.android.tools.build:gradle:2.1.2'
}
}

task wrapper(type: Wrapper) {
gradleVersion = '2.5'
gradleVersion = '2.10'
}
8 changes: 4 additions & 4 deletions extras/src/com/mopub/nativeads/FacebookAdRenderer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mopub.nativeads;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -38,9 +38,9 @@ public FacebookAdRenderer(final ViewBinder viewBinder) {
}

@Override
public View createAdView(final Activity activity, final ViewGroup parent) {
public View createAdView(final Context context, final ViewGroup parent) {
final View adView = LayoutInflater
.from(activity)
.from(context)
.inflate(mViewBinder.layoutId, parent, false);
final View mainImageView = adView.findViewById(mViewBinder.mainImageId);
if (mainImageView == null) {
Expand Down Expand Up @@ -72,7 +72,7 @@ public View createAdView(final Activity activity, final ViewGroup parent) {
mainImageView.setVisibility(View.GONE);
}

final MediaView mediaView = new MediaView(activity);
final MediaView mediaView = new MediaView(context);
ViewGroup mainImageParent = (ViewGroup) mainImageView.getParent();
int mainImageIndex = mainImageParent.indexOfChild(mainImageView);
mainImageParent.addView(mediaView, mainImageIndex + 1, mediaViewLayoutParams);
Expand Down
9 changes: 4 additions & 5 deletions extras/src/com/mopub/nativeads/FacebookNative.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.mopub.nativeads;

import android.app.Activity;
import android.content.Context;
import android.view.View;

Expand Down Expand Up @@ -47,7 +46,7 @@ public class FacebookNative extends CustomEventNative {

// CustomEventNative implementation
@Override
protected void loadNativeAd(final Activity activity,
protected void loadNativeAd(final Context context,
final CustomEventNativeListener customEventNativeListener,
final Map<String, Object> localExtras,
final Map<String, String> serverExtras) {
Expand Down Expand Up @@ -75,12 +74,12 @@ protected void loadNativeAd(final Activity activity,
if (shouldUseVideoEnabledNativeAd(sIsVideoRendererAvailable, videoEnabledString,
videoEnabledFromServer)) {
final FacebookVideoEnabledNativeAd facebookVideoEnabledNativeAd =
new FacebookVideoEnabledNativeAd(activity,
new NativeAd(activity, placementId), customEventNativeListener);
new FacebookVideoEnabledNativeAd(context,
new NativeAd(context, placementId), customEventNativeListener);
facebookVideoEnabledNativeAd.loadAd();
} else {
final FacebookStaticNativeAd facebookStaticNativeAd = new FacebookStaticNativeAd(
activity, new NativeAd(activity, placementId), customEventNativeListener);
context, new NativeAd(context, placementId), customEventNativeListener);
facebookStaticNativeAd.loadAd();
}
}
Expand Down
11 changes: 5 additions & 6 deletions extras/src/com/mopub/nativeads/InMobiNative.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.mopub.nativeads;

import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.View;
Expand Down Expand Up @@ -32,7 +31,7 @@ class InMobiNative extends CustomEventNative {

// CustomEventNative implementation
@Override
protected void loadNativeAd(final Activity activity,
protected void loadNativeAd(final Context context,
final CustomEventNativeListener customEventNativeListener,
final Map<String, Object> localExtras,
final Map<String, String> serverExtras) {
Expand All @@ -45,11 +44,11 @@ protected void loadNativeAd(final Activity activity,
return;
}

InMobi.initialize(activity, appId);
InMobi.initialize(context, appId);
final InMobiStaticNativeAd inMobiStaticNativeAd =
new InMobiStaticNativeAd(activity,
new ImpressionTracker(activity),
new NativeClickHandler(activity),
new InMobiStaticNativeAd(context,
new ImpressionTracker(context),
new NativeClickHandler(context),
customEventNativeListener);
inMobiStaticNativeAd.setIMNative(new IMNative(inMobiStaticNativeAd));
inMobiStaticNativeAd.loadAd();
Expand Down
10 changes: 5 additions & 5 deletions extras/src/com/mopub/nativeads/MillennialNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class MillennialNative extends CustomEventNative {
private static final Handler UI_THREAD_HANDLER = new Handler(Looper.getMainLooper());

@Override
protected void loadNativeAd(final Activity activity,
protected void loadNativeAd(final Context context,
final CustomEventNativeListener listener,
final Map<String, Object> localExtras,
final Map<String, String> serverExtras) {
Expand All @@ -35,7 +35,7 @@ protected void loadNativeAd(final Activity activity,

if ( !MMSDK.isInitialized() ) {
try {
MMSDK.initialize(activity);
MMSDK.initialize((Activity) context);
} catch ( Exception e ) {
Log.e(LOGCAT_TAG, "Unable to initialize the Millennial SDK-- " + e.getMessage());
e.printStackTrace();
Expand Down Expand Up @@ -85,10 +85,10 @@ public void run() {
try {
NativeAd nativeAd = NativeAd.createInstance(placementId, NativeAd.NATIVE_TYPE_INLINE);
final MillennialStaticNativeAd millennialStaticNativeAd =
new MillennialStaticNativeAd(activity,
new MillennialStaticNativeAd(context,
nativeAd,
new ImpressionTracker(activity),
new NativeClickHandler(activity),
new ImpressionTracker(context),
new NativeClickHandler(context),
listener);
millennialStaticNativeAd.loadAd();
} catch ( MMException e ) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jul 15 14:33:43 PDT 2015
#Mon Jun 20 17:07:26 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
10 changes: 3 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ case "`uname`" in
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
Expand All @@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

Expand Down Expand Up @@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down
180 changes: 90 additions & 90 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
4 changes: 2 additions & 2 deletions mopub-sample/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mopub.simpleadsdemo"
android:versionCode="42"
android:versionName="4.7.1">
android:versionCode="43"
android:versionName="4.8.0">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="23"/>

Expand Down
Loading

0 comments on commit bd8a875

Please sign in to comment.