فهرست منبع

Change selectedItemBackgroundColorId for dark mode

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 سال پیش
والد
کامیت
e176059406
1فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 8 1
      app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt

+ 8 - 1
app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt

@@ -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
         }