From b9f94ca829a09e44d2c16777d1b58b8e635ab5ca Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 21 Sep 2023 23:06:56 +0200 Subject: [PATCH] Fix code formatting for kotlin files Signed-off-by: Andy Scherzinger --- .../ArbitraryStorageManager.kt | 5 --- .../ConversationsListActivity.kt | 37 ++++++++++--------- .../talk/data/source/local/TalkDatabase.kt | 1 - .../talk/data/storage/ArbitraryStoragesDao.kt | 3 +- .../storage/model/ArbitraryStorageEntity.kt | 1 - .../ui/dialog/FilterConversationFragment.kt | 5 +-- 6 files changed, 23 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/arbitrarystorage/ArbitraryStorageManager.kt b/app/src/main/java/com/nextcloud/talk/arbitrarystorage/ArbitraryStorageManager.kt index 1ca21c09471..27c2550e0ea 100644 --- a/app/src/main/java/com/nextcloud/talk/arbitrarystorage/ArbitraryStorageManager.kt +++ b/app/src/main/java/com/nextcloud/talk/arbitrarystorage/ArbitraryStorageManager.kt @@ -22,7 +22,6 @@ package com.nextcloud.talk.arbitrarystorage import com.nextcloud.talk.data.storage.ArbitraryStoragesRepository import com.nextcloud.talk.data.storage.model.ArbitraryStorage -import com.nextcloud.talk.data.storage.model.ArbitraryStorageEntity import io.reactivex.Maybe class ArbitraryStorageManager(private val arbitraryStoragesRepository: ArbitraryStoragesRepository) { @@ -37,8 +36,4 @@ class ArbitraryStorageManager(private val arbitraryStoragesRepository: Arbitrary fun deleteAllEntriesForAccountIdentifier(accountIdentifier: Long): Int { return arbitraryStoragesRepository.deleteArbitraryStorage(accountIdentifier) } - - fun getAll() : Maybe> { - return arbitraryStoragesRepository.getAll() - } } diff --git a/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt index 090466e402c..082af2eaa61 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt @@ -82,7 +82,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.arbitrarystorage.ArbitraryStorageManager import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.contacts.ContactsActivity -import com.nextcloud.talk.data.storage.model.ArbitraryStorage import com.nextcloud.talk.data.user.model.User import com.nextcloud.talk.databinding.ControllerConversationsRvBinding import com.nextcloud.talk.events.ConversationsListFetchDataEvent @@ -123,7 +122,6 @@ import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew.isServerEOL import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew.isUnifiedSearchAvailable import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew.isUserStatusAvailable import com.nextcloud.talk.utils.permissions.PlatformPermissionUtil -import com.nextcloud.talk.utils.preferences.AppPreferences import com.nextcloud.talk.utils.rx.SearchViewObservable.Companion.observeSearchView import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder import eu.davidea.flexibleadapter.FlexibleAdapter @@ -161,7 +159,7 @@ class ConversationsListActivity : @Inject lateinit var platformPermissionUtil: PlatformPermissionUtil - + @Inject lateinit var arbitraryStorageManager: ArbitraryStorageManager @@ -281,21 +279,26 @@ class ConversationsListActivity : } fun filterConversation() { val accountId = UserIdUtils.getIdForUser(userManager.currentUser.blockingGet()) - filterState[FilterConversationFragment.UNREAD] = (arbitraryStorageManager.getStorageSetting( - accountId, - FilterConversationFragment.UNREAD, - "" - ).blockingGet()?.value ?: "") == "true" - - filterState[FilterConversationFragment.MENTION] = (arbitraryStorageManager.getStorageSetting( - accountId, - FilterConversationFragment.MENTION, - "" - ).blockingGet()?.value ?: "") == "true" - + filterState[FilterConversationFragment.UNREAD] = ( + arbitraryStorageManager.getStorageSetting( + accountId, + FilterConversationFragment.UNREAD, + "" + ).blockingGet()?.value ?: "" + ) == "true" + + filterState[FilterConversationFragment.MENTION] = ( + arbitraryStorageManager.getStorageSetting( + accountId, + FilterConversationFragment.MENTION, + "" + ).blockingGet()?.value ?: "" + ) == "true" + val newItems: MutableList> = ArrayList() - if (filterState[FilterConversationFragment.UNREAD] == false && - filterState[FilterConversationFragment.MENTION] == false) { + if (filterState[FilterConversationFragment.UNREAD] == false && + filterState[FilterConversationFragment.MENTION] == false + ) { adapter!!.updateDataSet(conversationItems, true) } else { val items = conversationItems diff --git a/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt b/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt index 63d28775135..4db51a3e736 100644 --- a/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt +++ b/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt @@ -22,7 +22,6 @@ package com.nextcloud.talk.data.source.local import android.content.Context import android.util.Log -import androidx.room.AutoMigration import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase diff --git a/app/src/main/java/com/nextcloud/talk/data/storage/ArbitraryStoragesDao.kt b/app/src/main/java/com/nextcloud/talk/data/storage/ArbitraryStoragesDao.kt index 9e728cf35bd..0941b6f9af3 100644 --- a/app/src/main/java/com/nextcloud/talk/data/storage/ArbitraryStoragesDao.kt +++ b/app/src/main/java/com/nextcloud/talk/data/storage/ArbitraryStoragesDao.kt @@ -41,11 +41,10 @@ abstract class ArbitraryStoragesDao { objectString: String ): Maybe - @Query( "SELECT * FROM ArbitraryStorage" ) - abstract fun getAll() : Maybe> + abstract fun getAll(): Maybe> @Query("DELETE FROM ArbitraryStorage WHERE accountIdentifier = :accountIdentifier") abstract fun deleteArbitraryStorage(accountIdentifier: Long): Int diff --git a/app/src/main/java/com/nextcloud/talk/data/storage/model/ArbitraryStorageEntity.kt b/app/src/main/java/com/nextcloud/talk/data/storage/model/ArbitraryStorageEntity.kt index 6f09eb81817..ab5f7dc6261 100644 --- a/app/src/main/java/com/nextcloud/talk/data/storage/model/ArbitraryStorageEntity.kt +++ b/app/src/main/java/com/nextcloud/talk/data/storage/model/ArbitraryStorageEntity.kt @@ -23,7 +23,6 @@ package com.nextcloud.talk.data.storage.model import android.os.Parcelable import androidx.room.ColumnInfo import androidx.room.Entity -import androidx.room.PrimaryKey import kotlinx.parcelize.Parcelize @Parcelize diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/FilterConversationFragment.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/FilterConversationFragment.kt index 062116aa8e7..e14783aa750 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/FilterConversationFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/FilterConversationFragment.kt @@ -35,7 +35,6 @@ import com.nextcloud.talk.databinding.DialogFilterConversationBinding import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.users.UserManager import com.nextcloud.talk.utils.UserIdUtils -import com.nextcloud.talk.utils.preferences.AppPreferences import javax.inject.Inject @AutoInjector(NextcloudTalkApplication::class) @@ -121,10 +120,10 @@ class FilterConversationFragment( val accountId = UserIdUtils.getIdForUser(userManager.currentUser.blockingGet()) val mentionValue = filterState[MENTION] == true val unreadValue = filterState[UNREAD] == true - + arbitraryStorageManager.storeStorageSetting(accountId, MENTION, mentionValue.toString(), "") arbitraryStorageManager.storeStorageSetting(accountId, UNREAD, unreadValue.toString(), "") - + conversationsList.filterConversation() }