version:3.1
fix: update:更改主页样式,完善闹钟
This commit is contained in:
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId "com.uiui.aios"
|
applicationId "com.uiui.aios"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 21
|
versionCode 22
|
||||||
versionName "3.0"
|
versionName "3.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
mMainPresenter.setLifecycle(lifecycleSubject);
|
mMainPresenter.setLifecycle(lifecycleSubject);
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
SystemClock.setCurrentTimeMillis(1662123600000L);//09-02
|
// SystemClock.setCurrentTimeMillis(1662123600000L);//09-02
|
||||||
// SystemClock.setCurrentTimeMillis(1662210000000L);//09-03
|
// SystemClock.setCurrentTimeMillis(1662210000000L);//09-03
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.uiui.aios.adapter;
|
package com.uiui.aios.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.media.AudioAttributes;
|
import android.media.AudioAttributes;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -24,25 +26,44 @@ import io.reactivex.rxjava3.core.Observer;
|
|||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
|
||||||
public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapter.Holder> {
|
public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapter.Holder> {
|
||||||
|
private Context mContext;
|
||||||
private List<AlarmClockData> dataList;
|
private List<AlarmClockData> dataList;
|
||||||
|
private OnClickListener mOnClickListener;
|
||||||
|
|
||||||
public void setDataList(List<AlarmClockData> data) {
|
public void setDataList(List<AlarmClockData> data) {
|
||||||
this.dataList = data;
|
this.dataList = data;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnClickListener(OnClickListener listener) {
|
||||||
|
this.mOnClickListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnClickListener {
|
||||||
|
void onClick();
|
||||||
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return new Holder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notification, parent, false));
|
mContext = parent.getContext();
|
||||||
|
return new Holder(LayoutInflater.from(mContext).inflate(R.layout.item_notification, parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||||
AlarmClockData alarmClockData = dataList.get(position);
|
AlarmClockData alarmClockData = dataList.get(position);
|
||||||
holder.tv_title.setText("提醒事件:" + alarmClockData.getTitle());
|
holder.tv_title.setText("提醒事件:" + alarmClockData.getTitle());
|
||||||
holder.tv_time.setText("提醒时间:" + alarmClockData.getTime());
|
holder.tv_time.setText(alarmClockData.getTime());
|
||||||
String voice = alarmClockData.getVoice();
|
String voice = alarmClockData.getVoice();
|
||||||
|
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (mOnClickListener != null) {
|
||||||
|
mOnClickListener.onClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
if (TextUtils.isEmpty(voice)) {
|
if (TextUtils.isEmpty(voice)) {
|
||||||
holder.cl_voice.setVisibility(View.GONE);
|
holder.cl_voice.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
@@ -104,9 +125,11 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
|||||||
TextView tv_time;
|
TextView tv_time;
|
||||||
TextView tv_voice;
|
TextView tv_voice;
|
||||||
ConstraintLayout cl_voice;
|
ConstraintLayout cl_voice;
|
||||||
|
ConstraintLayout root;
|
||||||
|
|
||||||
public Holder(@NonNull View itemView) {
|
public Holder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
root = itemView.findViewById(R.id.root);
|
||||||
tv_title = itemView.findViewById(R.id.tv_title);
|
tv_title = itemView.findViewById(R.id.tv_title);
|
||||||
tv_time = itemView.findViewById(R.id.tv_time);
|
tv_time = itemView.findViewById(R.id.tv_time);
|
||||||
tv_voice = itemView.findViewById(R.id.tv_voice);
|
tv_voice = itemView.findViewById(R.id.tv_voice);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import java.util.Comparator;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
@@ -209,6 +210,19 @@ public class AlarmUtils {
|
|||||||
return id > 0;
|
return id > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteAllAlarmClock() {
|
||||||
|
HashSet<PendingIntent> pendingIntents = getOldPendingIntents();
|
||||||
|
Iterator<PendingIntent> pendingIntentIterator = pendingIntents.iterator();
|
||||||
|
while (pendingIntentIterator.hasNext()) {
|
||||||
|
PendingIntent pendingIntent = pendingIntentIterator.next();
|
||||||
|
alarmManager.cancel(pendingIntent);
|
||||||
|
pendingIntentIterator.remove();
|
||||||
|
}
|
||||||
|
List<AlarmClockData> alarmClockData = getAllAlarms();
|
||||||
|
for (AlarmClockData data : alarmClockData) {
|
||||||
|
deleteAlarmClock(data.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有Alarm
|
* 获取所有Alarm
|
||||||
@@ -258,9 +272,15 @@ public class AlarmUtils {
|
|||||||
if (pendingIntents == null) {
|
if (pendingIntents == null) {
|
||||||
pendingIntents = getOldPendingIntents();
|
pendingIntents = getOldPendingIntents();
|
||||||
}
|
}
|
||||||
for (PendingIntent pendingIntent : pendingIntents) {
|
Iterator<PendingIntent> pendingIntentIterator = pendingIntents.iterator();
|
||||||
|
while (pendingIntentIterator.hasNext()) {
|
||||||
|
PendingIntent pendingIntent = pendingIntentIterator.next();
|
||||||
alarmManager.cancel(pendingIntent);
|
alarmManager.cancel(pendingIntent);
|
||||||
|
pendingIntentIterator.remove();
|
||||||
}
|
}
|
||||||
|
// for (PendingIntent pendingIntent : pendingIntents) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
List<AlarmClockData> newData = mergeData(data);
|
List<AlarmClockData> newData = mergeData(data);
|
||||||
for (AlarmClockData clockData : newData) {
|
for (AlarmClockData clockData : newData) {
|
||||||
setAlarm(clockData);
|
setAlarm(clockData);
|
||||||
@@ -276,8 +296,10 @@ public class AlarmUtils {
|
|||||||
*/
|
*/
|
||||||
private List<AlarmClockData> mergeData(List<AlarmClockData> alarmClockDataList) {
|
private List<AlarmClockData> mergeData(List<AlarmClockData> alarmClockDataList) {
|
||||||
HashMap<Integer, AlarmClockData> alarmClockDataMap = new HashMap<>();
|
HashMap<Integer, AlarmClockData> alarmClockDataMap = new HashMap<>();
|
||||||
for (AlarmClockData alarmClockData : alarmClockDataList) {
|
if (alarmClockDataList != null) {
|
||||||
alarmClockDataMap.put(alarmClockData.getId(), alarmClockData);
|
for (AlarmClockData alarmClockData : alarmClockDataList) {
|
||||||
|
alarmClockDataMap.put(alarmClockData.getId(), alarmClockData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
HashMap<Integer, AlarmClockData> oldData = getOldData();
|
HashMap<Integer, AlarmClockData> oldData = getOldData();
|
||||||
List<AlarmClockData> deleteData = new ArrayList<>();
|
List<AlarmClockData> deleteData = new ArrayList<>();
|
||||||
@@ -291,6 +313,9 @@ public class AlarmUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<AlarmClockData> newData = new ArrayList<>();
|
List<AlarmClockData> newData = new ArrayList<>();
|
||||||
|
if (alarmClockDataList == null) {
|
||||||
|
return newData;
|
||||||
|
}
|
||||||
for (AlarmClockData alarm : alarmClockDataList) {
|
for (AlarmClockData alarm : alarmClockDataList) {
|
||||||
AlarmClockData oldAlarm = oldData.get(alarm.getId());
|
AlarmClockData oldAlarm = oldData.get(alarm.getId());
|
||||||
if (oldAlarm == null) {
|
if (oldAlarm == null) {
|
||||||
@@ -403,12 +428,14 @@ public class AlarmUtils {
|
|||||||
int hour = Integer.parseInt(timeSplit[0]);
|
int hour = Integer.parseInt(timeSplit[0]);
|
||||||
int minute = Integer.parseInt(timeSplit[1]);
|
int minute = Integer.parseInt(timeSplit[1]);
|
||||||
Calendar c = Calendar.getInstance();
|
Calendar c = Calendar.getInstance();
|
||||||
c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH),
|
int year = c.get(Calendar.YEAR);
|
||||||
c.get(Calendar.DAY_OF_MONTH), hour, minute, 0);
|
int month = c.get(Calendar.MONTH);
|
||||||
|
int day = c.get(Calendar.DAY_OF_MONTH);
|
||||||
|
c.set(year, month, day, hour, minute, 0);
|
||||||
long mTimeInfo = c.getTimeInMillis();
|
long mTimeInfo = c.getTimeInMillis();
|
||||||
Log.e(TAG, "getTimestamp: " + mTimeInfo);
|
Log.e(TAG, "getTimestamp: " + mTimeInfo);
|
||||||
long actualTime = mTimeInfo > System.currentTimeMillis() ? mTimeInfo : mTimeInfo + ONE_DAY_TIME;
|
// long actualTime = mTimeInfo > System.currentTimeMillis() ? mTimeInfo : mTimeInfo + ONE_DAY_TIME;
|
||||||
return actualTime;
|
return mTimeInfo;
|
||||||
} else {
|
} else {
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
try {
|
try {
|
||||||
@@ -434,13 +461,13 @@ public class AlarmUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*一次性*/
|
/*一次性*/
|
||||||
private static final int ONCE = 1;
|
public static final int ONCE = 1;
|
||||||
/*每天*/
|
/*每天*/
|
||||||
private static final int LOOP = 2;
|
public static final int LOOP = 2;
|
||||||
/*周一到周五*/
|
/*周一到周五*/
|
||||||
private static final int WORKING_DAY = 3;
|
public static final int WORKING_DAY = 3;
|
||||||
/*休息日*/
|
/*休息日*/
|
||||||
private static final int OFF_DAY = 4;
|
public static final int OFF_DAY = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置闹钟
|
* 设置闹钟
|
||||||
@@ -475,13 +502,13 @@ public class AlarmUtils {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LOOP:
|
case LOOP:
|
||||||
setDayLoopAlarm(MainService.ALARMWAKEUP, title, id, timeStamp);
|
setDayLoopAlarm(MainService.ALARMWAKEUP, title, id, timeString);
|
||||||
break;
|
break;
|
||||||
case WORKING_DAY:
|
case WORKING_DAY:
|
||||||
|
setWorkDayAlarm(MainService.ALARMWAKEUP, title, id, timeString);
|
||||||
break;
|
break;
|
||||||
case OFF_DAY:
|
case OFF_DAY:
|
||||||
|
setOffDayAlarm(MainService.ALARMWAKEUP, title, id, timeString);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
@@ -498,17 +525,28 @@ public class AlarmUtils {
|
|||||||
intent.putExtra("id", requestCode);
|
intent.putExtra("id", requestCode);
|
||||||
PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||||
pendingIntents.add(startPendingIntent);
|
pendingIntents.add(startPendingIntent);
|
||||||
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent);
|
alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent);
|
||||||
Log.e(TAG, "setOnceAlarm: " + "id: " + requestCode + " title: " + extra + " timeString: " + timestamp);
|
Log.e(TAG, "setOnceAlarm: " + "id: " + requestCode + " title: " + extra + " timeString: " + timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param action
|
* @param action
|
||||||
* @param requestCode
|
* @param requestCode
|
||||||
* @param timestamp 设置循环周期为一天的闹钟
|
* @param timeString 设置循环周期为一天的闹钟
|
||||||
*/
|
*/
|
||||||
public void setDayLoopAlarm(String action, String extra, int requestCode, long timestamp) {
|
public void setDayLoopAlarm(String action, String extra, int requestCode, String timeString) {
|
||||||
setLoopAlarm(action, extra, requestCode, AlarmManager.INTERVAL_DAY, timestamp);
|
long timestamp = getTimestamp(timeString);
|
||||||
|
if (System.currentTimeMillis() > timestamp) {
|
||||||
|
timestamp += AlarmManager.INTERVAL_DAY;
|
||||||
|
}
|
||||||
|
Intent intent = new Intent(action);
|
||||||
|
intent.putExtra("title", extra);
|
||||||
|
intent.putExtra("id", requestCode);
|
||||||
|
PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||||
|
pendingIntents.add(startPendingIntent);
|
||||||
|
alarmManager.setExact(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent);
|
||||||
|
Log.e(TAG, "setDayLoopAlarm: " + "title: " + extra + " timeString: " + timestamp);
|
||||||
|
// setLoopAlarm(action, extra, requestCode, AlarmManager.INTERVAL_DAY, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -536,24 +574,49 @@ public class AlarmUtils {
|
|||||||
Log.e(TAG, "setLoopAlarm: " + "title: " + extra + " timeString: " + timestamp);
|
Log.e(TAG, "setLoopAlarm: " + "title: " + extra + " timeString: " + timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWorkDayAlarm(String action, String extra, int requestCode, long intervalMillis, long timestamp) {
|
public void setWorkDayAlarm(String action, String extra, int requestCode, String timeString) {
|
||||||
|
long timestamp = getTimestamp(timeString);
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
int day_of_week = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
||||||
|
switch (day_of_week) {
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
timestamp += (8 - day_of_week) * AlarmManager.INTERVAL_DAY;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
Intent intent = new Intent(action);
|
Intent intent = new Intent(action);
|
||||||
intent.putExtra("title", extra);
|
intent.putExtra("title", extra);
|
||||||
intent.putExtra("id", requestCode);
|
intent.putExtra("id", requestCode);
|
||||||
PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||||
pendingIntents.add(startPendingIntent);
|
pendingIntents.add(startPendingIntent);
|
||||||
alarmManager.setWindow(AlarmManager.RTC_WAKEUP, timestamp, intervalMillis, startPendingIntent);
|
alarmManager.setExact(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent);
|
||||||
Log.e(TAG, "setLoopAlarm: " + "title: " + extra + " timeString: " + timestamp);
|
Log.e(TAG, "setWorkDayAlarm: " + "title: " + extra + " timeString: " + timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOffDayAlarm(String action, String extra, int requestCode, long intervalMillis, long timestamp) {
|
public void setOffDayAlarm(String action, String extra, int requestCode, String timeString) {
|
||||||
|
long timestamp = getTimestamp(timeString);
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
int day_of_week = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
||||||
|
switch (day_of_week) {
|
||||||
|
case 6:
|
||||||
|
if (System.currentTimeMillis() > timestamp) {
|
||||||
|
timestamp += AlarmManager.INTERVAL_DAY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
timestamp += (6 - day_of_week) * AlarmManager.INTERVAL_DAY;
|
||||||
|
break;
|
||||||
|
}
|
||||||
Intent intent = new Intent(action);
|
Intent intent = new Intent(action);
|
||||||
intent.putExtra("title", extra);
|
intent.putExtra("title", extra);
|
||||||
intent.putExtra("id", requestCode);
|
intent.putExtra("id", requestCode);
|
||||||
PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||||
pendingIntents.add(startPendingIntent);
|
pendingIntents.add(startPendingIntent);
|
||||||
alarmManager.setWindow(AlarmManager.RTC_WAKEUP, timestamp, intervalMillis, startPendingIntent);
|
alarmManager.setExact(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent);
|
||||||
Log.e(TAG, "setLoopAlarm: " + "title: " + extra + " timeString: " + timestamp);
|
Log.e(TAG, "setOffDayAlarm: " + "title: " + extra + " timeString: " + timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -311,6 +311,12 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
notificationAdapter = new NotificationAdapter();
|
notificationAdapter = new NotificationAdapter();
|
||||||
|
notificationAdapter.setOnClickListener(new NotificationAdapter.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick() {
|
||||||
|
getAlarm();
|
||||||
|
}
|
||||||
|
});
|
||||||
rv_noti.setOnClickListener(new View.OnClickListener() {
|
rv_noti.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@@ -416,10 +422,21 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
getAlarmClock();
|
getAlarmClock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
// setAlarm();
|
// setAlarm();
|
||||||
|
getAlarmClock();
|
||||||
setSosNumber();
|
setSosNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,6 +523,8 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
@Override
|
@Override
|
||||||
public void setAlarmClockEmpty() {
|
public void setAlarmClockEmpty() {
|
||||||
showNoData("温馨提示", "当前没有数据");
|
showNoData("温馨提示", "当前没有数据");
|
||||||
|
rv_noti.setVisibility(View.GONE);
|
||||||
|
iv_note_nodata.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -516,17 +535,33 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void getAlarmClock() {
|
private void getAlarmClock() {
|
||||||
AlarmClockData alarmClockData = AlarmUtils.getInstance().getRecentAlarmClock();
|
NetInterfaceManager.getInstance().getAlarmClock(new NetInterfaceManager.AlarmClockCallback() {
|
||||||
List<AlarmClockData> data = new ArrayList<>();
|
@Override
|
||||||
if (alarmClockData != null) {
|
public void setAlarmClock(List<AlarmClockData> alarmClockList) {
|
||||||
data.add(alarmClockData);
|
AlarmClockData alarmClockData = AlarmUtils.getInstance().getRecentAlarmClock();
|
||||||
notificationAdapter.setDataList(data);
|
List<AlarmClockData> data = new ArrayList<>();
|
||||||
rv_noti.setVisibility(View.VISIBLE);
|
if (alarmClockData != null) {
|
||||||
iv_note_nodata.setVisibility(View.GONE);
|
data.add(alarmClockData);
|
||||||
} else {
|
notificationAdapter.setDataList(data);
|
||||||
rv_noti.setVisibility(View.GONE);
|
rv_noti.setVisibility(View.VISIBLE);
|
||||||
iv_note_nodata.setVisibility(View.VISIBLE);
|
iv_note_nodata.setVisibility(View.GONE);
|
||||||
}
|
} else {
|
||||||
|
rv_noti.setVisibility(View.GONE);
|
||||||
|
iv_note_nodata.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAlarmClockEmpty() {
|
||||||
|
rv_noti.setVisibility(View.GONE);
|
||||||
|
iv_note_nodata.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNoData(String title, String msg) {
|
private void showNoData(String title, String msg) {
|
||||||
|
|||||||
@@ -646,15 +646,15 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getAlarmClock(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, AlarmClockCallback callback) {
|
public void getAlarmClock(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, AlarmClockCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_MINUTE;
|
// ConnectMode connectMode = ConnectMode.DEFAULT;
|
||||||
if (refresh) {
|
// if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
// connectMode = ConnectMode.DEFAULT;
|
||||||
}
|
// }
|
||||||
if (ConnectManager.getInstance().isNeedConnect(URLAddress.GET_ALARM_CLOCK, connectMode)) {
|
// if (ConnectManager.getInstance().isNeedConnect(URLAddress.GET_ALARM_CLOCK, connectMode)) {
|
||||||
getAlarmClock(lifecycle, callback);
|
getAlarmClock(lifecycle, callback);
|
||||||
} else {
|
// } else {
|
||||||
getAlarmClockCache(lifecycle, callback);
|
// getAlarmClockCache(lifecycle, callback);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getAlarmClockCache(BehaviorSubject<ActivityEvent> lifecycle, AlarmClockCallback callback) {
|
public void getAlarmClockCache(BehaviorSubject<ActivityEvent> lifecycle, AlarmClockCallback callback) {
|
||||||
|
|||||||
@@ -57,34 +57,23 @@ public class MainSPresenter implements MainSContact.Presenter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getAlarmClock() {
|
public void getAlarmClock() {
|
||||||
NetInterfaceManager.getInstance().getAlarmClockObservable()
|
NetInterfaceManager.getInstance().getAlarmClock(true, getLifecycle(), new NetInterfaceManager.AlarmClockCallback() {
|
||||||
.subscribe(new Observer<BaseResponse<List<AlarmClockData>>>() {
|
@Override
|
||||||
@Override
|
public void setAlarmClock(List<AlarmClockData> alarmClockList) {
|
||||||
public void onSubscribe(Disposable d) {
|
AlarmUtils.getInstance().setAlarmClockData(alarmClockList);
|
||||||
Log.e("getAlarmClock", "onSubscribe: ");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(BaseResponse<List<AlarmClockData>> listBaseResponse) {
|
public void setAlarmClockEmpty() {
|
||||||
Log.e("getAlarmClock", "onNext: "+listBaseResponse);
|
AlarmUtils.getInstance().deleteAllAlarmClock();
|
||||||
if (listBaseResponse.code == 200) {
|
AlarmUtils.getInstance().setAlarmClockData(null);
|
||||||
List<AlarmClockData> data = listBaseResponse.data;
|
}
|
||||||
AlarmUtils.getInstance().setAlarmClockData(data);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
@Override
|
||||||
}
|
public void onError() {
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void onError(Throwable e) {
|
});
|
||||||
Log.e("getAlarmClock", "onError: " + e.getMessage());
|
|
||||||
onComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
Log.e("getAlarmClock", "onComplete: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.arialyy.aria.core.task.DownloadTask;
|
|||||||
import com.blankj.utilcode.util.NetworkUtils;
|
import com.blankj.utilcode.util.NetworkUtils;
|
||||||
import com.uiui.aios.BuildConfig;
|
import com.uiui.aios.BuildConfig;
|
||||||
import com.uiui.aios.activity.NoticeActivity;
|
import com.uiui.aios.activity.NoticeActivity;
|
||||||
|
import com.uiui.aios.alarm.AlarmUtils;
|
||||||
import com.uiui.aios.base.BaseService;
|
import com.uiui.aios.base.BaseService;
|
||||||
import com.uiui.aios.bean.AlarmClockData;
|
import com.uiui.aios.bean.AlarmClockData;
|
||||||
import com.uiui.aios.bean.BaseResponse;
|
import com.uiui.aios.bean.BaseResponse;
|
||||||
@@ -30,6 +31,8 @@ import com.uiui.aios.utils.Utils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
@@ -131,12 +134,14 @@ public class MainService extends BaseService implements MainSContact.MainSView,
|
|||||||
private class AlarmReceiver extends BroadcastReceiver {
|
private class AlarmReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
Log.e(TAG, "onReceive: " + System.currentTimeMillis());
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
if (TextUtils.isEmpty(action)) return;
|
if (TextUtils.isEmpty(action)) return;
|
||||||
Log.e(TAG, "onReceive: " + action);
|
Log.e(TAG, "onReceive: " + action);
|
||||||
String title = intent.getStringExtra("title");
|
String title = intent.getStringExtra("title");
|
||||||
int code = intent.getIntExtra("id", -1);
|
int code = intent.getIntExtra("id", -1);
|
||||||
Log.e(TAG, "onReceive: title = " + title);
|
Log.e(TAG, "onReceive: title = " + title);
|
||||||
|
setNextAlarm(code);
|
||||||
if (ALARMWAKEUP.equals(action)) {
|
if (ALARMWAKEUP.equals(action)) {
|
||||||
Intent noticeIntent = new Intent();
|
Intent noticeIntent = new Intent();
|
||||||
noticeIntent.putExtra("id", code);
|
noticeIntent.putExtra("id", code);
|
||||||
@@ -147,6 +152,32 @@ public class MainService extends BaseService implements MainSContact.MainSView,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setNextAlarm(int code) {
|
||||||
|
HashMap<Integer, AlarmClockData> clockDataHashMap = AlarmUtils.getInstance().getOldData();
|
||||||
|
AlarmClockData alarmClockData = clockDataHashMap.get(code);
|
||||||
|
Log.e(TAG, "setNextAlarm: " + alarmClockData);
|
||||||
|
if (alarmClockData != null) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
int day_of_week = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
||||||
|
Log.e(TAG, "setNextAlarm: " + day_of_week);
|
||||||
|
switch (alarmClockData.getType()) {
|
||||||
|
case AlarmUtils.ONCE:
|
||||||
|
break;
|
||||||
|
case AlarmUtils.LOOP:
|
||||||
|
AlarmUtils.getInstance().setDayLoopAlarm(MainService.ALARMWAKEUP, alarmClockData.getTitle(), alarmClockData.getId(), alarmClockData.getTime());
|
||||||
|
break;
|
||||||
|
case AlarmUtils.WORKING_DAY:
|
||||||
|
if (day_of_week < 5 || day_of_week == 7) {
|
||||||
|
AlarmUtils.getInstance().setDayLoopAlarm(MainService.ALARMWAKEUP, alarmClockData.getTitle(), alarmClockData.getId(), alarmClockData.getTime());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case AlarmUtils.OFF_DAY:
|
||||||
|
AlarmUtils.getInstance().setOffDayAlarm(MainService.ALARMWAKEUP, alarmClockData.getTitle(), alarmClockData.getId(), alarmClockData.getTime());
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//监听时间和日期变化
|
//监听时间和日期变化
|
||||||
public void registerTimeReceiver() {
|
public void registerTimeReceiver() {
|
||||||
mTimeChangedReceiver = new TimeChangedReceiver();
|
mTimeChangedReceiver = new TimeChangedReceiver();
|
||||||
@@ -173,7 +204,7 @@ public class MainService extends BaseService implements MainSContact.MainSView,
|
|||||||
Log.e(TAG, "TimeChangedReceiver:" + "timezone changed");
|
Log.e(TAG, "TimeChangedReceiver:" + "timezone changed");
|
||||||
} else if (Intent.ACTION_TIME_TICK.equals(intent.getAction())) {
|
} else if (Intent.ACTION_TIME_TICK.equals(intent.getAction())) {
|
||||||
Log.e(TAG, "TimeChangedReceiver:" + "time tick");
|
Log.e(TAG, "TimeChangedReceiver:" + "time tick");
|
||||||
isScreenshot();
|
// isScreenshot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,7 +220,7 @@ public class MainService extends BaseService implements MainSContact.MainSView,
|
|||||||
String topPackageName = ForegroundAppUtil.getForegroundPackageName(MainService.this);
|
String topPackageName = ForegroundAppUtil.getForegroundPackageName(MainService.this);
|
||||||
Log.e(TAG, "isScreenshot: " + topPackageName);
|
Log.e(TAG, "isScreenshot: " + topPackageName);
|
||||||
String pkg = AppUsedTimeUtils.getInstance().getAppPackageName();
|
String pkg = AppUsedTimeUtils.getInstance().getAppPackageName();
|
||||||
if (TextUtils.isEmpty(pkg)|| BuildConfig.APPLICATION_ID.equals(pkg)) {
|
if (TextUtils.isEmpty(pkg) || BuildConfig.APPLICATION_ID.equals(pkg)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 4.8 KiB |
@@ -79,7 +79,7 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_note"
|
android:id="@+id/cl_health"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
@@ -87,15 +87,16 @@
|
|||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:layout_weight="3"
|
android:layout_weight="3"
|
||||||
android:background="@drawable/custom_background">
|
android:background="@drawable/custom_background"
|
||||||
|
tools:ignore="NestedWeights">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView4"
|
android:id="@+id/textView5"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="爱心守护"
|
android:text="健康码"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
@@ -103,25 +104,16 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_note_nodata"
|
android:layout_width="100dp"
|
||||||
android:layout_width="150dp"
|
android:layout_height="100dp"
|
||||||
android:layout_height="150dp"
|
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/note_nodata"
|
android:src="@drawable/home_clinical_detection"
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/rv_noti"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
@@ -225,26 +217,25 @@
|
|||||||
<!-- app:layout_constraintTop_toBottomOf="@+id/textView5" />-->
|
<!-- app:layout_constraintTop_toBottomOf="@+id/textView5" />-->
|
||||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_health"
|
android:id="@+id/cl_note"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/custom_background"
|
android:background="@drawable/custom_background">
|
||||||
tools:ignore="NestedWeights">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView5"
|
android:id="@+id/textView4"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="健康档案"
|
android:text="爱心守护"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
@@ -252,18 +243,28 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="100dp"
|
android:id="@+id/iv_note_nodata"
|
||||||
android:layout_height="100dp"
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="150dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/home_clinical_detection"
|
android:src="@drawable/note_nodata"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_noti"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_tongue"
|
android:id="@+id/cl_tongue"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -244,7 +244,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="健康档案"
|
android:text="健康码"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
android:minWidth="30dp"
|
android:minWidth="30dp"
|
||||||
android:text="1"
|
android:text="1"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_12"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/iv"
|
app:layout_constraintBottom_toBottomOf="@+id/iv"
|
||||||
app:layout_constraintStart_toStartOf="@+id/iv" />
|
app:layout_constraintStart_toStartOf="@+id/iv" />
|
||||||
@@ -48,8 +48,9 @@
|
|||||||
android:id="@+id/tv"
|
android:id="@+id/tv"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_15"
|
android:textSize="@dimen/sp_12"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/iv"
|
app:layout_constraintEnd_toEndOf="@+id/iv"
|
||||||
app:layout_constraintStart_toStartOf="@+id/iv"
|
app:layout_constraintStart_toStartOf="@+id/iv"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/iv" />
|
app:layout_constraintTop_toBottomOf="@+id/iv" />
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:background="@drawable/alarm_notifi_background"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:text="提醒事件"
|
android:text="提醒事件"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -29,11 +30,17 @@
|
|||||||
android:id="@+id/tv_time"
|
android:id="@+id/tv_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:background="@drawable/tv_background"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:singleLine="true"
|
||||||
android:text="提醒时间"
|
android:text="提醒时间"
|
||||||
android:textColor="@color/black"
|
android:layout_margin="@dimen/dp_4"
|
||||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
android:textColor="@color/white"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
android:textSize="@dimen/sp_14"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_voice"
|
android:id="@+id/cl_voice"
|
||||||
@@ -41,6 +48,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:background="@drawable/voice_background"
|
android:background="@drawable/voice_background"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_time">
|
app:layout_constraintTop_toBottomOf="@+id/tv_time">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user