Change selectedItemBackgroundColorId for dark mode

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-12-14 13:43:01 +01:00
parent 76bfefb491
commit e176059406
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -295,8 +295,15 @@ class OCFileListDelegate(
private fun setItemLayoutBackgroundColor(file: OCFile, gridViewHolder: ListGridImageViewHolder) {
val cornerRadius = context.resources.getDimension(R.dimen.selected_grid_container_radius)
val itemLayoutBackgroundColorId: Int = if (file.fileId == highlightedItem?.fileId || isCheckedFile(file)) {
val isDarkModeActive = (syncFolderProvider?.preferences?.isDarkModeEnabled == true)
val selectedItemBackgroundColorId: Int = if (isDarkModeActive) {
R.color.action_mode_background
} else {
R.color.selected_item_background
}
val itemLayoutBackgroundColorId: Int = if (file.fileId == highlightedItem?.fileId || isCheckedFile(file)) {
selectedItemBackgroundColorId
} else {
R.color.bg_default
}