Skip to content

Commit

Permalink
add: zTC1 zDC1 zA1 zMOPS 定时任务设置页面增加快捷设置按钮
Browse files Browse the repository at this point in the history
版本v1.7.2
  • Loading branch information
a2633063 committed Oct 19, 2020
1 parent b7b7f74 commit 44beb85
Show file tree
Hide file tree
Showing 16 changed files with 1,203 additions and 667 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.zyc.zcontrol"
minSdkVersion 21
targetSdkVersion 28
versionCode 47
versionName "v1.7.1"
versionCode 48
versionName "v1.7.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 47,
"versionName": "v1.7.1",
"versionCode": 48,
"versionName": "v1.7.2",
"outputFile": "app-release.apk"
}
]
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
android:label="排序" />
<activity
android:name=".deviceItem.a1.A1PlugActivity"
android:label="插口" />
android:label="定时" />
<activity
android:name=".deviceItem.m1.M1PlugActivity"
android:label="定时" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,37 @@ public String format(int value) {
action_picker.setValue(task.action/10);
//endregion
//endregion
//region 快捷按钮
final Button btn_time_now = popupView.findViewById(R.id.btn_time_now);
final Button btn_repeat_everyday = popupView.findViewById(R.id.btn_repeat_everyday);
btn_time_now.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Calendar calendar = Calendar.getInstance();
hour_picker.setValue(calendar.get(Calendar.HOUR_OF_DAY));
minute_picker.setValue(calendar.get(Calendar.MINUTE));
}
});

btn_repeat_everyday.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

if(tbtn_week[0].isChecked()&&tbtn_week[1].isChecked()&&
tbtn_week[2].isChecked()&&tbtn_week[3].isChecked()&&
tbtn_week[4].isChecked()&&tbtn_week[5].isChecked()&&
tbtn_week[6].isChecked()){
for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(false);
}else{

for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(true);
}

}
});
//endregion

//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -301,6 +332,40 @@ public String format(int value) {
action_picker.setValue(0);
//endregion
//endregion
//region 快捷时间按钮初始化
final Button btn_1_hour = popupView.findViewById(R.id.btn_time_now);
final Button btn_2_hour = popupView.findViewById(R.id.btn_repeat_everyday);
final Button btn_4_hour = popupView.findViewById(R.id.btn_4_hour);
final Button btn_8_hour = popupView.findViewById(R.id.btn_8_hour);
btn_1_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(1);
minute_picker.setValue(0);
}
});
btn_2_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(2);
minute_picker.setValue(0);
}
});
btn_4_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(4);
minute_picker.setValue(0);
}
});
btn_8_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(8);
minute_picker.setValue(0);
}
});
//endregion

//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,37 @@ public String format(int value) {
action_picker.setValue(task.action);
//endregion
//endregion
//region 快捷按钮
final Button btn_time_now = popupView.findViewById(R.id.btn_time_now);
final Button btn_repeat_everyday = popupView.findViewById(R.id.btn_repeat_everyday);
btn_time_now.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Calendar calendar = Calendar.getInstance();
hour_picker.setValue(calendar.get(Calendar.HOUR_OF_DAY));
minute_picker.setValue(calendar.get(Calendar.MINUTE));
}
});

btn_repeat_everyday.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

if(tbtn_week[0].isChecked()&&tbtn_week[1].isChecked()&&
tbtn_week[2].isChecked()&&tbtn_week[3].isChecked()&&
tbtn_week[4].isChecked()&&tbtn_week[5].isChecked()&&
tbtn_week[6].isChecked()){
for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(false);
}else{

for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(true);
}

}
});
//endregion
//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down Expand Up @@ -365,6 +395,40 @@ public String format(int value) {
action_picker.setValue(1);
//endregion
//endregion
//region 快捷时间按钮初始化
final Button btn_1_hour = popupView.findViewById(R.id.btn_time_now);
final Button btn_2_hour = popupView.findViewById(R.id.btn_repeat_everyday);
final Button btn_4_hour = popupView.findViewById(R.id.btn_4_hour);
final Button btn_8_hour = popupView.findViewById(R.id.btn_8_hour);
btn_1_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(1);
minute_picker.setValue(0);
}
});
btn_2_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(2);
minute_picker.setValue(0);
}
});
btn_4_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(4);
minute_picker.setValue(0);
}
});
btn_8_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(8);
minute_picker.setValue(0);
}
});
//endregion

