Переглянути джерело

resolve some lint warnings

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 4 роки тому
батько
коміт
d7bc01e954

+ 3 - 3
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt

@@ -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)
 

+ 5 - 5
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt

@@ -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)
         }

+ 1 - 1
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -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()
         }

+ 2 - 2
app/src/main/java/com/nextcloud/talk/controllers/base/ButterKnifeController.kt

@@ -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
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/jobs/UploadAndShareFilesWorker.kt

@@ -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)

+ 6 - 6
app/src/main/java/com/nextcloud/talk/ui/dialog/AttachmentDialog.kt

@@ -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 {

+ 1 - 1
app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.kt

@@ -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)
     }
 

+ 0 - 1
app/src/main/res/layout/item_message_quote.xml

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