File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
app/src/main/java/com/addev/listaspam/calllog Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,20 @@ class CallLogAdapter(
4242 private val reportButton: Button = itemView.findViewById(R .id.reportButton)
4343
4444 fun bind (callLog : CallLogEntry , isBlocked : Boolean ) {
45- numberTextView.text = " ${callLog.number}${if (isBlocked) " (blocked)" else " " } "
45+ val number = callLog.number ? : " "
46+ val textToShow = if (isBlocked) " $number (blocked)" else number
47+ numberTextView.text = textToShow
4648 dateTextView.text = formatter.format(callLog.date)
4749 durationTextView.text = " Duration: ${callLog.duration} seconds"
4850
4951 if (isBlocked) {
5052 numberTextView.setTextColor(ContextCompat .getColor(context, android.R .color.holo_red_light))
53+ } else {
54+ numberTextView.setTextColor(ContextCompat .getColor(context, android.R .color.system_palette_key_color_neutral_light)) // O el color por defecto
5155 }
5256
5357 reportButton.setOnClickListener {
54- val url = String .format(SpamUtils .REPORT_URL_TEMPLATE , callLog. number)
58+ val url = String .format(SpamUtils .REPORT_URL_TEMPLATE , number)
5559 val intent = Intent (Intent .ACTION_VIEW , Uri .parse(url))
5660 context.startActivity(intent)
5761 }
You can’t perform that action at this time.
0 commit comments