导航菜单

页面标题

页面副标题

xDrip+ v04633772025.07.16 - Agreement.java 源代码

正在查看: xDrip+ v04633772025.07.16 应用的 Agreement.java JAVA 源代码文件

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


package com.eveningoutpost.dexdrip;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import com.eveningoutpost.dexdrip.models.JoH;

public class Agreement extends BaseAppCompatActivity {
    boolean IUnderstand;
    CheckBox agreeCheckBox;
    SharedPreferences prefs;
    Button saveButton;

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(2131492894);
        JoH.fixActionBar(this);
        SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        this.prefs = defaultSharedPreferences;
        this.IUnderstand = defaultSharedPreferences.getBoolean("warning_agreed_to", false);
        CheckBox checkBox = (CheckBox) findViewById(2131296353);
        this.agreeCheckBox = checkBox;
        checkBox.setChecked(this.IUnderstand);
        this.saveButton = (Button) findViewById(2131296924);
        addListenerOnButton();
        if (xdrip.isRunningTest()) {
            findViewById(2131296944).setScrollBarFadeDuration(100);
        }
    }

    public void addListenerOnButton() {
        this.saveButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Agreement.this.prefs.edit().putBoolean("warning_agreed_to", Agreement.this.agreeCheckBox.isChecked()).apply();
                Agreement agreement = Agreement.this;
                agreement.IUnderstand = agreement.prefs.getBoolean("warning_agreed_to", false);
                if (Agreement.this.IUnderstand) {
                    Agreement.this.startActivity(new Intent(Agreement.this.getApplicationContext(), (Class<?>) Home.class));
                    Agreement.this.finish();
                }
            }
        });
    }
}