version:3.5
fix: update:优化退出,增加闹钟
This commit is contained in:
@@ -1,164 +0,0 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.uiuios.aios.alarm.AlarmUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class AlarmClockData implements Serializable {
|
||||
private static final long serialVersionUID = -5856502480745183157L;
|
||||
|
||||
int id;
|
||||
int type;//类型 1一次 2循环 3周一到周五 4 周六周日
|
||||
String time;//"2021-11-15 18:33:23",//时间格式化字符串,循环类型是18:33:23
|
||||
String title;//标题
|
||||
String voice;//语音文件地址
|
||||
String voice_md5;
|
||||
String file;//图片或视频文件地址
|
||||
int remind_type;
|
||||
int is_onoff;//0关闭 1开启
|
||||
|
||||
boolean finished = false;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getVoice() {
|
||||
return voice;
|
||||
}
|
||||
|
||||
public void setVoice(String voice) {
|
||||
this.voice = voice;
|
||||
}
|
||||
|
||||
public String getVoice_md5() {
|
||||
return voice_md5;
|
||||
}
|
||||
|
||||
public void setVoice_md5(String voice_md5) {
|
||||
this.voice_md5 = voice_md5;
|
||||
}
|
||||
|
||||
public String getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(String file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public boolean isFinished() {
|
||||
return finished;
|
||||
}
|
||||
|
||||
public void setFinished(boolean finished) {
|
||||
this.finished = finished;
|
||||
}
|
||||
|
||||
public int getRemind_type() {
|
||||
return remind_type;
|
||||
}
|
||||
|
||||
public void setRemind_type(int remind_type) {
|
||||
this.remind_type = remind_type;
|
||||
}
|
||||
|
||||
public int getIs_onoff() {
|
||||
return is_onoff;
|
||||
}
|
||||
|
||||
public void setIs_onoff(int is_onoff) {
|
||||
this.is_onoff = is_onoff;
|
||||
}
|
||||
|
||||
public long getTimeStamp() {
|
||||
if (TextUtils.isEmpty(time)) {
|
||||
return 0L;
|
||||
}
|
||||
if (time.length() == 5) {
|
||||
String[] timeSplit = time.split(":");
|
||||
int hour = Integer.parseInt(timeSplit[0]);
|
||||
int minute = Integer.parseInt(timeSplit[1]);
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH),
|
||||
c.get(Calendar.DAY_OF_MONTH), hour, minute, 0);
|
||||
long mTimeInfo = c.getTimeInMillis();
|
||||
Log.e("AlarmClockData", "getTimeStamp: " + mTimeInfo);
|
||||
long actualTime = mTimeInfo > System.currentTimeMillis() ? mTimeInfo : mTimeInfo + AlarmUtils.ONE_DAY_TIME;
|
||||
return actualTime;
|
||||
} else {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
Date date = simpleDateFormat.parse(time);
|
||||
long timestamp = date.getTime();
|
||||
return timestamp;
|
||||
} catch (ParseException e) {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (obj == null) return false;
|
||||
if (!(obj instanceof AlarmClockData)) return false;
|
||||
if (id != ((AlarmClockData) obj).id) return false;
|
||||
if (type != ((AlarmClockData) obj).type) return false;
|
||||
if (!time.equals(((AlarmClockData) obj).time)) return false;
|
||||
if (!title.equals(((AlarmClockData) obj).title)) return false;
|
||||
if (!voice.equals(((AlarmClockData) obj).voice)) return false;
|
||||
if (!voice_md5.equals(((AlarmClockData) obj).voice_md5)) return false;
|
||||
if (!file.equals(((AlarmClockData) obj).file)) return false;
|
||||
if (remind_type != ((AlarmClockData) obj).remind_type) return false;
|
||||
if (is_onoff != ((AlarmClockData) obj).is_onoff) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
16
app/src/main/java/com/uiuios/aios/bean/AlarmClockId.java
Normal file
16
app/src/main/java/com/uiuios/aios/bean/AlarmClockId.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AlarmClockId implements Serializable {
|
||||
private static final long serialVersionUID = 4423679466957746841L;
|
||||
int id;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
62
app/src/main/java/com/uiuios/aios/bean/WiFiInfo.java
Normal file
62
app/src/main/java/com/uiuios/aios/bean/WiFiInfo.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.uiuios.aios.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class WiFiInfo implements Serializable {
|
||||
private static final long serialVersionUID = 2429102475725706816L;
|
||||
|
||||
String SSID;
|
||||
String BSSID;
|
||||
int level;
|
||||
boolean connected;
|
||||
boolean isSaved;
|
||||
boolean isAvailable;
|
||||
|
||||
public String getSSID() {
|
||||
return SSID;
|
||||
}
|
||||
|
||||
public void setSSID(String SSID) {
|
||||
this.SSID = SSID;
|
||||
}
|
||||
|
||||
public String getBSSID() {
|
||||
return BSSID;
|
||||
}
|
||||
|
||||
public void setBSSID(String BSSID) {
|
||||
this.BSSID = BSSID;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return connected;
|
||||
}
|
||||
|
||||
public void setConnected(boolean connected) {
|
||||
this.connected = connected;
|
||||
}
|
||||
|
||||
public boolean isSaved() {
|
||||
return isSaved;
|
||||
}
|
||||
|
||||
public void setSaved(boolean saved) {
|
||||
isSaved = saved;
|
||||
}
|
||||
|
||||
public boolean isAvailable() {
|
||||
return isAvailable;
|
||||
}
|
||||
|
||||
public void setAvailable(boolean available) {
|
||||
isAvailable = available;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user