Avoid warnings in Contact
This commit is contained in:
@@ -43,18 +43,16 @@ class Contact(var name: String, var uri: String, var color: Int, val id: Long) {
|
|||||||
val uri = uriParams.substringAfter("<").substringBefore(">")
|
val uri = uriParams.substringAfter("<").substringBefore(">")
|
||||||
val params = uriParams.substringAfter(">;")
|
val params = uriParams.substringAfter(">;")
|
||||||
val colorValue = Utils.paramValue(params, "color" )
|
val colorValue = Utils.paramValue(params, "color" )
|
||||||
val color: Int
|
val color: Int = if (colorValue != "")
|
||||||
if (colorValue != "")
|
colorValue.toInt()
|
||||||
color = colorValue.toInt()
|
|
||||||
else
|
else
|
||||||
color = Utils.randomColor()
|
Utils.randomColor()
|
||||||
val androidContact = Utils.paramValue(params, "android" ) == "true"
|
val androidContact = Utils.paramValue(params, "android" ) == "true"
|
||||||
val idValue = Utils.paramValue(params, "id" )
|
val idValue = Utils.paramValue(params, "id" )
|
||||||
val id: Long
|
val id: Long = if (idValue != "")
|
||||||
if (idValue != "")
|
idValue.toLong()
|
||||||
id = idValue.toLong()
|
|
||||||
else
|
else
|
||||||
id = baseId + contactNo
|
baseId + contactNo
|
||||||
Log.d(TAG, "Restoring contact $name, $uri, $color, $id, $androidContact")
|
Log.d(TAG, "Restoring contact $name, $uri, $color, $id, $androidContact")
|
||||||
val contact = Contact(name, uri, color, id)
|
val contact = Contact(name, uri, color, id)
|
||||||
contact.androidContact = androidContact
|
contact.androidContact = androidContact
|
||||||
|
|||||||
Reference in New Issue
Block a user