- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
125 lines
3.8 KiB
Java
125 lines
3.8 KiB
Java
package com.mbridge.msdk.newreward.player;
|
|
|
|
import android.app.Activity;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.view.WindowManager;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.core.view.InputDeviceCompat;
|
|
import androidx.core.view.accessibility.AccessibilityEventCompat;
|
|
import com.ironsource.v8;
|
|
import com.mbridge.msdk.foundation.controller.c;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.newreward.player.presenter.ActivityPresenter;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class BaseActivity extends Activity {
|
|
private final String TAG = "BaseActivity";
|
|
ActivityPresenter activityPresenter;
|
|
|
|
@Override // android.app.Activity
|
|
public void onCreate(@Nullable Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
setActivityFull();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onStart() {
|
|
super.onStart();
|
|
ActivityPresenter activityPresenter = this.activityPresenter;
|
|
if (activityPresenter == null) {
|
|
return;
|
|
}
|
|
activityPresenter.bindMethodName("onStart");
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onPause() {
|
|
super.onPause();
|
|
ActivityPresenter activityPresenter = this.activityPresenter;
|
|
if (activityPresenter == null) {
|
|
return;
|
|
}
|
|
activityPresenter.bindMethodName(v8.h.t0);
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onResume() {
|
|
super.onResume();
|
|
ActivityPresenter activityPresenter = this.activityPresenter;
|
|
if (activityPresenter == null) {
|
|
return;
|
|
}
|
|
activityPresenter.bindMethodName(v8.h.u0);
|
|
c.m().a(this);
|
|
hideNavigationBar();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onStop() {
|
|
super.onStop();
|
|
ActivityPresenter activityPresenter = this.activityPresenter;
|
|
if (activityPresenter == null) {
|
|
return;
|
|
}
|
|
activityPresenter.bindMethodName("onStop");
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
ActivityPresenter activityPresenter = this.activityPresenter;
|
|
if (activityPresenter == null) {
|
|
return;
|
|
}
|
|
activityPresenter.bindMethodName("onDestroy");
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onBackPressed() {
|
|
ActivityPresenter activityPresenter = this.activityPresenter;
|
|
if (activityPresenter == null) {
|
|
return;
|
|
}
|
|
activityPresenter.bindMethodName("onBackPressed");
|
|
}
|
|
|
|
@Override // android.app.Activity, android.view.Window.Callback
|
|
public void onWindowFocusChanged(boolean z) {
|
|
super.onWindowFocusChanged(z);
|
|
hideNavigationBar();
|
|
updateScreenSize(z);
|
|
}
|
|
|
|
private void setActivityFull() {
|
|
try {
|
|
requestWindowFeature(1);
|
|
getWindow().setFlags(1024, 1024);
|
|
getWindow().addFlags(512);
|
|
hideNavigationBar();
|
|
if (Build.VERSION.SDK_INT >= 28) {
|
|
WindowManager.LayoutParams attributes = getWindow().getAttributes();
|
|
attributes.layoutInDisplayCutoutMode = 1;
|
|
getWindow().setAttributes(attributes);
|
|
}
|
|
} catch (Exception e) {
|
|
af.b("BaseActivity", e.getMessage());
|
|
}
|
|
}
|
|
|
|
private void hideNavigationBar() {
|
|
try {
|
|
getWindow().addFlags(AccessibilityEventCompat.TYPE_VIEW_TARGETED_BY_SCROLL);
|
|
getWindow().getDecorView().setSystemUiVisibility(InputDeviceCompat.SOURCE_TOUCHSCREEN);
|
|
} catch (Throwable th) {
|
|
af.b("BaseActivity", th.getMessage());
|
|
}
|
|
}
|
|
|
|
private void updateScreenSize(boolean z) {
|
|
if (z) {
|
|
int i = getResources().getDisplayMetrics().widthPixels;
|
|
}
|
|
}
|
|
}
|