resolve some lint warnings

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-02-10 14:35:25 +01:00
parent b50501a38f
commit d7bc01e954
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
8 changed files with 19 additions and 20 deletions

View File

@ -160,7 +160,7 @@ class MagicIncomingTextMessageViewHolder(incomingView: View) : MessageHolders
val resources = itemView.resources
val bg_bubble_color = if (message.isDeleted) {
val bgBubbleColor = if (message.isDeleted) {
resources.getColor(R.color.bg_message_list_incoming_bubble_deleted)
} else {
resources.getColor(R.color.bg_message_list_incoming_bubble)
@ -173,9 +173,9 @@ class MagicIncomingTextMessageViewHolder(incomingView: View) : MessageHolders
}
val bubbleDrawable = DisplayUtils.getMessageSelector(
bg_bubble_color,
bgBubbleColor,
resources.getColor(R.color.transparent),
bg_bubble_color, bubbleResource
bgBubbleColor, bubbleResource
)
ViewCompat.setBackground(bubble, bubbleDrawable)

View File

@ -136,23 +136,23 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
realView.isSelected = true
}
val resources = sharedApplication!!.resources
val bg_bubble_color = if (message.isDeleted) {
val bgBubbleColor = if (message.isDeleted) {
resources.getColor(R.color.bg_message_list_outcoming_bubble_deleted)
} else {
resources.getColor(R.color.bg_message_list_outcoming_bubble)
}
if (message.isGrouped) {
val bubbleDrawable = getMessageSelector(
bg_bubble_color,
bgBubbleColor,
resources.getColor(R.color.transparent),
bg_bubble_color,
bgBubbleColor,
R.drawable.shape_grouped_outcoming_message)
ViewCompat.setBackground(bubble, bubbleDrawable)
} else {
val bubbleDrawable = getMessageSelector(
bg_bubble_color,
bgBubbleColor,
resources.getColor(R.color.transparent),
bg_bubble_color,
bgBubbleColor,
R.drawable.shape_outcoming_message)
ViewCompat.setBackground(bubble, bubbleDrawable)
}

View File

@ -747,7 +747,7 @@ class ChatController(args: Bundle) : BaseController(args), MessagesListAdapter
}
}
override fun getTitle(): String? {
override fun getTitle(): String {
currentConversation?.displayName?.let {
return EmojiCompat.get().process(it as CharSequence).toString()
}

View File

@ -33,9 +33,9 @@ abstract class ButterKnifeController : Controller {
private var unbinder: Unbinder? = null
constructor() {}
constructor()
constructor(args: Bundle) : super(args) {}
constructor(args: Bundle) : super(args)
protected abstract fun inflateView(inflater: LayoutInflater, container: ViewGroup): View

View File

@ -146,7 +146,7 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
WorkManager.getInstance().enqueue(shareWorker)
}
private fun getFileName(uri: Uri): String? {
private fun getFileName(uri: Uri): String {
var filename: String? = null
if (uri.scheme == "content") {
val cursor: Cursor? = context.contentResolver.query(uri, null, null, null, null)

View File

@ -46,16 +46,16 @@ class AttachmentDialog(val activity: Activity, var chatController :ChatControlle
private var unbinder: Unbinder? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState);
val view = layoutInflater.inflate(R.layout.dialog_attachment, null);
setContentView(view);
super.onCreate(savedInstanceState)
val view = layoutInflater.inflate(R.layout.dialog_attachment, null)
setContentView(view)
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
unbinder = ButterKnife.bind(this, view);
unbinder = ButterKnife.bind(this, view)
attachFromLocal?.setOnClickListener {
chatController.sendSelectLocalFileIntent();
chatController.sendSelectLocalFileIntent()
dismiss()
}
attachFromCloud?.setOnClickListener {

View File

@ -43,7 +43,7 @@ object NotificationUtils {
val NOTIFICATION_CHANNEL_MESSAGES_V3 = "NOTIFICATION_CHANNEL_MESSAGES_V3"
val NOTIFICATION_CHANNEL_CALLS_V3 = "NOTIFICATION_CHANNEL_CALLS_V3"
fun getVibrationEffectForCalls(): LongArray? {
fun getVibrationEffectForCalls(): LongArray {
return longArrayOf(0L, 400L, 800L, 600L, 800L, 800L, 800L, 1000L)
}

View File

@ -82,7 +82,6 @@
android:textSize="12sp"
app:layout_alignSelf="center"
tools:text="16:08" />
/>
</com.google.android.flexbox.FlexboxLayout>