mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 12:39:58 +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
app/src/main/java/com/nextcloud/talk
account
adapters/items
chat
data/source/local
utils
@ -212,7 +212,7 @@ class ServerSelectionActivity : BaseActivity() {
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
private fun checkServerAndProceed() {
|
||||
dispose()
|
||||
var url: String = binding.serverEntryTextInputEditText.text.toString().trim { it <= ' ' }
|
||||
var url: String = binding.serverEntryTextInputEditText.text.toString().trim()
|
||||
showserverEntryProgressBar()
|
||||
if (binding.importOrChooseProviderText.visibility != View.INVISIBLE) {
|
||||
binding.importOrChooseProviderText.visibility = View.INVISIBLE
|
||||
|
@ -36,9 +36,9 @@ class AdvancedUserItem(
|
||||
private val viewThemeUtils: ViewThemeUtils,
|
||||
private val actionRequiredCount: Int
|
||||
) : AbstractFlexibleItem<UserItemViewHolder>(), IFilterable<String?> {
|
||||
override fun equals(o: Any?): Boolean {
|
||||
return if (o is AdvancedUserItem) {
|
||||
model == o.model
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return if (other is AdvancedUserItem) {
|
||||
model == other.model
|
||||
} else {
|
||||
false
|
||||
}
|
||||
@ -98,7 +98,7 @@ class AdvancedUserItem(
|
||||
return model.displayName != null &&
|
||||
Pattern
|
||||
.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||
.matcher(model.displayName!!.trim { it <= ' ' })
|
||||
.matcher(model.displayName!!.trim())
|
||||
.find()
|
||||
}
|
||||
|
||||
|
@ -57,10 +57,10 @@ class ContactItem(
|
||||
return model.displayName != null &&
|
||||
(
|
||||
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||
.matcher(model.displayName!!.trim { it <= ' ' })
|
||||
.matcher(model.displayName!!.trim())
|
||||
.find() ||
|
||||
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||
.matcher(model.calculatedActorId!!.trim { it <= ' ' })
|
||||
.matcher(model.calculatedActorId!!.trim())
|
||||
.find()
|
||||
)
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ class ConversationItem(
|
||||
return model.displayName != null &&
|
||||
Pattern
|
||||
.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
|
||||
.matcher(model.displayName!!.trim { it <= ' ' })
|
||||
.matcher(model.displayName.trim())
|
||||
.find()
|
||||
}
|
||||
|
||||
|
@ -292,9 +292,9 @@ class ParticipantItem(
|
||||
override fun filter(constraint: String?): Boolean {
|
||||
return model.displayName != null && (
|
||||
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)
|
||||
.matcher(model.calculatedActorId!!.trim { it <= ' ' }).find()
|
||||
.matcher(model.calculatedActorId!!.trim()).find()
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,7 @@ class MessageInputFragment : Fragment() {
|
||||
if (editable.subSequence(
|
||||
editable.getSpanStart(mentionSpan),
|
||||
editable.getSpanEnd(mentionSpan)
|
||||
).toString().trim { it <= ' ' } != mentionSpan.label
|
||||
).toString().trim() != mentionSpan.label
|
||||
) {
|
||||
editable.removeSpan(mentionSpan)
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ data class ChatMessage(
|
||||
}
|
||||
}
|
||||
return if (!messageTypesToIgnore.contains(getCalculateMessageType())) {
|
||||
message!!.trim { it <= ' ' }
|
||||
message!!.trim()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ abstract class TalkDatabase : RoomDatabase() {
|
||||
.getString(R.string.nc_app_product_name)
|
||||
.lowercase(Locale.getDefault())
|
||||
.replace(" ", "_")
|
||||
.trim { it <= ' ' } +
|
||||
.trim() +
|
||||
".sqlite"
|
||||
|
||||
return Room
|
||||
|
@ -401,14 +401,14 @@ object DisplayUtils {
|
||||
if (url!!.length >= HTTP_MIN_LENGTH &&
|
||||
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 &&
|
||||
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 {
|
||||
url.trim { it <= ' ' }
|
||||
url.trim()
|
||||
}
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ object DisplayUtils {
|
||||
*/
|
||||
fun beautifyTwitterHandle(handle: String?): String {
|
||||
return if (handle != null) {
|
||||
val trimmedHandle = handle.trim { it <= ' ' }
|
||||
val trimmedHandle = handle.trim()
|
||||
if (TextUtils.isEmpty(trimmedHandle)) {
|
||||
return ""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user