mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
Added Serializable to RecentCall.kt and improved documentation string
This commit is contained in:
@ -2,8 +2,12 @@ package com.simplemobiletools.dialer.models
|
||||
|
||||
import android.telephony.PhoneNumberUtils
|
||||
import com.simplemobiletools.commons.extensions.normalizePhoneNumber
|
||||
import java.io.Serializable
|
||||
|
||||
// model used at displaying recent calls, for contacts with multiple numbers specifify the number and type
|
||||
/**
|
||||
* Used at displaying recent calls.
|
||||
* For contacts with multiple numbers specify the number and type
|
||||
*/
|
||||
data class RecentCall(
|
||||
val id: Int,
|
||||
val phoneNumber: String,
|
||||
@ -17,7 +21,7 @@ data class RecentCall(
|
||||
val specificNumber: String,
|
||||
val specificType: String,
|
||||
val isUnknownNumber: Boolean,
|
||||
) {
|
||||
) : Serializable {
|
||||
fun doesContainPhoneNumber(text: String): Boolean {
|
||||
val normalizedText = text.normalizePhoneNumber()
|
||||
return PhoneNumberUtils.compare(phoneNumber.normalizePhoneNumber(), normalizedText) ||
|
||||
@ -25,4 +29,5 @@ data class RecentCall(
|
||||
phoneNumber.normalizePhoneNumber().contains(normalizedText) ||
|
||||
phoneNumber.contains(normalizedText)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user