Skip to content

Commit

Permalink
Fix code formatting for kotlin files
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
  • Loading branch information
AndyScherzinger committed Sep 21, 2023
1 parent 4b63165 commit b9f94ca
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -37,8 +36,4 @@ class ArbitraryStorageManager(private val arbitraryStoragesRepository: Arbitrary
fun deleteAllEntriesForAccountIdentifier(accountIdentifier: Long): Int {
return arbitraryStoragesRepository.deleteArbitraryStorage(accountIdentifier)
}

fun getAll() : Maybe<List<ArbitraryStorageEntity>> {
return arbitraryStoragesRepository.getAll()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -161,7 +159,7 @@ class ConversationsListActivity :

@Inject
lateinit var platformPermissionUtil: PlatformPermissionUtil

@Inject
lateinit var arbitraryStorageManager: ArbitraryStorageManager

Expand Down Expand Up @@ -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<AbstractFlexibleItem<*>> = 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ abstract class ArbitraryStoragesDao {
objectString: String
): Maybe<ArbitraryStorageEntity>


@Query(
"SELECT * FROM ArbitraryStorage"
)
abstract fun getAll() : Maybe<List<ArbitraryStorageEntity>>
abstract fun getAll(): Maybe<List<ArbitraryStorageEntity>>

@Query("DELETE FROM ArbitraryStorage WHERE accountIdentifier = :accountIdentifier")
abstract fun deleteArbitraryStorage(accountIdentifier: Long): Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
}

Expand Down

0 comments on commit b9f94ca

Please sign in to comment.