正在查看: 六分钟步行测试管理软件 v1.1.0.2112120029 应用的 AlarmSet.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 六分钟步行测试管理软件 v1.1.0.2112120029 应用的 AlarmSet.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package cn.neoprint.padmonitor.ui;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import cn.neoprint.padmonitor.R;
import cn.neoprint.padmonitor.app.AppGlobal;
import cn.neoprint.padmonitor.utils.FontManager;
public class AlarmSet extends Activity implements View.OnClickListener, SeekBar.OnSeekBarChangeListener {
private Switch AlmPermissionswitch;
private int alarmPauseTime;
private RadioButton alarmPauseTime1;
private RadioButton alarmPauseTime2;
private RadioGroup alarmPauseTime_rgp;
private AudioManager audiomanage;
private RadioGroup boltLockGroup;
private RadioButton boltLockRadioButton;
Button btnpatientinfo;
private float currentVolume;
public SharedPreferences gzj;
private RadioButton isBoltLockRadioButton;
private float m_tempcurrentVolume;
private SeekBar seekBar;
private int tempalarmPauseTime;
AppGlobal myApp = null;
private int maxVol = 0;
private boolean isBoltLock = true;
private boolean m_bALMPermission = false;
private boolean m_bInit = false;
private boolean m_bOpenPassword = false;
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
requestWindowFeature(1);
AppGlobal appGlobal = (AppGlobal) getApplication();
this.myApp = appGlobal;
appGlobal.setSystemBarVisible(this, false);
setContentView(R.layout.alarm_set);
this.myApp.SetBackgroundLight(this, -255, 78, true);
((TextView) findViewById(R.id.Alarm_goback)).setOnClickListener(this);
FontManager.changeFonts((ViewGroup) getWindow().getDecorView(), this, Typeface.createFromAsset(getAssets(), "fonts/MSBlack.ttf"));
((TextView) findViewById(R.id.Alarm_Yes)).setOnClickListener(this);
setFinishOnTouchOutside(false);
SeekBar seekBar = (SeekBar) findViewById(R.id.SeekBarAlarmVol);
this.seekBar = seekBar;
seekBar.setOnSeekBarChangeListener(this);
AudioManager audioManager = (AudioManager) getSystemService("audio");
this.audiomanage = audioManager;
this.maxVol = audioManager.getStreamMaxVolume(3);
SharedPreferences sharedPreferences = getSharedPreferences("gzj", 0);
this.gzj = sharedPreferences;
float f = sharedPreferences.getFloat("AlarmCurrentVolume", this.maxVol);
int i = this.maxVol;
float f2 = f * i;
this.currentVolume = f2;
this.m_tempcurrentVolume = f2;
this.seekBar.setMax(i);
this.seekBar.setProgress((int) this.currentVolume);
this.alarmPauseTime_rgp = (RadioGroup) findViewById(R.id.alarmpausetime);
this.alarmPauseTime1 = (RadioButton) findViewById(R.id.pause1m);
this.alarmPauseTime2 = (RadioButton) findViewById(R.id.pause2m);
int i2 = this.gzj.getInt("AlarmPauseTime", 120);
this.alarmPauseTime = i2;
this.tempalarmPauseTime = i2;
if (i2 == 60) {
this.alarmPauseTime1.setChecked(true);
} else if (i2 == 120) {
this.alarmPauseTime2.setChecked(true);
}
this.alarmPauseTime_rgp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i3) {
switch (i3) {
case R.id.pause1m:
AlarmSet.this.tempalarmPauseTime = 60;
break;
case R.id.pause2m:
AlarmSet.this.tempalarmPauseTime = 120;
break;
}
}
});
Switch r5 = (Switch) findViewById(R.id.alarmpermission);
this.AlmPermissionswitch = r5;
r5.setOnClickListener(this);
this.AlmPermissionswitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
AlarmSet.this.m_bALMPermission = z;
if (!AlarmSet.this.m_bInit) {
AlarmSet.this.m_bInit = true;
} else {
if (AlarmSet.this.m_bOpenPassword) {
return;
}
AlarmSet.this.StartInputPassword();
}
}
});
this.AlmPermissionswitch.setChecked(this.myApp.m_ALMPermission);
}
public void StartInputPassword() {
Bundle bundle = new Bundle();
Intent intent = new Intent();
intent.putExtras(bundle);
intent.setClass(this, InputPasswordActivity.class);
startActivityForResult(intent, 1);
setVisible(false);
this.m_bOpenPassword = true;
}
public void boltLockModle() {
this.boltLockGroup = (RadioGroup) findViewById(R.id.alarmtype_rgp);
this.boltLockRadioButton = (RadioButton) findViewById(R.id.noalarmLock);
this.isBoltLockRadioButton = (RadioButton) findViewById(R.id.alarmLock);
boolean z = this.gzj.getBoolean("isBoltLock", true);
this.isBoltLock = z;
if (z) {
this.isBoltLockRadioButton.setChecked(true);
} else if (!z) {
this.boltLockRadioButton.setChecked(true);
}
this.boltLockGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if (i == 2131362149) {
AlarmSet.this.isBoltLock = true;
} else {
if (i != 2131363047) {
return;
}
AlarmSet.this.isBoltLock = false;
}
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
public void finish() {
super.finish();
overridePendingTransition(0, R.anim.zoomout);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.Alarm_Yes:
SavePara();
finish();
break;
case R.id.Alarm_goback:
finish();
break;
}
}
@Override
protected void onActivityResult(int i, int i2, Intent intent) {
if (i == 1) {
if (intent != null) {
this.AlmPermissionswitch.setChecked(this.m_bALMPermission);
this.myApp.m_ALMPermission = this.m_bALMPermission;
} else {
this.AlmPermissionswitch.setChecked(this.myApp.m_ALMPermission);
}
}
setVisible(true);
this.m_bOpenPassword = false;
}
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
if (i != 0) {
this.audiomanage.setStreamVolume(3, i, 4);
}
this.m_tempcurrentVolume = i;
}
public void SavePara() {
SharedPreferences.Editor edit = this.gzj.edit();
Bundle bundle = new Bundle();
Intent intent = new Intent();
float f = this.currentVolume;
float f2 = this.m_tempcurrentVolume;
if (f != f2) {
edit.putFloat("AlarmCurrentVolume", f2 / this.maxVol);
this.currentVolume = this.m_tempcurrentVolume;
bundle.putBoolean("UpdateAlarmVolume", true);
}
int i = this.tempalarmPauseTime;
if (i != this.alarmPauseTime) {
edit.putInt("AlarmPauseTime", i);
bundle.putBoolean("UpdateAlarmPauseTime", true);
}
if (this.isBoltLock != this.gzj.getBoolean("isBoltLock", true)) {
edit.putBoolean("isBoltLock", this.isBoltLock);
bundle.putBoolean("UpdateAlarmboltLock", true);
}
this.myApp.m_ALMPermission = this.m_bALMPermission;
intent.putExtras(bundle);
setResult(10, intent);
edit.commit();
}
}