version:1.1.5
update: bugfixes:优化闹钟自动接听
This commit is contained in:
@@ -32,7 +32,7 @@ public class CallRecordAdapter extends RecyclerView.Adapter<CallRecordAdapter.Ho
|
||||
|
||||
private Context mContext;
|
||||
private List<RecordsInfo> mRecordsInfoList;
|
||||
private SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat("MM/dd HH:mm:ss");
|
||||
private SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat("HH:mm");
|
||||
|
||||
public void setRecordsInfoList(List<RecordsInfo> recordsInfoList) {
|
||||
this.mRecordsInfoList = recordsInfoList;
|
||||
@@ -63,13 +63,22 @@ public class CallRecordAdapter extends RecyclerView.Adapter<CallRecordAdapter.Ho
|
||||
switch (recordsInfo.getType()) {
|
||||
default:
|
||||
case CallLog.Calls.INCOMING_TYPE:
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_incoming));
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_call_incoming));
|
||||
holder.tv_name.setTextColor(mContext.getColor(R.color.black));
|
||||
holder.tv_phone.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
holder.tv_time.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
break;
|
||||
case CallLog.Calls.OUTGOING_TYPE:
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_outgoing));
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_call_outgoing));
|
||||
holder.tv_name.setTextColor(mContext.getColor(R.color.black));
|
||||
holder.tv_phone.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
holder.tv_time.setTextColor(mContext.getColor(R.color.noti_font_color));
|
||||
break;
|
||||
case CallLog.Calls.MISSED_TYPE:
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_missed));
|
||||
holder.tv_state.setImageDrawable(mContext.getDrawable(R.drawable.icon_call_missed));
|
||||
holder.tv_name.setTextColor(mContext.getColor(R.color.red));
|
||||
holder.tv_phone.setTextColor(mContext.getColor(R.color.red));
|
||||
holder.tv_time.setTextColor(mContext.getColor(R.color.red));
|
||||
break;
|
||||
}
|
||||
holder.tv_time.setText(mSimpleDateFormat.format(new Date(recordsInfo.getDate())));
|
||||
|
||||
@@ -97,6 +97,15 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
return false;
|
||||
}
|
||||
});
|
||||
contactHolder.iv_clear.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnLongClick != null) {
|
||||
mOnLongClick.setOnLongClickListener(contact);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
contactHolder.tv_name.setText(contact.getName());
|
||||
if (DIALER_PACKAGE.equals(contact.getMobile())) {
|
||||
contactHolder.cl_contact.setVisibility(View.GONE);
|
||||
@@ -139,7 +148,7 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
NiceImageView iv_head2;
|
||||
TextView tv_name;
|
||||
TextView tv_phone;
|
||||
ImageView iv_sim;
|
||||
ImageView iv_sim, iv_clear;
|
||||
|
||||
public ContactHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@@ -150,6 +159,7 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_phone = itemView.findViewById(R.id.tv_phone);
|
||||
iv_sim = itemView.findViewById(R.id.iv_sim);
|
||||
iv_clear = itemView.findViewById(R.id.iv_clear);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.xxpatx.os.bean.DailyAppBean;
|
||||
import com.xxpatx.os.dialog.DailyAppDialog;
|
||||
import com.xxpatx.os.manager.AppStatusManager;
|
||||
import com.xxpatx.os.network.NetInterfaceManager;
|
||||
import com.xxpatx.os.service.NotificationService;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
import com.xxpatx.os.utils.AppUsedTimeUtils;
|
||||
|
||||
@@ -66,6 +67,16 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
||||
// SendRunningApp(mContext);
|
||||
}
|
||||
});
|
||||
int size = NotificationService.getNotificationLength(dailyAppBean.getPackageName());
|
||||
if (size == 0) {
|
||||
holder.bg.setVisibility(View.GONE);
|
||||
} else if (size < 99) {
|
||||
holder.bg.setVisibility(View.VISIBLE);
|
||||
holder.bg.setText(String.valueOf(size));
|
||||
} else {
|
||||
holder.bg.setVisibility(View.VISIBLE);
|
||||
holder.bg.setText("99+");
|
||||
}
|
||||
}
|
||||
|
||||
private void SendRunningApp(Context context) {
|
||||
@@ -135,12 +146,14 @@ public class DailyAppAdapter extends RecyclerView.Adapter<DailyAppAdapter.Holder
|
||||
ConstraintLayout root;
|
||||
ImageView iv_icon;
|
||||
TextView tv_name;
|
||||
TextView bg;
|
||||
|
||||
Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.root);
|
||||
iv_icon = itemView.findViewById(R.id.iv_icon);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
bg = itemView.findViewById(R.id.bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,14 +91,9 @@ public class WechatContactAdapter extends RecyclerView.Adapter<WechatContactAdap
|
||||
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||
mContext.startActivity(intent);
|
||||
} else {
|
||||
if (AccessibilityUtils.isAccessibilitySettingsOn(mContext)) {
|
||||
Intent intent = new Intent(mContext, CallWechatActivity.class);
|
||||
intent.putExtra("WechatInfo", contact);
|
||||
mContext.startActivity(intent);
|
||||
} else {
|
||||
Toast.makeText(mContext, "请在无障碍服务中打开 - 关爱守护快捷服务", Toast.LENGTH_LONG).show();
|
||||
mContext.startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));
|
||||
}
|
||||
Intent intent = new Intent(mContext, CallWechatActivity.class);
|
||||
intent.putExtra("WechatInfo", contact);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user