Resolve deprecation warnings related to string formatting for views
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -82,7 +82,7 @@ object CertUtil {
|
||||
val cert = certificates[0]
|
||||
|
||||
if (cert.subjectDN != null) {
|
||||
val DN = cert.subjectDN.name.toUpperCase(Locale.getDefault())
|
||||
val DN = cert.subjectDN.name.uppercase(Locale.getDefault())
|
||||
DN.contains(FDROID) || DN.contains(GUARDIAN)
|
||||
} else {
|
||||
false
|
||||
|
||||
@@ -118,7 +118,13 @@ class PermissionGroup : LinearLayout {
|
||||
title = "Android"
|
||||
}
|
||||
|
||||
title = title.capitalize(Locale.getDefault())
|
||||
title = title.replaceFirstChar {
|
||||
if (it.isLowerCase()) {
|
||||
it.titlecase(Locale.getDefault())
|
||||
} else {
|
||||
it.toString()
|
||||
}
|
||||
}
|
||||
|
||||
context.showDialog(title, description)
|
||||
}
|
||||
@@ -154,10 +160,22 @@ class PermissionGroup : LinearLayout {
|
||||
return it.replace(it, "")
|
||||
.replace("_", " ")
|
||||
.lowercase(Locale.getDefault())
|
||||
.capitalize(Locale.getDefault())
|
||||
.replaceFirstChar {
|
||||
if (it.isLowerCase()) {
|
||||
it.titlecase(Locale.getDefault())
|
||||
} else {
|
||||
it.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return label.capitalize(Locale.getDefault())
|
||||
return label.replaceFirstChar {
|
||||
if (it.isLowerCase()) {
|
||||
it.titlecase(Locale.getDefault())
|
||||
} else {
|
||||
it.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,13 @@ class DownloadView : RelativeLayout {
|
||||
|
||||
B.txtStatus.text = download.status.name
|
||||
.lowercase(Locale.getDefault())
|
||||
.capitalize(Locale.getDefault())
|
||||
.replaceFirstChar {
|
||||
if (it.isLowerCase()) {
|
||||
it.titlecase(Locale.getDefault())
|
||||
} else {
|
||||
it.toString()
|
||||
}
|
||||
}
|
||||
|
||||
B.txtSize.text = StringBuilder()
|
||||
.append(humanReadableByteValue(download.downloaded, true))
|
||||
|
||||
@@ -64,7 +64,13 @@ class InfoView : RelativeLayout {
|
||||
B.txtTitle.text = info.key
|
||||
.replace("_", " ")
|
||||
.lowercase(Locale.getDefault())
|
||||
.capitalize(Locale.getDefault())
|
||||
.replaceFirstChar {
|
||||
if (it.isLowerCase()) {
|
||||
it.titlecase(Locale.getDefault())
|
||||
} else {
|
||||
it.toString()
|
||||
}
|
||||
}
|
||||
B.txtSubtitle.text = info.value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user