-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Showing
22 changed files
with
287 additions
and
91 deletions.
There are no files selected for viewing
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
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
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
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
28 changes: 28 additions & 0 deletions
28
...rc/oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsMediaViewManagerDelegate.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,28 @@ | ||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.facebook.react.uimanager.BaseViewManagerDelegate; | ||
import com.facebook.react.uimanager.BaseViewManagerInterface; | ||
|
||
public class RNGoogleMobileAdsMediaViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & RNGoogleMobileAdsMediaViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { | ||
public RNGoogleMobileAdsMediaViewManagerDelegate(U viewManager) { | ||
super(viewManager); | ||
} | ||
|
||
@Override | ||
public void setProperty(@NonNull T view, String propName, @Nullable Object value) { | ||
assert propName != null; | ||
switch (propName) { | ||
case "responseId": | ||
mViewManager.setResponseId(view, value == null ? null : (String) value); | ||
break; | ||
case "resizeMode": | ||
mViewManager.setResizeMode(view, value == null ? null : (String) value); | ||
break; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...c/oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsMediaViewManagerInterface.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,10 @@ | ||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
public interface RNGoogleMobileAdsMediaViewManagerInterface<T extends View> { | ||
void setResponseId(T view, @Nullable String responseId); | ||
void setResizeMode(T view, @Nullable String resizeMode); | ||
} |
32 changes: 32 additions & 0 deletions
32
...c/oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsNativeViewManagerDelegate.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,32 @@ | ||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.facebook.react.bridge.ReadableArray; | ||
import com.facebook.react.uimanager.BaseViewManagerDelegate; | ||
import com.facebook.react.uimanager.BaseViewManagerInterface; | ||
|
||
public class RNGoogleMobileAdsNativeViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & RNGoogleMobileAdsNativeViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { | ||
public RNGoogleMobileAdsNativeViewManagerDelegate(U viewManager) { | ||
super(viewManager); | ||
} | ||
|
||
@Override | ||
public void setProperty(@NonNull T view, String propName, @Nullable Object value) { | ||
assert propName != null; | ||
if (propName.equals("responseId")) { | ||
mViewManager.setResponseId(view, value == null ? null : (String) value); | ||
} | ||
} | ||
|
||
@Override | ||
public void receiveCommand(@NonNull T view, String commandName, ReadableArray args) { | ||
assert commandName != null; | ||
if (commandName.equals("registerAsset")) { | ||
mViewManager.registerAsset(view, args.getString(0), args.getInt(1)); | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
.../oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsNativeViewManagerInterface.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,10 @@ | ||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
public interface RNGoogleMobileAdsNativeViewManagerInterface<T extends View> { | ||
void setResponseId(T view, @Nullable String responseId); | ||
void registerAsset(T view, String assetKey, int reactTag); | ||
} |
18 changes: 18 additions & 0 deletions
18
android/src/oldarch/io/invertase/googlemobileads/NativeGoogleMobileAdsNativeModuleSpec.kt
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,18 @@ | ||
package io.invertase.googlemobileads | ||
|
||
import com.facebook.react.bridge.Promise | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule | ||
import com.facebook.react.bridge.ReadableMap | ||
import com.facebook.react.modules.core.DeviceEventManagerModule | ||
|
||
abstract class NativeGoogleMobileAdsNativeModuleSpec(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { | ||
abstract fun load(adUnitId: String, requestOptions: ReadableMap, promise: Promise) | ||
abstract fun destroy(responseId: String) | ||
|
||
fun emitOnAdEvent(params: ReadableMap) { | ||
reactApplicationContext | ||
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) | ||
.emit("RNGMANativeAdEvent", params) | ||
} | ||
} |
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
Oops, something went wrong.