Эх сурвалжийг харах

ktlint: No whitespace expected between opening parenthesis and first parameter name

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 1 жил өмнө
parent
commit
627e9d5c20
45 өөрчлөгдсөн 84 нэмэгдсэн , 332 устгасан
  1. 3 13
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt
  2. 2 7
      app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt
  3. 1 6
      app/src/main/java/com/nextcloud/talk/adapters/messages/LinkPreview.kt
  4. 3 12
      app/src/main/java/com/nextcloud/talk/bottomsheet/items/ListIconDialogAdapter.kt
  5. 2 7
      app/src/main/java/com/nextcloud/talk/call/ReactionAnimator.kt
  6. 3 12
      app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
  7. 2 9
      app/src/main/java/com/nextcloud/talk/chat/data/ChatRepositoryImpl.kt
  8. 2 8
      app/src/main/java/com/nextcloud/talk/conversation/repository/ConversationRepository.kt
  9. 1 4
      app/src/main/java/com/nextcloud/talk/conversation/repository/ConversationRepositoryImpl.kt
  10. 1 4
      app/src/main/java/com/nextcloud/talk/conversation/viewmodel/ConversationViewModel.kt
  11. 1 3
      app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt
  12. 1 6
      app/src/main/java/com/nextcloud/talk/jobs/ShareOperationWorker.kt
  13. 2 9
      app/src/main/java/com/nextcloud/talk/jobs/UploadAndShareFilesWorker.kt
  14. 1 5
      app/src/main/java/com/nextcloud/talk/location/LocationPickerActivity.kt
  15. 1 3
      app/src/main/java/com/nextcloud/talk/models/domain/ConversationModel.kt
  16. 1 4
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatUtils.kt
  17. 1 3
      app/src/main/java/com/nextcloud/talk/openconversations/data/OpenConversationsRepositoryImpl.kt
  18. 2 8
      app/src/main/java/com/nextcloud/talk/polls/ui/PollLoadingFragment.kt
  19. 1 5
      app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt
  20. 1 5
      app/src/main/java/com/nextcloud/talk/polls/ui/PollVoteFragment.kt
  21. 2 8
      app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt
  22. 2 6
      app/src/main/java/com/nextcloud/talk/raisehand/RequestAssistanceRepository.kt
  23. 2 6
      app/src/main/java/com/nextcloud/talk/raisehand/RequestAssistanceRepositoryImpl.kt
  24. 1 4
      app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt
  25. 2 6
      app/src/main/java/com/nextcloud/talk/repositories/callrecording/CallRecordingRepository.kt
  26. 4 12
      app/src/main/java/com/nextcloud/talk/repositories/callrecording/CallRecordingRepositoryImpl.kt
  27. 2 10
      app/src/main/java/com/nextcloud/talk/repositories/reactions/ReactionsRepository.kt
  28. 1 5
      app/src/main/java/com/nextcloud/talk/repositories/reactions/ReactionsRepositoryImpl.kt
  29. 2 9
      app/src/main/java/com/nextcloud/talk/shareditems/repositories/SharedItemsRepository.kt
  30. 1 4
      app/src/main/java/com/nextcloud/talk/shareditems/repositories/SharedItemsRepositoryImpl.kt
  31. 1 4
      app/src/main/java/com/nextcloud/talk/translate/repositories/TranslateRepository.kt
  32. 6 9
      app/src/main/java/com/nextcloud/talk/ui/dialog/DateTimePickerFragment.kt
  33. 1 5
      app/src/main/java/com/nextcloud/talk/ui/dialog/FilterConversationFragment.kt
  34. 1 3
      app/src/main/java/com/nextcloud/talk/ui/dialog/SaveToStorageDialogFragment.kt
  35. 1 3
      app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt
  36. 2 10
      app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt
  37. 2 9
      app/src/main/java/com/nextcloud/talk/upload/chunked/ChunkedFileUploader.kt
  38. 1 3
      app/src/main/java/com/nextcloud/talk/upload/chunked/OnDataTransferProgressListener.kt
  39. 1 6
      app/src/main/java/com/nextcloud/talk/upload/normal/FileUploader.kt
  40. 3 15
      app/src/main/java/com/nextcloud/talk/utils/BitmapShrinker.kt
  41. 1 4
      app/src/main/java/com/nextcloud/talk/utils/FileViewerUtils.kt
  42. 8 31
      app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.kt
  43. 3 15
      app/src/main/java/com/nextcloud/talk/utils/RemoteFileUtils.kt
  44. 1 5
      app/src/main/java/com/nextcloud/talk/utils/ShareUtils.kt
  45. 1 7
      app/src/main/java/third/parties/fresco/BetterImageSpan.kt

+ 3 - 13
app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt

@@ -1050,10 +1050,7 @@ class CallActivity : CallBaseActivity() {
     private val isConnectionEstablished: Boolean
     private val isConnectionEstablished: Boolean
         get() = currentCallStatus === CallStatus.JOINED || currentCallStatus === CallStatus.IN_CONVERSATION
         get() = currentCallStatus === CallStatus.JOINED || currentCallStatus === CallStatus.IN_CONVERSATION
 
 
-    private fun onAudioManagerDevicesChanged(
-        currentDevice: AudioDevice,
-        availableDevices: Set<AudioDevice>
-    ) {
+    private fun onAudioManagerDevicesChanged(currentDevice: AudioDevice, availableDevices: Set<AudioDevice>) {
         Log.d(TAG, "onAudioManagerDevicesChanged: $availableDevices, currentDevice: $currentDevice")
         Log.d(TAG, "onAudioManagerDevicesChanged: $availableDevices, currentDevice: $currentDevice")
         val shouldDisableProximityLock =
         val shouldDisableProximityLock =
             currentDevice == AudioDevice.WIRED_HEADSET ||
             currentDevice == AudioDevice.WIRED_HEADSET ||
@@ -1529,10 +1526,7 @@ class CallActivity : CallBaseActivity() {
             })
             })
     }
     }
 
 
