Skip to content

Commit e25ef2b

Browse files
committed
调整闹钟提醒、睡眠时间以及其他功能调整
1 parent 46c311f commit e25ef2b

File tree

3 files changed

+212
-96
lines changed

3 files changed

+212
-96
lines changed

app/src/main/java/com/renyu/androidblelibrary/activity/Main2Activity.java

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ protected void onCreate(Bundle savedInstanceState) {
5858
models.add("读取心率");
5959
models.add("睡眠时间");
6060
models.add("设置用户信息");
61+
models.add("设置久坐提醒模式");
6162
models.add("读取久坐提醒配置信息");
6263
models.add("读取闹钟信息");
6364
models.add("事件提醒添加");

app/src/main/java/com/renyu/androidblelibrary/adapter/Main2Adapter.java

+13-11
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,33 @@ public void onClick(View view) {
6161
} else if (holder.getLayoutPosition() == 9) {
6262
BLEService2.writeUserInfo(holder.itemView.getContext(), 1, 180, 85, 10000);
6363
} else if (holder.getLayoutPosition() == 10) {
64-
BLEService2.sedentaryReminder(holder.itemView.getContext());
64+
BLEService2.settingSedentaryReminder(holder.itemView.getContext(), 1);
6565
} else if (holder.getLayoutPosition() == 11) {
66-
BLEService2.allAlarmInfo(holder.itemView.getContext());
66+
BLEService2.sedentaryReminder(holder.itemView.getContext());
6767
} else if (holder.getLayoutPosition() == 12) {
68-
BLEService2.eventDelete(holder.itemView.getContext(), 9);
68+
BLEService2.allAlarmInfo(holder.itemView.getContext());
69+
} else if (holder.getLayoutPosition() == 13) {
70+
BLEService2.eventDelete(holder.itemView.getContext(), 10);
6971
// BLEService2.eventAdd(holder.itemView.getContext(), 3, System.currentTimeMillis(), 0x81, "Hello你好你叫什么名字你住哪里你今年多大");
7072
// BLEService2.eventAdd(holder.itemView.getContext(), 4, System.currentTimeMillis(), 0x82, "Hello你好你叫什么名字你住哪里你今年多大");
7173
// BLEService2.eventAdd(holder.itemView.getContext(), 5, System.currentTimeMillis(), 0x01, "Hello你好你叫什么名字你住哪里你今年多大");
7274
// BLEService2.eventAdd(holder.itemView.getContext(), 6, System.currentTimeMillis(), 0x02, "Hello你好你叫什么名字你住哪里你今年多大");
7375
// BLEService2.eventAdd(holder.itemView.getContext(), 7, System.currentTimeMillis(), 0x81 | 0x82 | 0x84 | 0x88 | 0x90 | 0xA0 | 0xC0, "Hello你好你叫什么名字你住哪里你今年多大");
7476
// BLEService2.eventAdd(holder.itemView.getContext(), 8, System.currentTimeMillis(), 0xA0 | 0xC0, "Hello你好你叫什么名字你住哪里你今年多大");
75-
BLEService2.eventAdd(holder.itemView.getContext(), 9, System.currentTimeMillis(), 0x81 | 0x82, "Hello你好你叫什么名字你住哪里你今年多大");
76-
} else if (holder.getLayoutPosition() == 13) {
77-
BLEService2.alarmClockAdd(holder.itemView.getContext(), 76, System.currentTimeMillis(), 0x00, 0);
77+
BLEService2.eventAdd(holder.itemView.getContext(), 10, true, System.currentTimeMillis(), 0x81 | 0x84, "Hello你好你叫什么名字你住哪里你今年多大");
7878
} else if (holder.getLayoutPosition() == 14) {
79-
BLEService2.sedentaryByAlarmAdd(holder.itemView.getContext(), 51, System.currentTimeMillis(), 0x00);
79+
BLEService2.alarmClockAdd(holder.itemView.getContext(), 76, true, System.currentTimeMillis(), 0x00, true);
8080
} else if (holder.getLayoutPosition() == 15) {
81-
BLEService2.noDisturb(holder.itemView.getContext(), 1, 0, 22, 0, 6);
81+
BLEService2.sedentaryByAlarmAdd(holder.itemView.getContext(), 51, true, System.currentTimeMillis(), 0x00);
8282
} else if (holder.getLayoutPosition() == 16) {
83-
BLEService2.readAlarm(holder.itemView.getContext(), 9);
83+
BLEService2.noDisturb(holder.itemView.getContext(), 1, 0, 22, 0, 6);
8484
} else if (holder.getLayoutPosition() == 17) {
85-
BLEService2.sportsRun(holder.itemView.getContext());
85+
BLEService2.readAlarm(holder.itemView.getContext(), 9);
8686
} else if (holder.getLayoutPosition() == 18) {
87-
BLEService2.sportsFastWalk(holder.itemView.getContext());
87+
BLEService2.sportsRun(holder.itemView.getContext());
8888
} else if (holder.getLayoutPosition() == 19) {
89+
BLEService2.sportsFastWalk(holder.itemView.getContext());
90+
} else if (holder.getLayoutPosition() == 20) {
8991
BLEService2.sportsSwim(holder.itemView.getContext());
9092
}
9193
}

0 commit comments

Comments
 (0)