导航菜单

页面标题

页面副标题

Barstool v5.21.2 - BarstoolVideoActivity.java 源代码

正在查看: Barstool v5.21.2 应用的 BarstoolVideoActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.barstoolsports.video;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.WindowInsetsControllerCompat;
import androidx.media3.exoplayer.ExoPlayer;
import com.barstoolsports.ads.AdTagHelper;
import com.barstoolsports.videoservice.BarstoolVideoService;
import dagger.hilt.android.AndroidEntryPoint;
import javax.inject.Inject;
import kotlin.Deprecated;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;

@Metadata(d1 = {"\u0000E\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006*\u0001\u0018\b\u0007\u0018\u0000 \"2\u00020\u0001:\u0001\"B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0012\u0010\u001a\u001a\u00020\u001b2\b\u0010\u001c\u001a\u0004\u0018\u00010\u001dH\u0014J\b\u0010\u001e\u001a\u00020\u001bH\u0017J\b\u0010\u001f\u001a\u00020\u001bH\u0014J\b\u0010 \u001a\u00020\u001bH\u0014J\b\u0010!\u001a\u00020\u001bH\u0002R\u001e\u0010\u0004\u001a\u00020\u00058\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR\u001e\u0010\n\u001a\u00020\u000b8\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000fR\u000e\u0010\u0010\u001a\u00020\u0011X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0013X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0015X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0016\u001a\u00020\u0015X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0017\u001a\u00020\u0018X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0019¨\u0006#"}, d2 = {"Lcom/barstoolsports/video/BarstoolVideoActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "<init>", "()V", "storySessionCache", "Lcom/barstoolsports/video/StorySessionCache;", "getStorySessionCache", "()Lcom/barstoolsports/video/StorySessionCache;", "setStorySessionCache", "(Lcom/barstoolsports/video/StorySessionCache;)V", "adTagHelper", "Lcom/barstoolsports/ads/AdTagHelper;", "getAdTagHelper", "()Lcom/barstoolsports/ads/AdTagHelper;", "setAdTagHelper", "(Lcom/barstoolsports/ads/AdTagHelper;)V", "videoView", "Lcom/barstoolsports/video/BarstoolVideoView;", "videoService", "Lcom/barstoolsports/videoservice/BarstoolVideoService;", "bound", "", "shouldStopVideoOnPause", "connection", "com/barstoolsports/video/BarstoolVideoActivity$connection$1", "Lcom/barstoolsports/video/BarstoolVideoActivity$connection$1;", "onCreate", "", "savedInstanceState", "Landroid/os/Bundle;", "onBackPressed", "onPause", "onDestroy", "hideSystemUI", "Companion", "video_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
@AndroidEntryPoint
public final class BarstoolVideoActivity extends Hilt_BarstoolVideoActivity {
    public static final String EXTRA_MEDIA_URI = "BarstoolVideoActivity.extra_media_uri";
    public static final String EXTRA_POSITION = "BarstoolVideoActivity.extra_position";
    private static final String TAG = "BarstoolVideoActivity";

    @Inject
    public AdTagHelper adTagHelper;
    private boolean bound;

    @Inject
    public StorySessionCache storySessionCache;
    private BarstoolVideoService videoService;
    private BarstoolVideoView videoView;
    private boolean shouldStopVideoOnPause = true;
    private final BarstoolVideoActivity$connection$1 connection = new BarstoolVideoActivity$connection$1(this);

    public final StorySessionCache getStorySessionCache() {
        StorySessionCache storySessionCache = this.storySessionCache;
        if (storySessionCache != null) {
            return storySessionCache;
        }
        Intrinsics.throwUninitializedPropertyAccessException("storySessionCache");
        return null;
    }

    public final void setStorySessionCache(StorySessionCache storySessionCache) {
        Intrinsics.checkNotNullParameter(storySessionCache, "<set-?>");
        this.storySessionCache = storySessionCache;
    }

    public final AdTagHelper getAdTagHelper() {
        AdTagHelper adTagHelper = this.adTagHelper;
        if (adTagHelper != null) {
            return adTagHelper;
        }
        Intrinsics.throwUninitializedPropertyAccessException("adTagHelper");
        return null;
    }

    public final void setAdTagHelper(AdTagHelper adTagHelper) {
        Intrinsics.checkNotNullParameter(adTagHelper, "<set-?>");
        this.adTagHelper = adTagHelper;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_barstool_video);
        BarstoolVideoView barstoolVideoView = (BarstoolVideoView) findViewById(R.id.barstool_video_view);
        this.videoView = barstoolVideoView;
        BarstoolVideoView barstoolVideoView2 = null;
        if (barstoolVideoView == null) {
            Intrinsics.throwUninitializedPropertyAccessException("videoView");
            barstoolVideoView = null;
        }
        barstoolVideoView.setCompletionListener(new Function0() {
            public final Object invoke() {
                Unit onCreate$lambda$0;
                onCreate$lambda$0 = BarstoolVideoActivity.onCreate$lambda$0(BarstoolVideoActivity.this);
                return onCreate$lambda$0;
            }
        });
        BarstoolVideoView barstoolVideoView3 = this.videoView;
        if (barstoolVideoView3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("videoView");
            barstoolVideoView3 = null;
        }
        barstoolVideoView3.setFullScreenListener(new Function2() {
            public final Object invoke(Object obj, Object obj2) {
                Unit onCreate$lambda$1;
                onCreate$lambda$1 = BarstoolVideoActivity.onCreate$lambda$1(BarstoolVideoActivity.this, (String) obj, ((Long) obj2).longValue());
                return onCreate$lambda$1;
            }
        });
        BarstoolVideoView barstoolVideoView4 = this.videoView;
        if (barstoolVideoView4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("videoView");
        } else {
            barstoolVideoView2 = barstoolVideoView4;
        }
        barstoolVideoView2.setFullscreenUi(true);
        bindService(new Intent((Context) this, (Class<?>) BarstoolVideoService.class), this.connection, 1);
        hideSystemUI();
    }

    public static final Unit onCreate$lambda$0(BarstoolVideoActivity barstoolVideoActivity) {
        barstoolVideoActivity.onBackPressed();
        return Unit.INSTANCE;
    }

    public static final Unit onCreate$lambda$1(BarstoolVideoActivity barstoolVideoActivity, String str, long j) {
        Intrinsics.checkNotNullParameter(str, "<unused var>");
        barstoolVideoActivity.onBackPressed();
        return Unit.INSTANCE;
    }

    @Deprecated(message = "Deprecated in Java")
    public void onBackPressed() {
        this.shouldStopVideoOnPause = false;
        Intent intent = new Intent();
        BarstoolVideoView barstoolVideoView = this.videoView;
        if (barstoolVideoView == null) {
            Intrinsics.throwUninitializedPropertyAccessException("videoView");
            barstoolVideoView = null;
        }
        ExoPlayer preparedExoPlayer = barstoolVideoView.getPreparedExoPlayer();
        intent.putExtra(EXTRA_POSITION, preparedExoPlayer != null ? Long.valueOf(preparedExoPlayer.getContentPosition()) : null);
        Unit unit = Unit.INSTANCE;
        setResult(-1, intent);
        super.onBackPressed();
    }

    protected void onPause() {
        super.onPause();
        if (this.shouldStopVideoOnPause) {
            BarstoolVideoView barstoolVideoView = this.videoView;
            if (barstoolVideoView == null) {
                Intrinsics.throwUninitializedPropertyAccessException("videoView");
                barstoolVideoView = null;
            }
            ExoPlayer preparedExoPlayer = barstoolVideoView.getPreparedExoPlayer();
            if (preparedExoPlayer != null) {
                preparedExoPlayer.setPlayWhenReady(false);
            }
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (this.bound) {
            unbindService(this.connection);
            this.bound = false;
        }
    }

    private final void hideSystemUI() {
        WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
        WindowInsetsControllerCompat windowInsetsControllerCompat = new WindowInsetsControllerCompat(getWindow(), getWindow().getDecorView());
        windowInsetsControllerCompat.hide(WindowInsetsCompat.Type.systemBars());
        windowInsetsControllerCompat.setSystemBarsBehavior(2);
    }
}