Skip to content

Commit

Permalink
Apply some tiny suggestions from CR
Browse files Browse the repository at this point in the history
  • Loading branch information
abelgardep committed Aug 16, 2022
1 parent 6d42bf9 commit 018ba1f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.owncloud.android.R
import com.owncloud.android.data.preferences.datasources.SharedPreferencesProvider
import com.owncloud.android.data.preferences.datasources.implementation.SharedPreferencesProviderImpl
import com.owncloud.android.databinding.SortOptionsLayoutBinding
import com.owncloud.android.presentation.ui.files.SortOrder.Companion.PREF_FILE_LIST_SORT_ORDER
Expand Down Expand Up @@ -69,7 +70,7 @@ class SortOptionsView @JvmOverloads constructor(
init {
_binding = SortOptionsLayoutBinding.inflate(LayoutInflater.from(context), this, true)

val sharedPreferencesProvider = SharedPreferencesProviderImpl(context)
val sharedPreferencesProvider: SharedPreferencesProvider = SharedPreferencesProviderImpl(context)

// Select sort type and order according to preferences.
sortTypeSelected = SortType.values()[sharedPreferencesProvider.getInt(PREF_FILE_LIST_SORT_TYPE, SortType.SORT_TYPE_BY_NAME.ordinal)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class MainFileListViewModel(

init {
val sortTypeSelected = SortType.values()[sharedPreferencesProvider.getInt(PREF_FILE_LIST_SORT_TYPE, SortType.SORT_TYPE_BY_NAME.ordinal)]
val sortOrderSelected = SortOrder.values()[sharedPreferencesProvider.getInt(PREF_FILE_LIST_SORT_ORDER, SortOrder.SORT_ORDER_ASCENDING.ordinal)]
val sortOrderSelected =
SortOrder.values()[sharedPreferencesProvider.getInt(PREF_FILE_LIST_SORT_ORDER, SortOrder.SORT_ORDER_ASCENDING.ordinal)]
sortTypeAndOrder.update { Pair(sortTypeSelected, sortOrderSelected) }
}

Expand Down Expand Up @@ -193,7 +194,8 @@ class MainFileListViewModel(
// Browsing to parent folder. Root
val rootFolderForAccountResult = getFileByRemotePathUseCase.execute(
GetFileByRemotePathUseCase.Params(
remotePath = ROOT_PATH, owner = currentFolder.owner
remotePath = ROOT_PATH,
owner = currentFolder.owner,
)
)
parentDir = rootFolderForAccountResult.getDataOrNull()
Expand All @@ -206,7 +208,7 @@ class MainFileListViewModel(
if (fileListOption.value.isAllFiles()) {
refreshFolder(
ocFolder = parentDir,
isPickingAFolder = false
isPickingAFolder = false,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ownCloud Android client application
*
* @author Fernando Sanz Velasco
* Copyright (C) 2021 ownCloud GmbH.
* Copyright (C) 2022 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down

0 comments on commit 018ba1f

Please sign in to comment.