Commit 6bb852b1 authored by xujialang's avatar xujialang

开屏逻辑调整

parent 00ba1ba0
...@@ -46,7 +46,7 @@ public class PictureApplication extends Application implements Application.Activ ...@@ -46,7 +46,7 @@ public class PictureApplication extends Application implements Application.Activ
@OnLifecycleEvent(Lifecycle.Event.ON_START) @OnLifecycleEvent(Lifecycle.Event.ON_START)
protected void onMoveToForeground() { protected void onMoveToForeground() {
// Show the ad (if available) when the app moves to foreground. // Show the ad (if available) when the app moves to foreground.
// TopOnAppOpenAdManager.getInstance().showAdIfAvailable(currentActivity); TopOnAppOpenAdManager.getInstance().showAdIfAvailable(currentActivity);
} }
......
...@@ -140,7 +140,7 @@ public class TopOnAppOpenAdManager { ...@@ -140,7 +140,7 @@ public class TopOnAppOpenAdManager {
* *
* @param activity the activity that shows the app open ad * @param activity the activity that shows the app open ad
*/ */
public boolean showAdIfAvailable(@NonNull Activity activity, @NonNull ViewGroup viewGroup) { public boolean showAdIfAvailable(@NonNull Activity activity) {
if (isShowingAd) { if (isShowingAd) {
LogUtils.d(LOG_TAG, "The app open ad is already showing."); LogUtils.d(LOG_TAG, "The app open ad is already showing.");
return false; return false;
...@@ -155,7 +155,8 @@ public class TopOnAppOpenAdManager { ...@@ -155,7 +155,8 @@ public class TopOnAppOpenAdManager {
LogUtils.d(LOG_TAG, "Will show ad."); LogUtils.d(LOG_TAG, "Will show ad.");
isShowingAd = true; isShowingAd = true;
appOpenAd.show(activity, viewGroup);
appOpenAd.show(activity, (ViewGroup) activity.getWindow().getDecorView());
return true; return true;
} }
......
package com.ads.cal.picturetranslate; package com.ads.cal.picturetranslate;
import static com.anythink.network.pangle.PangleATConst.DEBUGGER_CONFIG.Pangle_NETWORK;
import android.content.Context; import android.content.Context;
import com.anythink.core.api.ATDebuggerConfig;
import com.anythink.core.api.ATSDK; import com.anythink.core.api.ATSDK;
public class TopOnManager { public class TopOnManager {
...@@ -22,15 +25,15 @@ public class TopOnManager { ...@@ -22,15 +25,15 @@ public class TopOnManager {
public void initSDK(Context context) { public void initSDK(Context context) {
//SDK日志功能,集成测试阶段建议开启,上线前必须关闭 //SDK日志功能,集成测试阶段建议开启,上线前必须关闭
// ATSDK.setNetworkLogDebug(true); ATSDK.setNetworkLogDebug(true);
// //检查广告平台的集成状态,提交审核时需注释此API // //检查广告平台的集成状态,提交审核时需注释此API
// ATSDK.integrationChecking(context); // ATSDK.integrationChecking(context);
// //
// ATSDK.setDebuggerConfig( ATSDK.setDebuggerConfig(
// context, context,
// "596795a7-b851-4514-bd7e-8561d641a968", "596795a7-b851-4514-bd7e-8561d641a968",
// new ATDebuggerConfig.Builder(Pangle_NETWORK).build()); new ATDebuggerConfig.Builder(Pangle_NETWORK).build());
ATSDK.init(context, TOPON_APP_ID, TOPON_APP_KEY); ATSDK.init(context, TOPON_APP_ID, TOPON_APP_KEY);
......
...@@ -99,7 +99,7 @@ public class PictureTranslateStartActivity extends BaseActivity { ...@@ -99,7 +99,7 @@ public class PictureTranslateStartActivity extends BaseActivity {
} }
}); });
TopOnAppOpenAdManager.getInstance().showAdIfAvailable(this, findViewById(R.id.root_view)); TopOnAppOpenAdManager.getInstance().showAdIfAvailable(this);
} }
private void loadOpenAd() { private void loadOpenAd() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment