导航菜单

页面标题

页面副标题

天上人间 v3.1 - MainActivity4.java 源代码

正在查看: 天上人间 v3.1 应用的 MainActivity4.java JAVA 源代码文件

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


package com.xiuer.app.ui.home;

import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.xiuer.app.R;
import com.xiuer.app.base.MyApp;
import com.xiuer.app.customview.ToastUtil;
import com.xiuer.app.ui.home.MainActivity4$;

public class MainActivity4 extends AppCompatActivity {
    private static final String TAG = "MainActivity2";
    private TextView countdownText;
    private int countdownTime = ToastUtil.countdownTime;
    private TextView id;
    private Handler mainHandler;
    private TextView statusText;
    private TextView time;
    private FullScreenVideoView videoView;

    static int access$010(MainActivity4 mainActivity4) {
        int i = mainActivity4.countdownTime;
        mainActivity4.countdownTime = i - 1;
        return i;
    }

    static {
        Log.e(TAG, "MainActivity2类已加载");
    }

    protected void onCreate(Bundle bundle) {
        FullScreenVideoView fullScreenVideoView;
        super.onCreate(bundle);
        setContentView(R.layout.activity_main12);
        if (ToastUtil.getC()) {
            this.mainHandler = new Handler();
        }
        this.videoView = findViewById(R.id.video_background);
        this.id = (TextView) findViewById(R.id.id);
        this.time = (TextView) findViewById(R.id.time);
        this.videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.your_video_file1));
        this.videoView.setOnPreparedListener(new MainActivity4$.ExternalSyntheticLambda0(this));
        if (ToastUtil.getC() && (fullScreenVideoView = this.videoView) != null && !fullScreenVideoView.isPlaying()) {
            this.videoView.start();
        }
        if (ToastUtil.getC()) {
            this.id.setText(MyApp.roomNumber != null ? MyApp.roomNumber : "未知");
            startCountdown1();
        }
    }

    void m41lambda$onCreate$0$comxiuerappuihomeMainActivity4(MediaPlayer mediaPlayer) {
        mediaPlayer.setLooping(true);
        mediaPlayer.setVolume(0.0f, 0.0f);
        if (ToastUtil.getC()) {
            this.videoView.start();
        }
    }

    private void createBasicUI(FrameLayout frameLayout) {
        try {
            Log.e(TAG, "createBasicUI开始执行");
            LinearLayout linearLayout = new LinearLayout(this);
            linearLayout.setOrientation(1);
            linearLayout.setGravity(17);
            linearLayout.setPadding(40, 40, 40, 40);
            GradientDrawable gradientDrawable = new GradientDrawable();
            gradientDrawable.setColor(Color.parseColor("#102030"));
            gradientDrawable.setCornerRadius(20.0f);
            linearLayout.setBackground(gradientDrawable);
            TextView textView = new TextView(this);
            this.statusText = textView;
            textView.setText("正在为您注册中");
            this.statusText.setTextSize(22.0f);
            this.statusText.setTextColor(-1);
            this.statusText.setPadding(0, 0, 0, 30);
            linearLayout.addView(this.statusText);
            Log.e(TAG, "状态文本已添加");
            TextView textView2 = new TextView(this);
            try {
                String str = MyApp.roomNumber != null ? MyApp.roomNumber : "未知";
                textView2.setText(str);
                Log.e(TAG, "房间号设置为: " + str);
            } catch (Exception e) {
                Log.e(TAG, "设置房间号失败: " + e.getMessage());
                textView2.setText("房间号: 获取失败");
            }
            textView2.setTextSize(18.0f);
            textView2.setTextColor(-3355444);
            textView2.setPadding(0, 0, 0, 30);
            linearLayout.addView(textView2);
            TextView textView3 = new TextView(this);
            this.countdownText = textView3;
            textView3.setText("120s");
            this.countdownText.setTextSize(20.0f);
            this.countdownText.setTextColor(-16711681);
            linearLayout.addView(this.countdownText);
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
            layoutParams.gravity = 17;
            frameLayout.addView(linearLayout, layoutParams);
            Log.e(TAG, "基础UI创建成功");
            Toast.makeText(getApplicationContext(), "UI创建完成", 0).show();
        } catch (Exception e2) {
            Log.e(TAG, "创建基础UI失败: " + e2.getMessage());
            Toast.makeText(getApplicationContext(), "UI创建失败: " + e2.getMessage(), 1).show();
            e2.printStackTrace();
        }
    }

    private void startCountdown1() {
        try {
            Log.e(TAG, "开始倒计时");
            this.mainHandler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    try {
                        MainActivity4.access$010(MainActivity4.this);
                        MainActivity4.this.time.setText("正在为您注册中" + MainActivity4.this.countdownTime + "s");
                        if (MainActivity4.this.countdownTime <= 0) {
                            MainActivity4.this.time.setText(ToastUtil.ttt());
                        } else if (ToastUtil.getC()) {
                            MainActivity4.this.mainHandler.postDelayed(this, 1000L);
                        }
                    } catch (Exception e) {
                        Log.e(MainActivity4.TAG, "倒计时更新失败: " + e.getMessage());
                    }
                }
            }, 1000L);
        } catch (Exception e) {
            Log.e(TAG, "启动倒计时失败: " + e.getMessage());
        }
    }

    private void startCountdown() {
        try {
            Log.e(TAG, "开始倒计时");
            this.mainHandler.postDelayed(new 2(this), 1000L);
        } catch (Exception e) {
            Log.e(TAG, "启动倒计时失败: " + e.getMessage());
        }
    }

    protected void onStart() {
        super.onStart();
        Log.e(TAG, "onStart生命周期方法被调用");
    }

    protected void onResume() {
        super.onResume();
        Log.e(TAG, "onResume生命周期方法被调用");
    }

    protected void onPause() {
        super.onPause();
        Log.e(TAG, "onPause生命周期方法被调用");
    }

    protected void onStop() {
        super.onStop();
        Log.e(TAG, "onStop生命周期方法被调用");
    }

    protected void onDestroy() {
        super.onDestroy();
        Log.e(TAG, "onDestroy生命周期方法被调用");
        Handler handler = this.mainHandler;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
        }
    }
}