Skip to content

Commit 9f7bd6a

Browse files
committed
Adds DFP Rewarded Video examples. Removes NativeListViewExample.
1 parent bbe36d6 commit 9f7bd6a

File tree

97 files changed

+971
-2162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+971
-2162
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ technical SDK support for our [Android developers](https://groups.google.com/for
2929
## Advanced
3030

3131
* API Demo: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/java/advanced/APIDemo), [Kotlin](https://github.com/googleads/googleads-mobile-android-examples/tree/master/kotlin/advanced/APIDemo) - Provides additional examples for both AdMob and DoubleClick to help improve your mobile app integration of the Google Mobile Ads SDK.
32-
* Native Express RecyclerView: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/advanced/NativeExpressRecyclerViewExample) - Provides an example for displaying ads from AdMob Native Ads Express in a RecyclerView widget.
33-
* Native ListView: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/advanced/NativeListViewExample) - Provides an example for displaying ads from DFP Custom Rendering in a ListView.
32+
* Banner RecyclerView: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/java/advanced/BannerRecyclerViewExample) - Provides an example for displaying ads from AdMob Banner ads in a RecyclerView widget.
3433

3534
## DoubleClick
3635

3736
* Banner: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/java/doubleclick/BannerExample), [Kotlin](https://github.com/googleads/googleads-mobile-android-examples/tree/master/kotlin/doubleclick/BannerExample)
3837
* Interstitial: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/java/doubleclick/InterstitialExample), [Kotlin](https://github.com/googleads/googleads-mobile-android-examples/tree/master/kotlin/doubleclick/InterstitialExample)
38+
* Rewarded Video: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/java/doubleclick/RewardedVideoExample), [Kotlin](https://github.com/googleads/googleads-mobile-android-examples/tree/master/kotlin/doubleclick/RewardedVideoExample)
3939
* Custom Rendering: [Java](https://github.com/googleads/googleads-mobile-android-examples/tree/master/java/doubleclick/CustomRenderingExample), [Kotlin](https://github.com/googleads/googleads-mobile-android-examples/tree/master/kotlin/doubleclick/CustomRenderingExample)
4040

4141
# Downloads
@@ -45,7 +45,7 @@ for the latest downloads of our example apps.
4545

4646
# Documentation
4747

48-
Check out our [developers site](https://developers.google.com/mobile-ads-sdk/)
48+
Check out our [developers site](https://developers.google.com/admob/)
4949
for documentation on using the Mobile Ads SDK.
5050

5151
# GitHub issue tracker

java/admob/RewardedVideoExample/app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ android {
1919
}
2020

2121
dependencies {
22-
compile 'com.android.support:appcompat-v7:26.1.0'
23-
compile 'com.google.android.gms:play-services-ads:11.8.0'
22+
implementation 'com.android.support:appcompat-v7:26.1.0'
23+
implementation 'com.google.android.gms:play-services-ads:11.8.0'
24+
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
2425
}

java/admob/RewardedVideoExample/app/src/main/java/com/google/ads/rewardedvideoexample/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void onClick(View view) {
5656
});
5757

5858
// Create the "show" button, which shows a rewarded video if one is loaded.
59-
mShowVideoButton = findViewById(R.id.watch_video);
59+
mShowVideoButton = findViewById(R.id.show_video_button);
6060
mShowVideoButton.setVisibility(View.INVISIBLE);
6161
mShowVideoButton.setOnClickListener(new View.OnClickListener() {
6262
@Override
@@ -106,7 +106,7 @@ private void loadRewardedVideoAd() {
106106
}
107107

108108
private void addCoins(int coins) {
109-
mCoinCount = mCoinCount + coins;
109+
mCoinCount += coins;
110110
mCoinCountText.setText("Coins: " + mCoinCount);
111111
}
112112

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,62 @@
1-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
24
xmlns:tools="http://schemas.android.com/tools"
35
android:layout_width="match_parent"
46
android:layout_height="match_parent"
5-
android:paddingBottom="@dimen/activity_vertical_margin"
6-
android:paddingLeft="@dimen/activity_horizontal_margin"
7-
android:paddingRight="@dimen/activity_horizontal_margin"
8-
android:paddingTop="@dimen/activity_vertical_margin"
9-
tools:context=".MainActivity">
7+
tools:context="com.google.ads.rewardedvideoexample.MainActivity">
108

119
<TextView
1210
android:id="@+id/game_title"
1311
android:layout_width="wrap_content"
1412
android:layout_height="wrap_content"
15-
android:layout_centerHorizontal="true"
16-
android:layout_marginTop="50dp"
1713
android:text="@string/impossible_game"
18-
android:textAppearance="?android:attr/textAppearanceLarge" />
14+
android:textAppearance="?android:attr/textAppearanceLarge"
15+
android:layout_marginTop="50dp"
16+
app:layout_constraintTop_toTopOf="parent"
17+
app:layout_constraintLeft_toLeftOf="parent"
18+
app:layout_constraintRight_toRightOf="parent" />
1919

2020
<TextView
2121
android:id="@+id/timer"
2222
android:layout_width="wrap_content"
2323
android:layout_height="wrap_content"
24-
android:layout_below="@+id/game_title"
25-
android:layout_centerHorizontal="true"
26-
android:textAppearance="?android:attr/textAppearanceLarge" />
24+
android:textAppearance="?android:attr/textAppearanceMedium"
25+
android:layout_marginTop="16dp"
26+
app:layout_constraintTop_toBottomOf="@id/game_title"
27+
app:layout_constraintLeft_toLeftOf="parent"
28+
app:layout_constraintRight_toRightOf="parent"
29+
/>
2730

2831
<Button
2932
android:id="@+id/retry_button"
3033
android:layout_width="wrap_content"
3134
android:layout_height="wrap_content"
32-
android:layout_centerHorizontal="true"
33-
android:layout_centerVertical="true"
35+
android:layout_marginTop="32dp"
36+
app:layout_constraintTop_toBottomOf="@id/timer"
37+
app:layout_constraintLeft_toLeftOf="parent"
38+
app:layout_constraintRight_toRightOf="parent"
3439
android:text="@string/retry_button_text" />
3540

3641
<Button
37-
android:id="@+id/watch_video"
42+
android:id="@+id/show_video_button"
3843
android:layout_width="wrap_content"
3944
android:layout_height="wrap_content"
40-
android:layout_below="@id/retry_button"
41-
android:layout_centerHorizontal="true"
45+
android:layout_marginTop="16dp"
46+
app:layout_constraintTop_toBottomOf="@id/retry_button"
47+
app:layout_constraintLeft_toLeftOf="parent"
48+
app:layout_constraintRight_toRightOf="parent"
4249
android:text="@string/watch_video_button_text" />
4350

4451
<TextView
4552
android:id="@+id/coin_count_text"
4653
android:layout_width="wrap_content"
4754
android:layout_height="wrap_content"
48-
android:layout_alignParentBottom="true"
49-
android:layout_alignParentLeft="true"
55+
android:layout_marginBottom="16dp"
56+
android:layout_marginLeft="16dp"
5057
android:text="@string/default_coin_text"
58+
app:layout_constraintBottom_toBottomOf="parent"
59+
app:layout_constraintLeft_toLeftOf="parent"
5160
android:textAppearance="?android:attr/textAppearanceLarge" />
5261

53-
</RelativeLayout>
62+
</android.support.constraint.ConstraintLayout>

java/admob/RewardedVideoExample/app/src/main/res/menu/menu_main.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

java/admob/RewardedVideoExample/app/src/main/res/values-w820dp/dimens.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

java/admob/RewardedVideoExample/app/src/main/res/values/dimens.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

java/advanced/NativeExpressRecyclerViewExample/gradle/wrapper/gradle-wrapper.jar renamed to java/advanced/BannerRecyclerViewExample/gradle/wrapper/gradle-wrapper.jar

File renamed without changes.

java/advanced/NativeListViewExample/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

java/advanced/NativeListViewExample/app/proguard-rules.pro

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)