//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,37 @@ public String format(int value) {
action_picker.setValue(task.action);
//endregion
//endregion
//region 快捷按钮
final Button btn_time_now = popupView.findViewById(R.id.btn_time_now);
final Button btn_repeat_everyday = popupView.findViewById(R.id.btn_repeat_everyday);
btn_time_now.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Calendar calendar = Calendar.getInstance();
hour_picker.setValue(calendar.get(Calendar.HOUR_OF_DAY));
minute_picker.setValue(calendar.get(Calendar.MINUTE));
}
});

btn_repeat_everyday.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

if(tbtn_week[0].isChecked()&&tbtn_week[1].isChecked()&&
tbtn_week[2].isChecked()&&tbtn_week[3].isChecked()&&
tbtn_week[4].isChecked()&&tbtn_week[5].isChecked()&&
tbtn_week[6].isChecked()){
for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(false);
}else{

for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(true);
}

}
});
//endregion

//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -349,6 +380,40 @@ public String format(int value) {
action_picker.setValue(1);
//endregion
//endregion
//region 快捷时间按钮初始化
final Button btn_1_hour = popupView.findViewById(R.id.btn_time_now);
final Button btn_2_hour = popupView.findViewById(R.id.btn_repeat_everyday);
final Button btn_4_hour = popupView.findViewById(R.id.btn_4_hour);
final Button btn_8_hour = popupView.findViewById(R.id.btn_8_hour);
btn_1_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(1);
minute_picker.setValue(0);
}
});
btn_2_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(2);
minute_picker.setValue(0);
}
});
btn_4_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(4);
minute_picker.setValue(0);
}
});
btn_8_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(8);
minute_picker.setValue(0);
}
});
//endregion

//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;

Expand Down Expand Up @@ -295,6 +296,39 @@ public String format(int value) {
//endregion
//endregion

//region 快捷按钮
final Button btn_time_now = popupView.findViewById(R.id.btn_time_now);
final Button btn_repeat_everyday = popupView.findViewById(R.id.btn_repeat_everyday);
btn_time_now.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Calendar calendar = Calendar.getInstance();
hour_picker.setValue(calendar.get(Calendar.HOUR_OF_DAY));
minute_picker.setValue(calendar.get(Calendar.MINUTE));
}
});

btn_repeat_everyday.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

if(tbtn_week[0].isChecked()&&tbtn_week[1].isChecked()&&
tbtn_week[2].isChecked()&&tbtn_week[3].isChecked()&&
tbtn_week[4].isChecked()&&tbtn_week[5].isChecked()&&
tbtn_week[6].isChecked()){
for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(false);
}else{

for (int i = 0; i < tbtn_week.length; i++)
tbtn_week[i].setChecked(true);
}

}
});
//endregion


//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down Expand Up @@ -371,6 +405,42 @@ public String format(int value) {
//endregion
//endregion

//region 快捷时间按钮初始化
final Button btn_1_hour = popupView.findViewById(R.id.btn_time_now);
final Button btn_2_hour = popupView.findViewById(R.id.btn_repeat_everyday);
final Button btn_4_hour = popupView.findViewById(R.id.btn_4_hour);
final Button btn_8_hour = popupView.findViewById(R.id.btn_8_hour);
btn_1_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(1);
minute_picker.setValue(0);
}
});
btn_2_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(2);
minute_picker.setValue(0);
}
});
btn_4_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(4);
minute_picker.setValue(0);
}
});
btn_8_hour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hour_picker.setValue(8);
minute_picker.setValue(0);
}
});
//endregion


//region 确认按钮初始化
btn_ok.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Loading

0 comments on commit 44beb85

Please sign in to comment.