正在查看: Tasker v6.5.11 应用的 TimeSelect.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Tasker v6.5.11 应用的 TimeSelect.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package net.dinglisch.android.taskerm;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.InputFilter;
import android.text.format.DateFormat;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.ToggleButton;
import java.util.ArrayList;
import java.util.Calendar;
import net.dinglisch.android.taskerm.HTMLView;
public class TimeSelect extends MyActivity implements CompoundButton.OnCheckedChangeListener, pf.a {
private static final int[] L = {2131297631, 2131297633};
private static final int[] M = {2131297682, 2131297687};
private static final int[] N = {2131296919, 2131297642};
private static final int[] O = {2131297685, 2131297686};
private static final int[] P = {2131297683, 2131297684};
private static final int[] Q = {2131297541, 2131297542};
private ToggleButton B;
private ToggleButton C;
private ToggleButton D;
private Spinner E;
private EditText F;
private ImageView x;
private ImageButton[] v = new ImageButton[2];
private TimePicker[] w = new TimePicker[2];
private EditText[] y = new EditText[2];
private ViewGroup[] z = new ViewGroup[2];
private View[] A = new View[2];
private TextView[] G = new TextView[2];
private kp H = null;
protected ArrayList<String> I = null;
private boolean J = false;
public com.joaomgcd.taskerm.helper.i K = new com.joaomgcd.taskerm.helper.i(this);
class a implements View.OnClickListener {
a() {
}
@Override
public void onClick(View view) {
TimeSelect timeSelect = TimeSelect.this;
timeSelect.A0(0, true, timeSelect.z[0].getVisibility() == 0, true);
TimeSelect timeSelect2 = TimeSelect.this;
timeSelect2.C0(timeSelect2.y[0]);
}
}
class b implements View.OnClickListener {
b() {
}
@Override
public void onClick(View view) {
TimeSelect timeSelect = TimeSelect.this;
timeSelect.A0(1, true, timeSelect.z[1].getVisibility() == 0, true);
TimeSelect timeSelect2 = TimeSelect.this;
timeSelect2.C0(timeSelect2.y[1]);
}
}
class c implements View.OnClickListener {
final int i;
c(int i) {
this.i = i;
}
@Override
public void onClick(View view) {
TimeSelect.this.D0(this.i);
}
}
class d extends xg {
final int b;
final View c;
d(int i, View view) {
this.b = i;
this.c = view;
}
@Override
public void e() {
int i = this.b;
if (i != 0) {
this.c.setVisibility(i);
}
}
}
class e extends Handler {
final EditText a;
e(EditText editText) {
this.a = editText;
}
@Override
public void handleMessage(Message message) {
if (message.what == 1) {
String string = message.getData().getString("text");
if (!string.startsWith("%")) {
string = ri.r(string);
}
EditText editText = this.a;
if (editText == null) {
r7.k("TS", "no text focus on return from variable select");
} else {
dq.W2(editText, string);
}
}
}
}
public void A0(int i, boolean z, boolean z2, boolean z3) {
int i2;
int i3 = 0;
if (z3 && !Settings.N3(this)) {
z3 = false;
}
int i4 = 8;
int i5 = 4;
if (z) {
if (z2) {
i2 = 8;
i5 = 0;
} else {
if (this.y[i].length() == 0) {
dq.W2(this.y[i], "%");
}
i2 = 0;
}
if (Settings.j1(dq.R0(this))) {
i3 = 8;
}
} else {
i2 = 8;
i3 = 8;
i4 = 0;
}
B0(this.w[i], i5, z3);
B0(this.z[i], i2, z3);
B0(this.v[i], i3, z3);
B0(this.G[i], i4, z3);
}
private void B0(View view, int i, boolean z) {
if (view.getVisibility() != i) {
if (!z) {
view.setVisibility(i);
return;
}
if (i == 0) {
view.setVisibility(i);
}
xg.i(this, view, i == 0 ? 2130772001 : 2130772003, 0L, 300L, new d(i, view));
}
}
public void C0(EditText editText) {
if (editText.getVisibility() == 0) {
editText.requestFocus();
}
}
public void D0(int i) {
ArrayList<String> a0 = kq.a0(this, this.I);
if (a0.size() == 0) {
dq.j0(this, 2131887858, new Object[0]);
return;
}
wj D = wj.D(this, new e(this.y[i]), 2131887564);
D.G(a0);
D.C(this);
}
private boolean E0(String str, String str2) {
if (!kq.K(str2)) {
return dq.b0(this, str + ": " + vh.g(this, 2131887781, new Object[0]), new Object[0]);
}
if (!kq.L1(str2)) {
return dq.a0(this, 2131887766, str);
}
if (!kq.S0(str2)) {
return true;
}
return dq.b0(this, str + ": " + vh.g(this, 2131890306, new Object[0]), new Object[0]);
}
private boolean F0() {
return ti.d(getPackageManager());
}
private void n0(int i) {
for (int i2 = 0; i2 < 2; i2++) {
this.w[i].clearFocus();
}
}
public static Intent o0(kp kpVar) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(th.B(), TimeSelect.class.getName()));
if (kpVar != null) {
intent.putExtra("sTsc", kpVar.U(0).c0());
}
return intent;
}
private void q0(int i, ToggleButton toggleButton, boolean z, int i2, int i3) {
if (z) {
this.w[i].setCurrentHour(Integer.valueOf(i2));
this.w[i].setCurrentMinute(Integer.valueOf(i3));
}
}
public void r0(View view) {
this.K.Q(com.joaomgcd.taskerm.dialog.a.s1(this, 2131887666, 2131887346));
}
private void s0() {
Intent intent = new Intent();
Bundle bundle = new Bundle();
v0(bundle);
intent.putExtras(bundle);
setResult(-1, intent);
}
private void t0() {
setContentView(2131494253);
for (int i = 0; i < 2; i++) {
TimePicker timePicker = (TimePicker) findViewById(L[i]);
this.w[i] = timePicker;
timePicker.setIs24HourView(Boolean.valueOf(DateFormat.is24HourFormat(this)));
this.y[i] = (EditText) findViewById(M[i]);
this.v[i] = (ImageButton) findViewById(Q[i]);
this.A[i] = findViewById(O[i]);
this.z[i] = (ViewGroup) findViewById(P[i]);
this.G[i] = (TextView) findViewById(N[i]);
this.A[i].setOnClickListener(new c(i));
if (tp.e0()) {
up.v(timePicker);
}
dq.T2(this.v[i], 2131891277, true);
}
this.F = (EditText) findViewById(2131297310);
Spinner spinner = (Spinner) findViewById(2131297309);
this.E = spinner;
spinner.setAdapter((SpinnerAdapter) dq.f1(this, 2130903175));
ToggleButton toggleButton = (ToggleButton) findViewById(2131296606);
this.B = toggleButton;
toggleButton.setOnCheckedChangeListener(this);
ToggleButton toggleButton2 = (ToggleButton) findViewById(2131296608);
this.C = toggleButton2;
toggleButton2.setOnCheckedChangeListener(this);
dq.M2(this, 2131296919, 2131891196);
dq.M2(this, 2131297642, 2131891196);
ToggleButton toggleButton3 = (ToggleButton) findViewById(2131296610);
this.D = toggleButton3;
toggleButton3.setOnCheckedChangeListener(this);
this.x = new ImageView(this);
}
private void v0(Bundle bundle) {
p0(this.H);
bundle.putBundle("sTsc", this.H.U(0).c0());
}
private void x0() {
int i = !this.B.isChecked() ? 2131890826 : 2131890825;
this.B.setText(vh.g(this, 2131890822, new Object[0]));
this.B.setTextOn(vh.g(this, 2131890822, new Object[0]));
this.B.setTextOff(vh.g(this, 2131890822, new Object[0]));
this.D.setText(vh.g(this, i, new Object[0]));
this.D.setTextOn(vh.g(this, i, new Object[0]));
this.D.setTextOff(vh.g(this, i, new Object[0]));
this.C.setText(vh.g(this, 2131890824, new Object[0]));
this.C.setTextOn(vh.g(this, 2131890824, new Object[0]));
this.C.setTextOff(vh.g(this, 2131890824, new Object[0]));
this.C.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TimeSelect.this.r0(view);
}
});
}
private void y0() {
kp kpVar = new kp();
this.w[0].setCurrentHour(Integer.valueOf(kpVar.e1()));
this.w[0].setCurrentMinute(Integer.valueOf(kpVar.f1()));
this.w[1].setCurrentHour(Integer.valueOf(kpVar.p1()));
this.w[1].setCurrentMinute(Integer.valueOf(kpVar.q1()));
lp.a(this, 0, 2131890959, 1);
x0();
}
private void z0(boolean z) {
this.E.setVisibility(z ? 0 : 4);
this.F.setVisibility(z ? 0 : 4);
}
@Override
public void g(com.joaomgcd.taskerm.util.e5 e5Var, com.joaomgcd.taskerm.util.t6 t6Var) {
}
@Override
public void onBackPressed() {
u0();
}
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
int U;
int U2;
if (this.J) {
if (compoundButton.equals(this.B)) {
if (z) {
if (this.D.isChecked() && this.w[1].getVisibility() == 0) {
n0(1);
U2 = bh.U(this.w[1].getCurrentHour().intValue(), this.w[1].getCurrentMinute().intValue());
} else {
Calendar x = bh.x();
U2 = bh.U(x.get(11), x.get(12));
}
this.w[0].setCurrentHour(Integer.valueOf(U2 / 60));
this.w[0].setCurrentMinute(Integer.valueOf(U2 % 60));
}
A0(0, z, true, true);
} else if (compoundButton.equals(this.D)) {
if (z) {
if (this.B.isChecked() && this.w[0].getVisibility() == 0) {
n0(0);
U = bh.U(this.w[0].getCurrentHour().intValue(), this.w[0].getCurrentMinute().intValue());
} else {
Calendar x2 = bh.x();
U = bh.U(x2.get(11), x2.get(12));
}
this.w[1].setCurrentHour(Integer.valueOf(U / 60));
this.w[1].setCurrentMinute(Integer.valueOf(U % 60));
}
A0(1, z, true, true);
} else {
z0(z);
if (z) {
this.F.requestFocus();
}
}
x0();
}
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
net.dinglisch.android.taskerm.a.T(this, true).setTitle(vh.g(this, 2131886734, new Object[0]));
t0();
this.v[0].setOnClickListener(new a());
this.v[1].setOnClickListener(new b());
if (bundle == null) {
bundle = getIntent().getExtras();
}
this.I = (bundle == null || !bundle.containsKey("dvn")) ? new ArrayList<>() : bundle.getStringArrayList("dvn");
w0((bundle == null || !bundle.containsKey("sTsc")) ? null : new kp(new qi(bundle.getBundle("sTsc"))));
x0();
this.J = true;
}
@Override
public void onDestroy() {
super.onDestroy();
this.x = null;
this.G = null;
this.w = null;
this.y = null;
this.A = null;
this.z = null;
this.B = null;
this.C = null;
this.D = null;
this.E = null;
this.F = null;
this.I = null;
this.H = null;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == 1) {
finish();
} else if (itemId != 16908332) {
switch (itemId) {
case 10:
y0();
break;
case 11:
HTMLView.G0(this, "index.html");
break;
case 12:
HTMLView.H0(this, "timecontext.html", -1, HTMLView.g.Inform);
break;
}
} else {
u0();
}
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.clear();
if (F0()) {
net.dinglisch.android.taskerm.a.J(this, 8, this.x, menu);
}
net.dinglisch.android.taskerm.a.F(this, 10, menu);
net.dinglisch.android.taskerm.a.d(this, 1, menu);
dq.l(this, menu, 12, 11);
return true;
}
@Override
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
v0(bundle);
bundle.putStringArrayList("dvn", this.I);
}
public boolean p0(kp kpVar) {
boolean z;
boolean z2;
boolean z3 = true;
if (this.B.isChecked()) {
n0(0);
if (this.z[0].getVisibility() == 0) {
String m1 = dq.m1(this.y[0]);
if (E0(this.B.getText().toString(), m1)) {
kpVar.A1(m1);
} else {
z = false;
z2 = true;
}
} else {
kpVar.z1(this.w[0].getCurrentHour().intValue(), this.w[0].getCurrentMinute().intValue());
}
z = true;
z2 = true;
} else {
kpVar.X0();
z = true;
z2 = false;
}
if (this.D.isChecked()) {
n0(1);
if (this.z[1].getVisibility() == 0) {
String m12 = dq.m1(this.y[1]);
if (E0(this.D.getText().toString(), m12)) {
kpVar.D1(m12);
} else {
z = false;
}
} else {
kpVar.C1(this.w[1].getCurrentHour().intValue(), this.w[1].getCurrentMinute().intValue());
}
z2 = true;
} else {
kpVar.Y0();
}
if (this.C.isChecked()) {
int i = this.E.getSelectedItemPosition() == 0 ? 1 : 2;
if (this.F.length() == 0) {
z = dq.a0(this, 2131890818, new Object[0]);
} else {
int intValue = new Integer(dq.m1(this.F)).intValue();
if (i == 1) {
if (intValue < 1 || intValue > 12) {
z = dq.a0(this, 2131890816, new Object[0]);
} else {
kpVar.B1(i, intValue);
}
} else if (intValue < 2) {
z = dq.a0(this, 2131890817, new Object[0]);
} else {
kpVar.B1(i, intValue);
}
}
} else {
kpVar.B1(0, 1);
z3 = z2;
}
return !z3 ? dq.a0(this, 2131890819, new Object[0]) : z;
}
public boolean u0() {
if (!p0(this.H)) {
return false;
}
s0();
finish();
return true;
}
public void w0(kp kpVar) {
if (kpVar == null) {
kpVar = new kp();
}
this.B.setChecked(kpVar.s1());
this.D.setChecked(kpVar.u1());
if (kpVar.b1()) {
dq.W2(this.y[0], kpVar.g1());
} else {
q0(0, this.B, kpVar.s1(), kpVar.e1(), kpVar.f1());
}
if (kpVar.E1()) {
dq.W2(this.y[1], kpVar.r1());
} else {
q0(1, this.D, kpVar.u1(), kpVar.p1(), kpVar.q1());
}
if (kpVar.t1()) {
this.C.setChecked(true);
this.F.setFilters(new InputFilter[]{new InputFilter.LengthFilter(kpVar.m1() == 1 ? 2 : 3)});
this.F.setText(Integer.toString(kpVar.n1()));
this.E.setSelection(kpVar.m1() == 1 ? 0 : 1);
} else {
this.C.setChecked(false);
}
z0(kpVar.t1());
x0();
this.H = kpVar;
if (kpVar.D0()) {
getActionBar().setSubtitle(this.H.getName());
}
if (F0()) {
this.H.S0(this, this.x);
}
A0(0, this.H.s1(), !this.H.b1(), false);
A0(1, this.H.u1(), !this.H.E1(), false);
}
}