mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-22 04:59:34 +01:00
style(lint): Unnecessary lambda with trim()
The lambda argument ({ it <= ' ' }) is unnecessary Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
87f1319145
commit
240ec8f98e
@ -212,7 +212,7 @@ class ServerSelectionActivity : BaseActivity() {
|
|||||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
private fun checkServerAndProceed() {
|
private fun checkServerAndProceed() {
|
||||||
dispose()
|
dispose()
|
||||||
var url: String = binding.serverEntryTextInputEditText.text.toString().trim { it <= ' ' }
|
var url: String = binding.serverEntryTextInputEditText.text.toString().trim()
|
||||||
showserverEntryProgressBar()
|
showserverEntryProgressBar()
|
||||||
if (binding.importOrChooseProviderText.visibility != View.INVISIBLE) {
|
if (binding.importOrChooseProviderText.visibility != View.INVISIBLE) {
|
||||||
binding.importOrChooseProviderText.visibility = View.INVISIBLE
|
binding.importOrChooseProviderText.visibility = View.INVISIBLE
|
||||||
|
@ -36,9 +36,9 @@ class AdvancedUserItem(
|
|||||||
private val viewThemeUtils: ViewThemeUtils,
|
private val viewThemeUtils: ViewThemeUtils,
|
||||||
private val actionRequiredCount: Int
|
private val actionRequiredCount: Int
|
||||||
) : AbstractFlexibleItem<UserItemViewHolder>(), IFilterable<String?> {
|
) : AbstractFlexibleItem<UserItemViewHolder>(), IFilterable<String?> {
|
||||||
override fun equals(o: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
return if (o is AdvancedUserItem) {
|
return if (other is AdvancedUserItem) {
|
||||||
model == o.model
|
model == other.model
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ class AdvancedUserItem(
|
|||||||
return model.displayName != null &&
|
return model.displayName != null &&
|
||||||
Pattern
|
Pattern
|
||||||
.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||||
.matcher(model.displayName!!.trim { it <= ' ' })
|
.matcher(model.displayName!!.trim())
|
||||||
.find()
|
.find()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,10 +57,10 @@ class ContactItem(
|
|||||||
return model.displayName != null &&
|
return model.displayName != null &&
|
||||||
(
|
(
|
||||||
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||||
.matcher(model.displayName!!.trim { it <= ' ' })
|
.matcher(model.displayName!!.trim())
|
||||||
.find() ||
|
.find() ||
|
||||||
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||||
.matcher(model.calculatedActorId!!.trim { it <= ' ' })
|
.matcher(model.calculatedActorId!!.trim())
|
||||||
.find()
|
.find()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ class ConversationItem(
|
|||||||
return model.displayName != null &&
|
return model.displayName != null &&
|
||||||
Pattern
|
Pattern
|
||||||
.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||||
.matcher(model.displayName!!.trim { it <= ' ' })
|
.matcher(model.displayName.trim())
|
||||||
.find()
|
.find()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,9 +292,9 @@ class ParticipantItem(
|
|||||||
override fun filter(constraint: String?): Boolean {
|
override fun filter(constraint: String?): Boolean {
|
||||||
return model.displayName != null && (
|
return model.displayName != null && (
|
||||||
Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||||
.matcher(model.displayName!!.trim { it <= ' ' }).find() ||
|
.matcher(model.displayName!!.trim()).find() ||
|
||||||
Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||||
.matcher(model.calculatedActorId!!.trim { it <= ' ' }).find()
|
.matcher(model.calculatedActorId!!.trim()).find()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ class MessageInputFragment : Fragment() {
|
|||||||
if (editable.subSequence(
|
if (editable.subSequence(
|
||||||
editable.getSpanStart(mentionSpan),
|
editable.getSpanStart(mentionSpan),
|
||||||
editable.getSpanEnd(mentionSpan)
|
editable.getSpanEnd(mentionSpan)
|
||||||
).toString().trim { it <= ' ' } != mentionSpan.label
|
).toString().trim() != mentionSpan.label
|
||||||
) {
|
) {
|
||||||
editable.removeSpan(mentionSpan)
|
editable.removeSpan(mentionSpan)
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ data class ChatMessage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return if (!messageTypesToIgnore.contains(getCalculateMessageType())) {
|
return if (!messageTypesToIgnore.contains(getCalculateMessageType())) {
|
||||||
message!!.trim { it <= ' ' }
|
message!!.trim()
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ abstract class TalkDatabase : RoomDatabase() {
|
|||||||
.getString(R.string.nc_app_product_name)
|
.getString(R.string.nc_app_product_name)
|
||||||
.lowercase(Locale.getDefault())
|
.lowercase(Locale.getDefault())
|
||||||
.replace(" ", "_")
|
.replace(" ", "_")
|
||||||
.trim { it <= ' ' } +
|
.trim() +
|
||||||
".sqlite"
|
".sqlite"
|
||||||
|
|
||||||
return Room
|
return Room
|
||||||
|
@ -401,14 +401,14 @@ object DisplayUtils {
|
|||||||
if (url!!.length >= HTTP_MIN_LENGTH &&
|
if (url!!.length >= HTTP_MIN_LENGTH &&
|
||||||
HTTP_PROTOCOL.equals(url.substring(0, HTTP_MIN_LENGTH), ignoreCase = true)
|
HTTP_PROTOCOL.equals(url.substring(0, HTTP_MIN_LENGTH), ignoreCase = true)
|
||||||
) {
|
) {
|
||||||
return url.substring(HTTP_PROTOCOL.length).trim { it <= ' ' }
|
return url.substring(HTTP_PROTOCOL.length).trim()
|
||||||
}
|
}
|
||||||
return if (url.length >= HTTPS_MIN_LENGTH &&
|
return if (url.length >= HTTPS_MIN_LENGTH &&
|
||||||
HTTPS_PROTOCOL.equals(url.substring(0, HTTPS_MIN_LENGTH), ignoreCase = true)
|
HTTPS_PROTOCOL.equals(url.substring(0, HTTPS_MIN_LENGTH), ignoreCase = true)
|
||||||
) {
|
) {
|
||||||
url.substring(HTTPS_PROTOCOL.length).trim { it <= ' ' }
|
url.substring(HTTPS_PROTOCOL.length).trim()
|
||||||
} else {
|
} else {
|
||||||
url.trim { it <= ' ' }
|
url.trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ object DisplayUtils {
|
|||||||
*/
|
*/
|
||||||
fun beautifyTwitterHandle(handle: String?): String {
|
fun beautifyTwitterHandle(handle: String?): String {
|
||||||
return if (handle != null) {
|
return if (handle != null) {
|
||||||
val trimmedHandle = handle.trim { it <= ' ' }
|
val trimmedHandle = handle.trim()
|
||||||
if (TextUtils.isEmpty(trimmedHandle)) {
|
if (TextUtils.isEmpty(trimmedHandle)) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user