Added Serializable to RecentCall.kt and improved documentation string
This commit is contained in:
parent
eeaa073d55
commit
d3bff0a272
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue