Browse Source

further improve formatting

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 1 year ago
parent
commit
984c8bff5c

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

@@ -244,13 +244,14 @@ class ConversationItem(
             } else {
                 model.lastMessage!!.activeUser = user
 
-                val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType
-                        .REGULAR_TEXT_MESSAGE
-                ) {
-                    calculateRegularLastMessageText(appContext)
-                } else {
-                    model.lastMessage!!.lastMessageDisplayText
-                }
+                val text =
+                    if (
+                        model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType.REGULAR_TEXT_MESSAGE
+                    ) {
+                        calculateRegularLastMessageText(appContext)
+                    } else {
+                        model.lastMessage!!.lastMessageDisplayText
+                    }
                 holder.binding.dialogLastMessage.text = text
             }
         } else {

+ 7 - 7
app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.kt

@@ -79,10 +79,12 @@ import javax.inject.Inject
 
 @AutoInjector(NextcloudTalkApplication::class)
 class AccountVerificationController(args: Bundle? = null) : BaseController(
-    R.layout.controller_account_verification, args
+    R.layout.controller_account_verification,
+    args
 ) {
-    private val binding: ControllerAccountVerificationBinding? by
-        viewBinding(ControllerAccountVerificationBinding::bind)
+    private val binding: ControllerAccountVerificationBinding? by viewBinding(
+        ControllerAccountVerificationBinding::bind
+    )
 
     @Inject
     lateinit var ncApi: NcApi
@@ -289,10 +291,8 @@ class AccountVerificationController(args: Bundle? = null) : BaseController(
 
                 @SuppressLint("SetTextI18n")
                 override fun onError(e: Throwable) {
-                    binding?.progressText?.text =
-                        """ ${binding?.progressText?.text}
-                        """
-                            .trimIndent() + resources!!.getString(R.string.nc_display_name_not_stored)
+                    binding?.progressText?.text = """ ${binding?.progressText?.text}""".trimIndent() +
+                        resources!!.getString(R.string.nc_display_name_not_stored)
                     abortVerification()
                 }
 

+ 13 - 27
app/src/main/java/com/nextcloud/talk/jobs/ContactAddressBookWorker.kt

@@ -451,40 +451,26 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
         const val DELETE_ALL = "DELETE_ALL"
 
         fun run(context: Context) {
-            if (ContextCompat.checkSelfPermission(
-                    context,
-                    Manifest.permission.WRITE_CONTACTS
-                ) == PackageManager.PERMISSION_GRANTED &&
-                ContextCompat.checkSelfPermission(
-                    context,
-                    Manifest.permission.READ_CONTACTS
-                ) == PackageManager.PERMISSION_GRANTED
+            if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) ==
+                PackageManager.PERMISSION_GRANTED &&
+                ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) ==
+                PackageManager.PERMISSION_GRANTED
             ) {
-                WorkManager
-                    .getInstance()
-                    .enqueue(
-                        OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java)
-                            .setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build())
-                            .build()
-                    )
+                WorkManager.getInstance().enqueue(
+                    OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java)
+                        .setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build()).build()
+                )
             }
         }
 
         fun checkPermission(activity: Activity, context: Context): Boolean {
-            if (ContextCompat.checkSelfPermission(
-                    context,
-                    Manifest.permission.WRITE_CONTACTS
-                ) != PackageManager.PERMISSION_GRANTED ||
-                ContextCompat.checkSelfPermission(
-                    context,
-                    Manifest.permission.READ_CONTACTS
-                ) != PackageManager.PERMISSION_GRANTED
+            if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) !=
+                PackageManager.PERMISSION_GRANTED ||
+                ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) !=
+                PackageManager.PERMISSION_GRANTED
             ) {
                 activity.requestPermissions(
-                    arrayOf(
-                        Manifest.permission.WRITE_CONTACTS,
-                        Manifest.permission.READ_CONTACTS
-                    ),
+                    arrayOf(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS),
                     REQUEST_PERMISSION
                 )
                 return false

+ 9 - 1
app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.kt

@@ -37,7 +37,15 @@ data class SpreedCapability(
     @JsonField(name = ["features"])
     var features: List<String>?,
     @JsonField(name = ["config"])
-    var config: HashMap<String, HashMap<String, @RawValue @Contextual Any>>?
+    var config: HashMap<
+        String,
+        HashMap<
+            String,
+            @RawValue
+            @Contextual
+            Any
+            >
+        >?
 ) : Parcelable {
     // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
     constructor() : this(null, null)

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

@@ -298,7 +298,8 @@ class ProfileActivity : BaseActivity() {
         }
         binding.loadingContent.visibility = View.VISIBLE
         adapter!!.setData(createUserInfoDetails(userInfo))
-        if (isAllEmpty(
+        if (
+            isAllEmpty(
                 arrayOf(
                     userInfo?.displayName,
                     userInfo?.phone,