-    private fun addIceServers(
-        signalingSettingsOverall: SignalingSettingsOverall,
-        apiVersion: Int
-    ) {
+    private fun addIceServers(signalingSettingsOverall: SignalingSettingsOverall, apiVersion: Int) {
         if (signalingSettingsOverall.ocs!!.settings!!.stunServers != null) {
         if (signalingSettingsOverall.ocs!!.settings!!.stunServers != null) {
             val stunServers = signalingSettingsOverall.ocs!!.settings!!.stunServers
             val stunServers = signalingSettingsOverall.ocs!!.settings!!.stunServers
             if (apiVersion == ApiUtils.APIv3) {
             if (apiVersion == ApiUtils.APIv3) {
@@ -3035,11 +3029,7 @@ class CallActivity : CallBaseActivity() {
         }
         }
     }
     }
 
 
-    private fun updatePictureInPictureActions(
-        @DrawableRes iconId: Int,
-        title: String?,
-        requestCode: Int
-    ) {
+    private fun updatePictureInPictureActions(@DrawableRes iconId: Int, title: String?, requestCode: Int) {
         if (isGreaterEqualOreo && isPipModePossible) {
         if (isGreaterEqualOreo && isPipModePossible) {
             val actions = ArrayList<RemoteAction>()
             val actions = ArrayList<RemoteAction>()
             val icon = Icon.createWithResource(this, iconId)
             val icon = Icon.createWithResource(this, iconId)

+ 2 - 7
app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt

@@ -203,9 +203,7 @@ class ConversationItem(
         }
         }
     }
     }
 
 
-    private fun shouldLoadAvatar(
-        holder: ConversationItemViewHolder
-    ): Boolean {
+    private fun shouldLoadAvatar(holder: ConversationItemViewHolder): Boolean {
         return when (model.objectType) {
         return when (model.objectType) {
             Conversation.ObjectType.SHARE_PASSWORD -> {
             Conversation.ObjectType.SHARE_PASSWORD -> {
                 holder.binding.dialogAvatar.setImageDrawable(
                 holder.binding.dialogAvatar.setImageDrawable(
@@ -237,10 +235,7 @@ class ConversationItem(
         }
         }
     }
     }
 
 
-    private fun setLastMessage(
-        holder: ConversationItemViewHolder,
-        appContext: Context
-    ) {
+    private fun setLastMessage(holder: ConversationItemViewHolder, appContext: Context) {
         if (model.lastMessage != null) {
         if (model.lastMessage != null) {
             holder.binding.dialogDate.visibility = View.VISIBLE
             holder.binding.dialogDate.visibility = View.VISIBLE
             holder.binding.dialogDate.text = DateUtils.getRelativeTimeSpanString(
             holder.binding.dialogDate.text = DateUtils.getRelativeTimeSpanString(

+ 1 - 6
app/src/main/java/com/nextcloud/talk/adapters/messages/LinkPreview.kt

@@ -38,12 +38,7 @@ import io.reactivex.schedulers.Schedulers
 
 
 class LinkPreview {
 class LinkPreview {
 
 
-    fun showLink(
-        message: ChatMessage,
-        ncApi: NcApi,
-        binding: ReferenceInsideMessageBinding,
-        context: Context
-    ) {
+    fun showLink(message: ChatMessage, ncApi: NcApi, binding: ReferenceInsideMessageBinding, context: Context) {
         binding.referenceName.text = ""
         binding.referenceName.text = ""
         binding.referenceDescription.text = ""
         binding.referenceDescription.text = ""
         binding.referenceLink.text = ""
         binding.referenceLink.text = ""

+ 3 - 12
app/src/main/java/com/nextcloud/talk/bottomsheet/items/ListIconDialogAdapter.kt

@@ -79,10 +79,7 @@ internal class ListIconDialogAdapter<IT : ListItemWithImage>(
         }
         }
     }
     }
 
 
-    override fun onCreateViewHolder(
-        parent: ViewGroup,
-        viewType: Int
-    ): ListItemViewHolder {
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ListItemViewHolder {
         val listItemView: View = parent.inflate(dialog.windowContext, R.layout.menu_item_sheet)
         val listItemView: View = parent.inflate(dialog.windowContext, R.layout.menu_item_sheet)
         val viewHolder = ListItemViewHolder(
         val viewHolder = ListItemViewHolder(
             itemView = listItemView,
             itemView = listItemView,
@@ -94,10 +91,7 @@ internal class ListIconDialogAdapter<IT : ListItemWithImage>(
 
 
     override fun getItemCount() = items.size
     override fun getItemCount() = items.size
 
 
-    override fun onBindViewHolder(
-        holder: ListItemViewHolder,
-        position: Int
-    ) {
+    override fun onBindViewHolder(holder: ListItemViewHolder, position: Int) {
         holder.itemView.isEnabled = !disabledIndices.contains(position)
         holder.itemView.isEnabled = !disabledIndices.contains(position)
         val currentItem = items[position]
         val currentItem = items[position]
 
 
@@ -120,10 +114,7 @@ internal class ListIconDialogAdapter<IT : ListItemWithImage>(
         }
         }
     }
     }
 
 
-    override fun replaceItems(
-        items: List<IT>,
-        listener: ListItemListener<IT>
-    ) {
+    override fun replaceItems(items: List<IT>, listener: ListItemListener<IT>) {
         this.items = items
         this.items = items
         if (listener != null) {
         if (listener != null) {
             this.selection = listener
             this.selection = listener

+ 2 - 7
app/src/main/java/com/nextcloud/talk/call/ReactionAnimator.kt

@@ -46,10 +46,7 @@ class ReactionAnimator(
 ) {
 ) {
     private val reactionsList: MutableList<CallReaction> = ArrayList()
     private val reactionsList: MutableList<CallReaction> = ArrayList()
 
 
-    fun addReaction(
-        emoji: String,
-        displayName: String
-    ) {
+    fun addReaction(emoji: String, displayName: String) {
         val callReaction = CallReaction(emoji, displayName)
         val callReaction = CallReaction(emoji, displayName)
         reactionsList.add(callReaction)
         reactionsList.add(callReaction)
 
 
@@ -58,9 +55,7 @@ class ReactionAnimator(
         }
         }
     }
     }
 
 
-    private fun animateReaction(
-        callReaction: CallReaction
-    ) {
+    private fun animateReaction(callReaction: CallReaction) {
         val reactionWrapper = getReactionWrapperView(callReaction)
         val reactionWrapper = getReactionWrapperView(callReaction)
 
 
         val params = RelativeLayout.LayoutParams(
         val params = RelativeLayout.LayoutParams(

+ 3 - 12
app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt

@@ -2979,9 +2979,7 @@ class ChatActivity :
         }
         }
     }
     }
 
 
-    fun leaveRoom(
-        funToCallWhenLeaveSuccessful: (() -> Unit)?
-    ) {
+    fun leaveRoom(funToCallWhenLeaveSuccessful: (() -> Unit)?) {
         logConversationInfos("leaveRoom")
         logConversationInfos("leaveRoom")
 
 
         var apiVersion = 1
         var apiVersion = 1
@@ -3147,11 +3145,7 @@ class ChatActivity :
         signalingMessageSender = webSocketInstance?.signalingMessageSender
         signalingMessageSender = webSocketInstance?.signalingMessageSender
     }
     }
 
 
-    fun pullChatMessages(
-        lookIntoFuture: Boolean,
-        setReadMarker: Boolean = true,
-        xChatLastCommonRead: Int? = null
-    ) {
+    fun pullChatMessages(lookIntoFuture: Boolean, setReadMarker: Boolean = true, xChatLastCommonRead: Int? = null) {
         if (!validSessionId()) {
         if (!validSessionId()) {
             return
             return
         }
         }
@@ -3471,10 +3465,7 @@ class ChatActivity :
         }
         }
     }
     }
 
 
-    private fun addMessagesToAdapter(
-        shouldAddNewMessagesNotice: Boolean,
-        chatMessageList: List<ChatMessage>
-    ) {
+    private fun addMessagesToAdapter(shouldAddNewMessagesNotice: Boolean, chatMessageList: List<ChatMessage>) {
         val isThereANewNotice =
         val isThereANewNotice =
             shouldAddNewMessagesNotice || adapter?.getMessagePositionByIdInReverse("-1") != -1
             shouldAddNewMessagesNotice || adapter?.getMessagePositionByIdInReverse("-1") != -1
         for (chatMessage in chatMessageList) {
         for (chatMessage in chatMessageList) {

+ 2 - 9
app/src/main/java/com/nextcloud/talk/chat/data/ChatRepositoryImpl.kt

@@ -29,10 +29,7 @@ import com.nextcloud.talk.utils.ApiUtils
 import io.reactivex.Observable
 import io.reactivex.Observable
 
 
 class ChatRepositoryImpl(private val ncApi: NcApi) : ChatRepository {
 class ChatRepositoryImpl(private val ncApi: NcApi) : ChatRepository {
-    override fun getRoom(
-        user: User,
-        roomToken: String
-    ): Observable<ConversationModel> {
+    override fun getRoom(user: User, roomToken: String): Observable<ConversationModel> {
         val credentials: String = ApiUtils.getCredentials(user.username, user.token)
         val credentials: String = ApiUtils.getCredentials(user.username, user.token)
         val apiVersion = ApiUtils.getConversationApiVersion(user, intArrayOf(ApiUtils.APIv4, ApiUtils.APIv3, 1))
         val apiVersion = ApiUtils.getConversationApiVersion(user, intArrayOf(ApiUtils.APIv4, ApiUtils.APIv3, 1))
 
 
@@ -42,11 +39,7 @@ class ChatRepositoryImpl(private val ncApi: NcApi) : ChatRepository {
         ).map { ConversationModel.mapToConversationModel(it.ocs?.data!!) }
         ).map { ConversationModel.mapToConversationModel(it.ocs?.data!!) }
     }
     }
 
 
-    override fun joinRoom(
-        user: User,
-        roomToken: String,
-        roomPassword: String
-    ): Observable<ConversationModel> {
+    override fun joinRoom(user: User, roomToken: String, roomPassword: String): Observable<ConversationModel> {
         val credentials: String = ApiUtils.getCredentials(user.username, user.token)
         val credentials: String = ApiUtils.getCredentials(user.username, user.token)
         val apiVersion = ApiUtils.getConversationApiVersion(user, intArrayOf(ApiUtils.APIv4, 1))
         val apiVersion = ApiUtils.getConversationApiVersion(user, intArrayOf(ApiUtils.APIv4, 1))
 
 

+ 2 - 8
app/src/main/java/com/nextcloud/talk/conversation/repository/ConversationRepository.kt

@@ -27,13 +27,7 @@ import io.reactivex.Observable
 
 
 interface ConversationRepository {
 interface ConversationRepository {
 
 
-    fun renameConversation(
-        roomToken: String,
-        roomNameNew: String
-    ): Observable<GenericOverall>
+    fun renameConversation(roomToken: String, roomNameNew: String): Observable<GenericOverall>
 
 
-    fun createConversation(
-        roomName: String,
-        conversationType: Conversation.ConversationType?
-    ): Observable<RoomOverall>
+    fun createConversation(roomName: String, conversationType: Conversation.ConversationType?): Observable<RoomOverall>
 }
 }

+ 1 - 4
app/src/main/java/com/nextcloud/talk/conversation/repository/ConversationRepositoryImpl.kt

@@ -38,10 +38,7 @@ class ConversationRepositoryImpl(private val ncApi: NcApi, currentUserProvider:
     val currentUser: User = currentUserProvider.currentUser.blockingGet()
     val currentUser: User = currentUserProvider.currentUser.blockingGet()
     val credentials: String = ApiUtils.getCredentials(currentUser.username, currentUser.token)
     val credentials: String = ApiUtils.getCredentials(currentUser.username, currentUser.token)
 
 
-    override fun renameConversation(
-        roomToken: String,
-        roomNameNew: String
-    ): Observable<GenericOverall> {
+    override fun renameConversation(roomToken: String, roomNameNew: String): Observable<GenericOverall> {
         val apiVersion = ApiUtils.getConversationApiVersion(currentUser, intArrayOf(ApiUtils.APIv4, ApiUtils.APIv1))
         val apiVersion = ApiUtils.getConversationApiVersion(currentUser, intArrayOf(ApiUtils.APIv4, ApiUtils.APIv1))
 
 
         return ncApi.renameRoom(
         return ncApi.renameRoom(

+ 1 - 4
app/src/main/java/com/nextcloud/talk/conversation/viewmodel/ConversationViewModel.kt

@@ -54,10 +54,7 @@ class ConversationViewModel @Inject constructor(private val repository: Conversa
         disposable?.dispose()
         disposable?.dispose()
     }
     }
 
 
-    fun createConversation(
-        roomName: String,
-        conversationType: Conversation.ConversationType?
-    ) {
+    fun createConversation(roomName: String, conversationType: Conversation.ConversationType?) {
         _viewState.value = CreatingState
         _viewState.value = CreatingState
 
 
         repository.createConversation(
         repository.createConversation(

+ 1 - 3
app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt

@@ -352,9 +352,7 @@ class ConversationsListActivity :
         viewThemeUtils.material.themeToolbar(binding.conversationListToolbar)
         viewThemeUtils.material.themeToolbar(binding.conversationListToolbar)
     }
     }
 
 
-    private fun loadUserAvatar(
-        target: Target
-    ) {
+    private fun loadUserAvatar(target: Target) {
         if (currentUser != null) {
         if (currentUser != null) {
             val url = ApiUtils.getUrlForAvatar(
             val url = ApiUtils.getUrlForAvatar(
                 currentUser!!.baseUrl,
                 currentUser!!.baseUrl,

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

@@ -93,12 +93,7 @@ class ShareOperationWorker(context: Context, workerParams: WorkerParameters) : W
     companion object {
     companion object {
         private val TAG = ShareOperationWorker::class.simpleName
         private val TAG = ShareOperationWorker::class.simpleName
 
 
-        fun shareFile(
-            roomToken: String?,
-            currentUser: User,
-            remotePath: String,
-            metaData: String?
-        ) {
+        fun shareFile(roomToken: String?,   currentUser: User, remotePath: String, metaData: String?) {
             val paths: MutableList<String> = ArrayList()
             val paths: MutableList<String> = ArrayList()
             paths.add(remotePath)
             paths.add(remotePath)
 
 

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

@@ -186,9 +186,7 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
         return remotePath
         return remotePath
     }
     }
 
 
-    override fun onTransferProgress(
-        percentage: Int
-    ) {
+    override fun onTransferProgress(percentage: Int) {
         notification = mBuilder!!
         notification = mBuilder!!
             .setProgress(HUNDRED_PERCENT, percentage, false)
             .setProgress(HUNDRED_PERCENT, percentage, false)
             .setContentText(getNotificationContentText(percentage))
             .setContentText(getNotificationContentText(percentage))
@@ -322,12 +320,7 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
             }
             }
         }
         }
 
 
-        fun upload(
-            fileUri: String,
-            roomToken: String,
-            conversationName: String,
-            metaData: String?
-        ) {
+        fun upload(fileUri: String, roomToken: String, conversationName: String, metaData: String?) {
             val data: Data = Data.Builder()
             val data: Data = Data.Builder()
                 .putString(DEVICE_SOURCE_FILE, fileUri)
                 .putString(DEVICE_SOURCE_FILE, fileUri)
                 .putString(ROOM_TOKEN, roomToken)
                 .putString(ROOM_TOKEN, roomToken)

+ 1 - 5
app/src/main/java/com/nextcloud/talk/location/LocationPickerActivity.kt

@@ -524,11 +524,7 @@ class LocationPickerActivity :
         )
         )
     }
     }
 
 
-    override fun onRequestPermissionsResult(
-        requestCode: Int,
-        permissions: Array<out String>,
-        grantResults: IntArray
-    ) {
+    override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
         super.onRequestPermissionsResult(requestCode, permissions, grantResults)
         super.onRequestPermissionsResult(requestCode, permissions, grantResults)
 
 
         fun areAllGranted(grantResults: IntArray): Boolean {
         fun areAllGranted(grantResults: IntArray): Boolean {

+ 1 - 3
app/src/main/java/com/nextcloud/talk/models/domain/ConversationModel.kt

@@ -46,9 +46,7 @@ class ConversationModel(
 ) {
 ) {
 
 
     companion object {
     companion object {
-        fun mapToConversationModel(
-            conversation: Conversation
-        ): ConversationModel {
+        fun mapToConversationModel(conversation: Conversation): ConversationModel {
             return ConversationModel(
             return ConversationModel(
                 roomId = conversation.roomId,
                 roomId = conversation.roomId,
                 token = conversation.token,
                 token = conversation.token,

+ 1 - 4
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatUtils.kt

@@ -35,10 +35,7 @@ class ChatUtils {
         }
         }
 
 
         @Suppress("Detekt.ComplexMethod")
         @Suppress("Detekt.ComplexMethod")
-        private fun parse(
-            messageParameters: HashMap<String?, HashMap<String?, String?>>,
-            message: String?
-        ): String? {
+        private fun parse(messageParameters: HashMap<String?, HashMap<String?, String?>>, message: String?): String? {
             var resultMessage = message
             var resultMessage = message
             for (key in messageParameters.keys) {
             for (key in messageParameters.keys) {
                 val individualHashMap = messageParameters[key]
                 val individualHashMap = messageParameters[key]

+ 1 - 3
app/src/main/java/com/nextcloud/talk/openconversations/data/OpenConversationsRepositoryImpl.kt

@@ -42,9 +42,7 @@ class OpenConversationsRepositoryImpl(private val ncApi: NcApi, currentUserProvi
         ).map { mapToOpenConversationsModel(it.ocs?.data!!) }
         ).map { mapToOpenConversationsModel(it.ocs?.data!!) }
     }
     }
 
 
-    private fun mapToOpenConversationsModel(
-        conversations: List<Conversation>
-    ): OpenConversationsModel {
+    private fun mapToOpenConversationsModel(conversations: List<Conversation>): OpenConversationsModel {
         return OpenConversationsModel(
         return OpenConversationsModel(
             conversations.map { conversation ->
             conversations.map { conversation ->
                 OpenConversation(
                 OpenConversation(

+ 2 - 8
app/src/main/java/com/nextcloud/talk/polls/ui/PollLoadingFragment.kt

@@ -49,11 +49,7 @@ class PollLoadingFragment : Fragment() {
         fragmentHeight = arguments?.getInt(KEY_FRAGMENT_HEIGHT)!!
         fragmentHeight = arguments?.getInt(KEY_FRAGMENT_HEIGHT)!!
     }
     }
 
 
-    override fun onCreateView(
-        inflater: LayoutInflater,
-        container: ViewGroup?,
-        savedInstanceState: Bundle?
-    ): View {
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
         binding = DialogPollLoadingBinding.inflate(inflater, container, false)
         binding = DialogPollLoadingBinding.inflate(inflater, container, false)
         binding.root.layoutParams.height = fragmentHeight
         binding.root.layoutParams.height = fragmentHeight
         viewThemeUtils.platform.colorCircularProgressBar(binding.pollLoadingProgressbar, ColorRole.PRIMARY)
         viewThemeUtils.platform.colorCircularProgressBar(binding.pollLoadingProgressbar, ColorRole.PRIMARY)
@@ -65,9 +61,7 @@ class PollLoadingFragment : Fragment() {
         private const val KEY_FRAGMENT_HEIGHT = "keyFragmentHeight"
         private const val KEY_FRAGMENT_HEIGHT = "keyFragmentHeight"
 
 
         @JvmStatic
         @JvmStatic
-        fun newInstance(
-            fragmentHeight: Int
-        ): PollLoadingFragment {
+        fun newInstance(fragmentHeight: Int): PollLoadingFragment {
             val args = bundleOf(
             val args = bundleOf(
                 KEY_FRAGMENT_HEIGHT to fragmentHeight
                 KEY_FRAGMENT_HEIGHT to fragmentHeight
             )
             )

+ 1 - 5
app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt

@@ -65,11 +65,7 @@ class PollResultsFragment : Fragment(), PollResultItemClickListener {
         parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class.java]
         parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class.java]
     }
     }
 
 
-    override fun onCreateView(
-        inflater: LayoutInflater,
-        container: ViewGroup?,
-        savedInstanceState: Bundle?
-    ): View {
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
         binding = DialogPollResultsBinding.inflate(inflater, container, false)
         binding = DialogPollResultsBinding.inflate(inflater, container, false)
         return binding.root
         return binding.root
     }
     }

+ 1 - 5
app/src/main/java/com/nextcloud/talk/polls/ui/PollVoteFragment.kt

@@ -69,11 +69,7 @@ class PollVoteFragment : Fragment() {
         parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class.java]
         parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class.java]
     }
     }
 
 
-    override fun onCreateView(
-        inflater: LayoutInflater,
-        container: ViewGroup?,
-        savedInstanceState: Bundle?
-    ): View {
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
         binding = DialogPollVoteBinding.inflate(inflater, container, false)
         binding = DialogPollVoteBinding.inflate(inflater, container, false)
         return binding.root
         return binding.root
     }
     }

+ 2 - 8
app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt

@@ -688,10 +688,7 @@ class ProfileActivity : BaseActivity() {
             }
             }
         }
         }
 
 
-        private fun initUserInfoEditText(
-            holder: ViewHolder,
-            item: UserInfoDetailsItem
-        ) {
+        private fun initUserInfoEditText(holder: ViewHolder, item: UserInfoDetailsItem) {
             holder.binding.userInfoEditTextEdit.setText(item.text)
             holder.binding.userInfoEditTextEdit.setText(item.text)
             holder.binding.userInfoInputLayout.hint = item.hint
             holder.binding.userInfoInputLayout.hint = item.hint
             holder.binding.userInfoEditTextEdit.addTextChangedListener(object : TextWatcher {
             holder.binding.userInfoEditTextEdit.addTextChangedListener(object : TextWatcher {
@@ -714,10 +711,7 @@ class ProfileActivity : BaseActivity() {
             })
             })
         }
         }
 
 
-        private fun initScopeElements(
-            item: UserInfoDetailsItem,
-            holder: ViewHolder
-        ) {
+        private fun initScopeElements(item: UserInfoDetailsItem, holder: ViewHolder) {
             if (item.scope == null) {
             if (item.scope == null) {
                 holder.binding.scope.visibility = View.GONE
                 holder.binding.scope.visibility = View.GONE
             } else {
             } else {

+ 2 - 6
app/src/main/java/com/nextcloud/talk/raisehand/RequestAssistanceRepository.kt

@@ -24,11 +24,7 @@ import io.reactivex.Observable
 
 
 interface RequestAssistanceRepository {
 interface RequestAssistanceRepository {
 
 
-    fun requestAssistance(
-        roomToken: String
-    ): Observable<RequestAssistanceModel>
+    fun requestAssistance(roomToken: String): Observable<RequestAssistanceModel>
 
 
-    fun withdrawRequestAssistance(
-        roomToken: String
-    ): Observable<WithdrawRequestAssistanceModel>
+    fun withdrawRequestAssistance(roomToken: String): Observable<WithdrawRequestAssistanceModel>
 }
 }

+ 2 - 6
app/src/main/java/com/nextcloud/talk/raisehand/RequestAssistanceRepositoryImpl.kt

@@ -57,18 +57,14 @@ class RequestAssistanceRepositoryImpl(private val ncApi: NcApi, currentUserProvi
         ).map { mapToWithdrawRequestAssistanceModel(it.ocs?.meta!!) }
         ).map { mapToWithdrawRequestAssistanceModel(it.ocs?.meta!!) }
     }
     }
 
 
-    private fun mapToRequestAssistanceModel(
-        response: GenericMeta
-    ): RequestAssistanceModel {
+    private fun mapToRequestAssistanceModel(response: GenericMeta): RequestAssistanceModel {
         val success = response.statusCode == HTTP_OK
         val success = response.statusCode == HTTP_OK
         return RequestAssistanceModel(
         return RequestAssistanceModel(
             success
             success
         )
         )
     }
     }
 
 
-    private fun mapToWithdrawRequestAssistanceModel(
-        response: GenericMeta
-    ): WithdrawRequestAssistanceModel {
+    private fun mapToWithdrawRequestAssistanceModel(response: GenericMeta): WithdrawRequestAssistanceModel {
         val success = response.statusCode == HTTP_OK
         val success = response.statusCode == HTTP_OK
         return WithdrawRequestAssistanceModel(
         return WithdrawRequestAssistanceModel(
             success
             success

+ 1 - 4
app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt

@@ -160,10 +160,7 @@ class RemoteFileBrowserActivity : AppCompatActivity(), SelectionInterface, Swipe
         }
         }
     }
     }
 
 
-    private fun loadList(
-        state: RemoteFileBrowserItemsViewModel.LoadedState,
-        mimeTypeSelectionFilter: String?
-    ) {
+    private fun loadList(state: RemoteFileBrowserItemsViewModel.LoadedState, mimeTypeSelectionFilter: String?) {
         val remoteFileBrowserItems = state.items
         val remoteFileBrowserItems = state.items
         Log.d(TAG, "Items received: $remoteFileBrowserItems")
         Log.d(TAG, "Items received: $remoteFileBrowserItems")
 
 

+ 2 - 6
app/src/main/java/com/nextcloud/talk/repositories/callrecording/CallRecordingRepository.kt

@@ -26,11 +26,7 @@ import io.reactivex.Observable
 
 
 interface CallRecordingRepository {
 interface CallRecordingRepository {
 
 
-    fun startRecording(
-        roomToken: String
-    ): Observable<StartCallRecordingModel>
+    fun startRecording(roomToken: String): Observable<StartCallRecordingModel>
 
 
-    fun stopRecording(
-        roomToken: String
-    ): Observable<StopCallRecordingModel>
+    fun stopRecording(roomToken: String): Observable<StopCallRecordingModel>
 }
 }

+ 4 - 12
app/src/main/java/com/nextcloud/talk/repositories/callrecording/CallRecordingRepositoryImpl.kt

@@ -37,9 +37,7 @@ class CallRecordingRepositoryImpl(private val ncApi: NcApi, currentUserProvider:
 
 
     var apiVersion = 1
     var apiVersion = 1
 
 
-    override fun startRecording(
-        roomToken: String
-    ): Observable<StartCallRecordingModel> {
+    override fun startRecording(roomToken: String): Observable<StartCallRecordingModel> {
         return ncApi.startRecording(
         return ncApi.startRecording(
             credentials,
             credentials,
             ApiUtils.getUrlForRecording(
             ApiUtils.getUrlForRecording(
@@ -51,9 +49,7 @@ class CallRecordingRepositoryImpl(private val ncApi: NcApi, currentUserProvider:
         ).map { mapToStartCallRecordingModel(it.ocs?.meta!!) }
         ).map { mapToStartCallRecordingModel(it.ocs?.meta!!) }
     }
     }
 
 
-    override fun stopRecording(
-        roomToken: String
-    ): Observable<StopCallRecordingModel> {
+    override fun stopRecording(roomToken: String): Observable<StopCallRecordingModel> {
         return ncApi.stopRecording(
         return ncApi.stopRecording(
             credentials,
             credentials,
             ApiUtils.getUrlForRecording(
             ApiUtils.getUrlForRecording(
@@ -64,18 +60,14 @@ class CallRecordingRepositoryImpl(private val ncApi: NcApi, currentUserProvider:
         ).map { mapToStopCallRecordingModel(it.ocs?.meta!!) }
         ).map { mapToStopCallRecordingModel(it.ocs?.meta!!) }
     }
     }
 
 
-    private fun mapToStartCallRecordingModel(
-        response: GenericMeta
-    ): StartCallRecordingModel {
+    private fun mapToStartCallRecordingModel(response: GenericMeta): StartCallRecordingModel {
         val success = response.statusCode == HTTP_OK
         val success = response.statusCode == HTTP_OK
         return StartCallRecordingModel(
         return StartCallRecordingModel(
             success
             success
         )
         )
     }
     }
 
 
-    private fun mapToStopCallRecordingModel(
-        response: GenericMeta
-    ): StopCallRecordingModel {
+    private fun mapToStopCallRecordingModel(response: GenericMeta): StopCallRecordingModel {
         val success = response.statusCode == HTTP_OK
         val success = response.statusCode == HTTP_OK
         return StopCallRecordingModel(
         return StopCallRecordingModel(
             success
             success

+ 2 - 10
app/src/main/java/com/nextcloud/talk/repositories/reactions/ReactionsRepository.kt

@@ -27,15 +27,7 @@ import io.reactivex.Observable
 
 
 interface ReactionsRepository {
 interface ReactionsRepository {
 
 
-    fun addReaction(
-        roomToken: String,
-        message: ChatMessage,
-        emoji: String
-    ): Observable<ReactionAddedModel>
+    fun addReaction(roomToken: String, message: ChatMessage, emoji: String): Observable<ReactionAddedModel>
 
 
-    fun deleteReaction(
-        roomToken: String,
-        message: ChatMessage,
-        emoji: String
-    ): Observable<ReactionDeletedModel>
+    fun deleteReaction(roomToken: String, message: ChatMessage, emoji: String): Observable<ReactionDeletedModel>
 }
 }

+ 1 - 5
app/src/main/java/com/nextcloud/talk/repositories/reactions/ReactionsRepositoryImpl.kt

@@ -36,11 +36,7 @@ class ReactionsRepositoryImpl(private val ncApi: NcApi, currentUserProvider: Cur
     val currentUser: User = currentUserProvider.currentUser.blockingGet()
     val currentUser: User = currentUserProvider.currentUser.blockingGet()
     val credentials: String = ApiUtils.getCredentials(currentUser.username, currentUser.token)
     val credentials: String = ApiUtils.getCredentials(currentUser.username, currentUser.token)
 
 
-    override fun addReaction(
-        roomToken: String,
-        message: ChatMessage,
-        emoji: String
-    ): Observable<ReactionAddedModel> {
+    override fun addReaction(roomToken: String, message: ChatMessage, emoji: String): Observable<ReactionAddedModel> {
         return ncApi.sendReaction(
         return ncApi.sendReaction(
             credentials,
             credentials,
             ApiUtils.getUrlForMessageReaction(
             ApiUtils.getUrlForMessageReaction(

+ 2 - 9
app/src/main/java/com/nextcloud/talk/shareditems/repositories/SharedItemsRepository.kt

@@ -28,16 +28,9 @@ import io.reactivex.Observable
 
 
 interface SharedItemsRepository {
 interface SharedItemsRepository {
 
 
-    fun media(
-        parameters: Parameters,
-        type: SharedItemType
-    ): Observable<SharedItems>?
+    fun media(parameters: Parameters, type: SharedItemType): Observable<SharedItems>?
 
 
-    fun media(
-        parameters: Parameters,
-        type: SharedItemType,
-        lastKnownMessageId: Int?
-    ): Observable<SharedItems>?
+    fun media(parameters: Parameters, type: SharedItemType, lastKnownMessageId: Int?): Observable<SharedItems>?
 
 
     fun availableTypes(parameters: Parameters): Observable<Set<SharedItemType>>
     fun availableTypes(parameters: Parameters): Observable<Set<SharedItemType>>
 
 

+ 1 - 4
app/src/main/java/com/nextcloud/talk/shareditems/repositories/SharedItemsRepositoryImpl.kt

@@ -48,10 +48,7 @@ import javax.inject.Inject
 class SharedItemsRepositoryImpl @Inject constructor(private val ncApi: NcApi, private val dateUtils: DateUtils) :
 class SharedItemsRepositoryImpl @Inject constructor(private val ncApi: NcApi, private val dateUtils: DateUtils) :
     SharedItemsRepository {
     SharedItemsRepository {
 
 
-    override fun media(
-        parameters: SharedItemsRepository.Parameters,
-        type: SharedItemType
-    ): Observable<SharedItems>? {
+    override fun media(parameters: SharedItemsRepository.Parameters, type: SharedItemType): Observable<SharedItems>? {
         return media(parameters, type, null)
         return media(parameters, type, null)
     }
     }
 
 

+ 1 - 4
app/src/main/java/com/nextcloud/talk/translate/repositories/TranslateRepository.kt

@@ -13,8 +13,5 @@ interface TranslateRepository {
         fromLanguage: String?
         fromLanguage: String?
     ): Observable<String>
     ): Observable<String>
 
 
-    fun getLanguages(
-        authorization: String,
-        url: String
-    ): Observable<List<Language>>
+    fun getLanguages(authorization: String, url: String): Observable<List<Language>>
 }
 }

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

@@ -299,14 +299,11 @@ class DateTimePickerFragment(
         private const val HOUR_SIX_PM = 18
         private const val HOUR_SIX_PM = 18
 
 
         @JvmStatic
         @JvmStatic
-        fun newInstance(
-            token: String,
-            id: String,
-            chatViewModel: ChatViewModel
-        ) = DateTimePickerFragment(
-            token,
-            id,
-            chatViewModel
-        )
+        fun newInstance(token: String, id: String, chatViewModel: ChatViewModel) =
+            DateTimePickerFragment(
+                token,
+                id,
+                chatViewModel
+            )
     }
     }
 }
 }

+ 1 - 5
app/src/main/java/com/nextcloud/talk/ui/dialog/FilterConversationFragment.kt

@@ -62,11 +62,7 @@ class FilterConversationFragment(
         return MaterialAlertDialogBuilder(requireContext()).setView(dialogView).create()
         return MaterialAlertDialogBuilder(requireContext()).setView(dialogView).create()
     }
     }
 
 
-    override fun onCreateView(
-        inflater: LayoutInflater,
-        container: ViewGroup?,
-        savedInstanceState: Bundle?
-    ): View? {
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
         NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
         NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
         setUpColors()
         setUpColors()
         setUpListeners()
         setUpListeners()

+ 1 - 3
app/src/main/java/com/nextcloud/talk/ui/dialog/SaveToStorageDialogFragment.kt

@@ -83,9 +83,7 @@ class SaveToStorageDialogFragment : DialogFragment() {
     }
     }
 
 
     @SuppressLint("LongLogTag")
     @SuppressLint("LongLogTag")
-    private fun saveImageToStorage(
-        fileName: String
-    ) {
+    private fun saveImageToStorage(fileName: String) {
         val sourceFilePath = requireContext().cacheDir.path
         val sourceFilePath = requireContext().cacheDir.path
         val workerTag = SAVE_TO_STORAGE_WORKER_PREFIX + fileName
         val workerTag = SAVE_TO_STORAGE_WORKER_PREFIX + fileName
 
 

+ 1 - 3
app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt

@@ -350,9 +350,7 @@ class SetStatusDialogFragment :
         return returnValue
         return returnValue
     }
     }
 
 
-    private fun clearAtToUnixTimeTypeEndOf(
-        clearAt: ClearAt
-    ): Long {
+    private fun clearAtToUnixTimeTypeEndOf(clearAt: ClearAt): Long {
         var returnValue = -1L
         var returnValue = -1L
         if (clearAt.time == "day") {
         if (clearAt.time == "day") {
             val date = Calendar.getInstance().apply {
             val date = Calendar.getInstance().apply {

+ 2 - 10
app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt

@@ -295,11 +295,7 @@ class TalkSpecificViewThemeUtils @Inject constructor(
         }
         }
     }
     }
 
 
-    fun themeAndHighlightText(
-        textView: TextView,
-        originalText: String?,
-        c: String?
-    ) {
+    fun themeAndHighlightText(textView: TextView, originalText: String?, c: String?) {
         withScheme(textView) { scheme ->
         withScheme(textView) { scheme ->
             var constraint = c
             var constraint = c
             constraint = FlexibleUtils.toLowerCase(constraint)
             constraint = FlexibleUtils.toLowerCase(constraint)
@@ -374,11 +370,7 @@ class TalkSpecificViewThemeUtils @Inject constructor(
         }
         }
     }
     }
 
 
-    fun getTextColor(
-        isOutgoingMessage: Boolean,
-        isSelfReaction: Boolean,
-        binding: ReactionsInsideMessageBinding
-    ): Int {
+    fun getTextColor(isOutgoingMessage: Boolean, isSelfReaction: Boolean, binding: ReactionsInsideMessageBinding): Int {
         return withScheme(binding.root) { scheme ->
         return withScheme(binding.root) { scheme ->
             return@withScheme if (!isOutgoingMessage || isSelfReaction) {
             return@withScheme if (!isOutgoingMessage || isSelfReaction) {
                 ContextCompat.getColor(binding.root.context, R.color.high_emphasis_text)
                 ContextCompat.getColor(binding.root.context, R.color.high_emphasis_text)

+ 2 - 9
app/src/main/java/com/nextcloud/talk/upload/chunked/ChunkedFileUploader.kt

@@ -83,11 +83,7 @@ class ChunkedFileUploader(
     }
     }
 
 
     @Suppress("Detekt.TooGenericExceptionCaught")
     @Suppress("Detekt.TooGenericExceptionCaught")
-    fun upload(
-        localFile: File,
-        mimeType: MediaType?,
-        targetPath: String
-    ): Boolean {
+    fun upload(localFile: File, mimeType: MediaType?, targetPath: String): Boolean {
         try {
         try {
             val uploadFolderUri: String = remoteChunkUrl + "/" + FileUtils.md5Sum(localFile)
             val uploadFolderUri: String = remoteChunkUrl + "/" + FileUtils.md5Sum(localFile)
             val davResource = DavResource(
             val davResource = DavResource(
@@ -137,10 +133,7 @@ class ChunkedFileUploader(
     }
     }
 
 
     @Suppress("Detekt.ComplexMethod")
     @Suppress("Detekt.ComplexMethod")
-    private fun getUploadedChunks(
-        davResource: DavResource,
-        uploadFolderUri: String
-    ): MutableList<Chunk> {
+    private fun getUploadedChunks(davResource: DavResource, uploadFolderUri: String): MutableList<Chunk> {
         val davResponse = DavResponse()
         val davResponse = DavResponse()
         val memberElements: MutableList<at.bitfire.dav4jvm.Response> = ArrayList()
         val memberElements: MutableList<at.bitfire.dav4jvm.Response> = ArrayList()
         val rootElement = arrayOfNulls<at.bitfire.dav4jvm.Response>(1)
         val rootElement = arrayOfNulls<at.bitfire.dav4jvm.Response>(1)

+ 1 - 3
app/src/main/java/com/nextcloud/talk/upload/chunked/OnDataTransferProgressListener.kt

@@ -25,7 +25,5 @@
 package com.nextcloud.talk.upload.chunked
 package com.nextcloud.talk.upload.chunked
 
 
 interface OnDataTransferProgressListener {
 interface OnDataTransferProgressListener {
-    fun onTransferProgress(
-        percentage: Int
-    )
+    fun onTransferProgress(percentage: Int)
 }
 }

+ 1 - 6
app/src/main/java/com/nextcloud/talk/upload/normal/FileUploader.kt

@@ -21,12 +21,7 @@ class FileUploader(
     val roomToken: String,
     val roomToken: String,
     val ncApi: NcApi
     val ncApi: NcApi
 ) {
 ) {
-    fun upload(
-        sourceFileUri: Uri,
-        fileName: String,
-        remotePath: String,
-        metaData: String?
-    ): Observable<Boolean> {
+    fun upload(sourceFileUri: Uri, fileName: String, remotePath: String, metaData: String?): Observable<Boolean> {
         return ncApi.uploadFile(
         return ncApi.uploadFile(
             ApiUtils.getCredentials(currentUser.username, currentUser.token),
             ApiUtils.getCredentials(currentUser.username, currentUser.token),
             ApiUtils.getUrlForFileUpload(currentUser.baseUrl, currentUser.userId, remotePath),
             ApiUtils.getUrlForFileUpload(currentUser.baseUrl, currentUser.userId, remotePath),

+ 3 - 15
app/src/main/java/com/nextcloud/talk/utils/BitmapShrinker.kt

@@ -35,21 +35,13 @@ object BitmapShrinker {
     private const val DEGREES_270 = 270f
     private const val DEGREES_270 = 270f
 
 
     @JvmStatic
     @JvmStatic
-    fun shrinkBitmap(
-        path: String,
-        reqWidth: Int,
-        reqHeight: Int
-    ): Bitmap {
+    fun shrinkBitmap(path: String, reqWidth: Int, reqHeight: Int): Bitmap {
         val bitmap = decodeBitmap(path, reqWidth, reqHeight)
         val bitmap = decodeBitmap(path, reqWidth, reqHeight)
         return rotateBitmap(path, bitmap)
         return rotateBitmap(path, bitmap)
     }
     }
 
 
     // solution inspired by https://developer.android.com/topic/performance/graphics/load-bitmap
     // solution inspired by https://developer.android.com/topic/performance/graphics/load-bitmap
-    private fun decodeBitmap(
-        path: String,
-        requestedWidth: Int,
-        requestedHeight: Int
-    ): Bitmap {
+    private fun decodeBitmap(path: String, requestedWidth: Int, requestedHeight: Int): Bitmap {
         return BitmapFactory.Options().run {
         return BitmapFactory.Options().run {
             inJustDecodeBounds = true
             inJustDecodeBounds = true
             BitmapFactory.decodeFile(path, this)
             BitmapFactory.decodeFile(path, this)
@@ -60,11 +52,7 @@ object BitmapShrinker {
     }
     }
 
 
     // solution inspired by https://developer.android.com/topic/performance/graphics/load-bitmap
     // solution inspired by https://developer.android.com/topic/performance/graphics/load-bitmap
-    private fun getInSampleSize(
-        options: BitmapFactory.Options,
-        requestedWidth: Int,
-        requestedHeight: Int
-    ): Int {
+    private fun getInSampleSize(options: BitmapFactory.Options, requestedWidth: Int, requestedHeight: Int): Int {
         val (height: Int, width: Int) = options.run { outHeight to outWidth }
         val (height: Int, width: Int) = options.run { outHeight to outWidth }
         var inSampleSize = 1
         var inSampleSize = 1
         if (height > requestedHeight || width > requestedWidth) {
         if (height > requestedHeight || width > requestedWidth) {

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

@@ -73,10 +73,7 @@ import java.util.concurrent.ExecutionException
  */
  */
 class FileViewerUtils(private val context: Context, private val user: User) {
 class FileViewerUtils(private val context: Context, private val user: User) {
 
 
-    fun openFile(
-        message: ChatMessage,
-        progressUi: ProgressUi
-    ) {
+    fun openFile(message: ChatMessage, progressUi: ProgressUi) {
         val fileName = message.selectedIndividualHashMap!![PreviewMessageViewHolder.KEY_NAME]!!
         val fileName = message.selectedIndividualHashMap!![PreviewMessageViewHolder.KEY_NAME]!!
         val mimetype = message.selectedIndividualHashMap!![PreviewMessageViewHolder.KEY_MIMETYPE]!!
         val mimetype = message.selectedIndividualHashMap!![PreviewMessageViewHolder.KEY_MIMETYPE]!!
         val link = message.selectedIndividualHashMap!!["link"]!!
         val link = message.selectedIndividualHashMap!!["link"]!!

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

@@ -102,10 +102,7 @@ object NotificationUtils {
         }
         }
     }
     }
 
 
-    private fun createCallsNotificationChannel(
-        context: Context,
-        appPreferences: AppPreferences
-    ) {
+    private fun createCallsNotificationChannel(context: Context, appPreferences: AppPreferences) {
         val audioAttributes =
         val audioAttributes =
             AudioAttributes.Builder()
             AudioAttributes.Builder()
                 .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
                 .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
@@ -126,10 +123,7 @@ object NotificationUtils {
         )
         )
     }
     }
 
 
-    private fun createMessagesNotificationChannel(
-        context: Context,
-        appPreferences: AppPreferences
-    ) {
+    private fun createMessagesNotificationChannel(context: Context, appPreferences: AppPreferences) {
         val audioAttributes =
         val audioAttributes =
             AudioAttributes.Builder()
             AudioAttributes.Builder()
                 .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
                 .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
@@ -150,9 +144,7 @@ object NotificationUtils {
         )
         )
     }
     }
 
 
-    private fun createUploadsNotificationChannel(
-        context: Context
-    ) {
+    private fun createUploadsNotificationChannel(context: Context) {
         createNotificationChannel(
         createNotificationChannel(
             context,
             context,
             Channel(
             Channel(
@@ -166,10 +158,7 @@ object NotificationUtils {
         )
         )
     }
     }
 
 
-    fun registerNotificationChannels(
-        context: Context,
-        appPreferences: AppPreferences
-    ) {
+    fun registerNotificationChannels(context: Context, appPreferences: AppPreferences) {
         createCallsNotificationChannel(context, appPreferences)
         createCallsNotificationChannel(context, appPreferences)
         createMessagesNotificationChannel(context, appPreferences)
         createMessagesNotificationChannel(context, appPreferences)
         createUploadsNotificationChannel(context)
         createUploadsNotificationChannel(context)
@@ -197,10 +186,7 @@ object NotificationUtils {
     }
     }
 
 
     @TargetApi(Build.VERSION_CODES.O)
     @TargetApi(Build.VERSION_CODES.O)
-    private fun getNotificationChannel(
-        context: Context,
-        channelId: String
-    ): NotificationChannel? {
+    private fun getNotificationChannel(context: Context, channelId: String): NotificationChannel? {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
             val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
             val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
             return notificationManager.getNotificationChannel(channelId)
             return notificationManager.getNotificationChannel(channelId)
@@ -275,10 +261,7 @@ object NotificationUtils {
         }
         }
     }
     }
 
 
-    fun isNotificationVisible(
-        context: Context?,
-        notificationId: Int
-    ): Boolean {
+    fun isNotificationVisible(context: Context?, notificationId: Int): Boolean {
         var isVisible = false
         var isVisible = false
 
 
         val notificationManager = context!!.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
         val notificationManager = context!!.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
@@ -319,10 +302,7 @@ object NotificationUtils {
         }
         }
     }
     }
 
 
-    fun getCallRingtoneUri(
-        context: Context,
-        appPreferences: AppPreferences
-    ): Uri? {
+    fun getCallRingtoneUri(context: Context, appPreferences: AppPreferences): Uri? {
         return getRingtoneUri(
         return getRingtoneUri(
             context,
             context,
             appPreferences.callRingtoneUri,
             appPreferences.callRingtoneUri,
@@ -331,10 +311,7 @@ object NotificationUtils {
         )
         )
     }
     }
 
 
-    fun getMessageRingtoneUri(
-        context: Context,
-        appPreferences: AppPreferences
-    ): Uri? {
+    fun getMessageRingtoneUri(context: Context, appPreferences: AppPreferences): Uri? {
         return getRingtoneUri(
         return getRingtoneUri(
             context,
             context,
             appPreferences.messageRingtoneUri,
             appPreferences.messageRingtoneUri,

+ 3 - 15
app/src/main/java/com/nextcloud/talk/utils/RemoteFileUtils.kt

@@ -31,11 +31,7 @@ import io.reactivex.schedulers.Schedulers
 object RemoteFileUtils {
 object RemoteFileUtils {
     private val TAG = RemoteFileUtils::class.java.simpleName
     private val TAG = RemoteFileUtils::class.java.simpleName
 
 
-    fun getNewPathIfFileExists(
-        ncApi: NcApi,
-        currentUser: User,
-        remotePath: String
-    ): String {
+    fun getNewPathIfFileExists(ncApi: NcApi, currentUser: User, remotePath: String): String {
         var finalPath = remotePath
         var finalPath = remotePath
         val fileExists = doesFileExist(
         val fileExists = doesFileExist(
             ncApi,
             ncApi,
@@ -53,11 +49,7 @@ object RemoteFileUtils {
         return finalPath
         return finalPath
     }
     }
 
 
-    private fun doesFileExist(
-        ncApi: NcApi,
-        currentUser: User,
-        remotePath: String
-    ): Observable<Boolean> {
+    private fun doesFileExist(ncApi: NcApi, currentUser: User, remotePath: String): Observable<Boolean> {
         return ncApi.checkIfFileExists(
         return ncApi.checkIfFileExists(
             ApiUtils.getCredentials(currentUser.username, currentUser.token),
             ApiUtils.getCredentials(currentUser.username, currentUser.token),
             ApiUtils.getUrlForFileUpload(
             ApiUtils.getUrlForFileUpload(
@@ -72,11 +64,7 @@ object RemoteFileUtils {
             }
             }
     }
     }
 
 
-    private fun getFileNameWithoutCollision(
-        ncApi: NcApi,
-        currentUser: User,
-        remotePath: String
-    ): String {
+    private fun getFileNameWithoutCollision(ncApi: NcApi, currentUser: User, remotePath: String): String {
         val extPos = remotePath.lastIndexOf('.')
         val extPos = remotePath.lastIndexOf('.')
         var suffix: String
         var suffix: String
         var extension = ""
         var extension = ""

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

@@ -25,11 +25,7 @@ import com.nextcloud.talk.data.user.model.User
 import com.nextcloud.talk.models.json.conversations.Conversation
 import com.nextcloud.talk.models.json.conversations.Conversation
 
 
 object ShareUtils {
 object ShareUtils {
-    fun getStringForIntent(
-        context: Context,
-        user: User,
-        conversation: Conversation?
-    ): String {
+    fun getStringForIntent(context: Context, user: User, conversation: Conversation?): String {
         return String.format(
         return String.format(
             context.resources.getString(R.string.nc_share_text),
             context.resources.getString(R.string.nc_share_text),
             user.baseUrl,
             user.baseUrl,

+ 1 - 7
app/src/main/java/third/parties/fresco/BetterImageSpan.kt

@@ -65,13 +65,7 @@ open class BetterImageSpan @JvmOverloads constructor(
     /**
     /**
      * Returns the width of the image span and increases the height if font metrics are available.
      * Returns the width of the image span and increases the height if font metrics are available.
      */
      */
-    override fun getSize(
-        paint: Paint,
-        text: CharSequence,
-        start: Int,
-        end: Int,
-        fontMetrics: FontMetricsInt?
-    ): Int {
+    override fun getSize(paint: Paint, text: CharSequence, start: Int, end: Int, fontMetrics: FontMetricsInt?): Int {
         updateBounds()
         updateBounds()
         if (fontMetrics == null) {
         if (fontMetrics == null) {
             return mWidth
             return mWidth