- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
176 lines
6.3 KiB
Java
176 lines
6.3 KiB
Java
package com.fyber.inneractive.sdk.activities;
|
|
|
|
import android.R;
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.res.Configuration;
|
|
import android.graphics.drawable.ColorDrawable;
|
|
import android.os.Bundle;
|
|
import android.text.TextUtils;
|
|
import android.view.ViewGroup;
|
|
import android.view.WindowManager;
|
|
import androidx.annotation.NonNull;
|
|
import com.fyber.inneractive.sdk.config.global.features.p;
|
|
import com.fyber.inneractive.sdk.external.InneractiveAdSpot;
|
|
import com.fyber.inneractive.sdk.external.InneractiveAdSpotManager;
|
|
import com.fyber.inneractive.sdk.flow.p;
|
|
import com.fyber.inneractive.sdk.flow.r;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import com.fyber.inneractive.sdk.util.o;
|
|
import com.fyber.inneractive.sdk.web.u;
|
|
import com.google.android.gms.drive.DriveFile;
|
|
import com.ironsource.mediationsdk.utils.IronSourceConstants;
|
|
import java.lang.ref.WeakReference;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class InternalStoreWebpageActivity extends InneractiveBaseActivity {
|
|
public static final String EXTRA_KEY_SPOT_ID = "spotId";
|
|
public ViewGroup b;
|
|
public u c;
|
|
public p.a d = p.a.FullScreen;
|
|
|
|
public static void startActivity(Context context, String str) {
|
|
Intent intent = new Intent(context, (Class<?>) InternalStoreWebpageActivity.class);
|
|
intent.putExtra("spotId", str);
|
|
if (!(context instanceof Activity)) {
|
|
intent.setFlags(DriveFile.MODE_READ_ONLY);
|
|
}
|
|
context.startActivity(intent);
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void finish() {
|
|
super.finish();
|
|
u uVar = this.c;
|
|
if (uVar != null) {
|
|
uVar.C = false;
|
|
u.d dVar = uVar.i;
|
|
if (dVar != null) {
|
|
r rVar = (r) dVar;
|
|
IAlog.a("onInternalStoreWebpageDismissed callback called", new Object[0]);
|
|
if (rVar.c != 0) {
|
|
IAlog.a("%sCalling external interface onAdWillCloseInternalBrowser", IAlog.a(rVar));
|
|
rVar.c.onAdWillCloseInternalBrowser(rVar.a);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.app.Activity, android.content.ComponentCallbacks
|
|
public void onConfigurationChanged(@NonNull Configuration configuration) {
|
|
super.onConfigurationChanged(configuration);
|
|
WindowManager.LayoutParams attributes = getWindow().getAttributes();
|
|
if (attributes.width == o.g() || this.d != p.a.Modal) {
|
|
return;
|
|
}
|
|
attributes.gravity = 83;
|
|
attributes.height = (int) (o.f() * 0.8f);
|
|
attributes.width = o.g();
|
|
getWindow().setAttributes(attributes);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.activities.InneractiveBaseActivity, android.app.Activity
|
|
public void onCreate(Bundle bundle) {
|
|
InneractiveAdSpot spot;
|
|
String stringExtra = getIntent().getStringExtra("spotId");
|
|
if (TextUtils.isEmpty(stringExtra)) {
|
|
IAlog.f("%sSpot id is empty", IAlog.a(this));
|
|
spot = null;
|
|
} else {
|
|
spot = InneractiveAdSpotManager.get().getSpot(stringExtra);
|
|
}
|
|
if (spot == null || spot.getAdContent() == null) {
|
|
super.onCreate(bundle);
|
|
finish();
|
|
return;
|
|
}
|
|
p pVar = (p) spot.getAdContent().c.a(p.class);
|
|
p.a d = pVar != null ? pVar.d() : p.a.FullScreen;
|
|
this.d = d;
|
|
if (d == p.a.Modal) {
|
|
WindowManager.LayoutParams attributes = getWindow().getAttributes();
|
|
attributes.gravity = 83;
|
|
attributes.height = (int) (o.f() * 0.8f);
|
|
attributes.width = o.g();
|
|
attributes.dimAmount = 0.3f;
|
|
getWindow().setAttributes(attributes);
|
|
getWindow().getDecorView().setBackgroundColor(0);
|
|
getWindow().addFlags(IronSourceConstants.INIT_COMPLETE);
|
|
getWindow().setBackgroundDrawable(new ColorDrawable(0));
|
|
} else {
|
|
setTheme(R.style.Theme.NoTitleBar.Fullscreen);
|
|
}
|
|
super.onCreate(bundle);
|
|
setContentView(com.fyber.inneractive.sdk.R.layout.ia_layout_activity_internal_store_webpage);
|
|
this.b = (ViewGroup) findViewById(com.fyber.inneractive.sdk.R.id.internal_store_content);
|
|
u c = spot.getAdContent().c();
|
|
this.c = c;
|
|
if (c != null) {
|
|
c.q = new WeakReference<>(this);
|
|
u uVar = this.c;
|
|
com.fyber.inneractive.sdk.ignite.i iVar = uVar.h;
|
|
if (iVar != null) {
|
|
((p.a) iVar).a(com.fyber.inneractive.sdk.network.r.IGNITE_FLOW_STORE_PAGE_OPENED, uVar.B ? com.fyber.inneractive.sdk.ignite.l.TRUE_SINGLE_TAP : com.fyber.inneractive.sdk.ignite.l.SINGLE_TAP);
|
|
}
|
|
this.c.t.set(0);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.activities.InneractiveBaseActivity, android.app.Activity
|
|
public void onDestroy() {
|
|
InneractiveAdSpot spot;
|
|
u uVar;
|
|
super.onDestroy();
|
|
String stringExtra = getIntent().getStringExtra("spotId");
|
|
if (TextUtils.isEmpty(stringExtra)) {
|
|
IAlog.f("%sSpot id is empty", IAlog.a(this));
|
|
spot = null;
|
|
} else {
|
|
spot = InneractiveAdSpotManager.get().getSpot(stringExtra);
|
|
}
|
|
if (spot == null || spot.getAdContent() == null || spot.getAdContent().e() || (uVar = this.c) == null) {
|
|
return;
|
|
}
|
|
uVar.y = true;
|
|
uVar.D = false;
|
|
uVar.b.h.remove(uVar);
|
|
uVar.i = null;
|
|
IAlog.a("destroy internalStoreWebpageController", new Object[0]);
|
|
this.c = null;
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onPause() {
|
|
super.onPause();
|
|
ViewGroup viewGroup = this.b;
|
|
if (viewGroup != null) {
|
|
viewGroup.removeAllViews();
|
|
}
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onResume() {
|
|
super.onResume();
|
|
u uVar = this.c;
|
|
if (uVar != null) {
|
|
this.b.addView(uVar.a, new ViewGroup.LayoutParams(-1, -1));
|
|
}
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onBackPressed() {
|
|
u uVar = this.c;
|
|
if (uVar != null) {
|
|
if (uVar.x) {
|
|
return;
|
|
}
|
|
if (uVar.w) {
|
|
uVar.d("navigateBack();");
|
|
return;
|
|
}
|
|
}
|
|
super.onBackPressed();
|
|
}
|
|
}
|