Commit 6bb852b1 authored by xujialang's avatar xujialang

开屏逻辑调整

parent 00ba1ba0
......@@ -46,7 +46,7 @@ public class PictureApplication extends Application implements Application.Activ
@OnLifecycleEvent(Lifecycle.Event.ON_START)
protected void onMoveToForeground() {
// 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 {
*
* @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) {
LogUtils.d(LOG_TAG, "The app open ad is already showing.");
return false;
......@@ -155,7 +155,8 @@ public class TopOnAppOpenAdManager {
LogUtils.d(LOG_TAG, "Will show ad.");
isShowingAd = true;
appOpenAd.show(activity, viewGroup);
appOpenAd.show(activity, (ViewGroup) activity.getWindow().getDecorView());
return true;
}
......
package com.ads.cal.picturetranslate;
import static com.anythink.network.pangle.PangleATConst.DEBUGGER_CONFIG.Pangle_NETWORK;
import android.content.Context;
import com.anythink.core.api.ATDebuggerConfig;
import com.anythink.core.api.ATSDK;
public class TopOnManager {
......@@ -22,15 +25,15 @@ public class TopOnManager {
public void initSDK(Context context) {
//SDK日志功能,集成测试阶段建议开启,上线前必须关闭
// ATSDK.setNetworkLogDebug(true);
ATSDK.setNetworkLogDebug(true);
// //检查广告平台的集成状态,提交审核时需注释此API
// ATSDK.integrationChecking(context);
//
// ATSDK.setDebuggerConfig(
// context,
// "596795a7-b851-4514-bd7e-8561d641a968",
// new ATDebuggerConfig.Builder(Pangle_NETWORK).build());
ATSDK.setDebuggerConfig(
context,
"596795a7-b851-4514-bd7e-8561d641a968",
new ATDebuggerConfig.Builder(Pangle_NETWORK).build());
ATSDK.init(context, TOPON_APP_ID, TOPON_APP_KEY);
......
......@@ -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() {
......
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