Skip to content

Commit

Permalink
Updated app icons for dark and light mode as per MC customization.
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed Dec 10, 2024
1 parent 329f113 commit 422bd8f
Show file tree
Hide file tree
Showing 96 changed files with 1,411 additions and 553 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,62 +26,63 @@ class OCFileIconTests {
@Test
fun testGetFileOverlayIconWhenFileIsAutoUploadFolderShouldReturnFolderOverlayUploadIcon() {
val fileOverlayIcon = sut?.getFileOverlayIconId(true)
val expectedDrawable = R.drawable.ic_folder_overlay_upload
val expectedDrawable = R.drawable.folder_auto_upload
assert(fileOverlayIcon == expectedDrawable)
}

@Test
fun testGetFileOverlayIconWhenFileIsEncryptedShouldReturnFolderOverlayKeyIcon() {
sut?.isEncrypted = true
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
val expectedDrawable = R.drawable.ic_folder_overlay_key
val expectedDrawable = R.drawable.folder_encrypted
assert(fileOverlayIcon == expectedDrawable)
}

@Test
fun testGetFileOverlayIconWhenFileIsGroupFolderShouldReturnFolderOverlayAccountGroupIcon() {
sut?.mountType = MountType.GROUP
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
val expectedDrawable = R.drawable.ic_folder_overlay_account_group
val expectedDrawable = R.drawable.folder_shared_users
assert(fileOverlayIcon == expectedDrawable)
}

@Test
fun testGetFileOverlayIconWhenFileIsSharedViaLinkShouldReturnFolderOverlayLinkIcon() {
sut?.isSharedViaLink = true
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
val expectedDrawable = R.drawable.ic_folder_overlay_link
val expectedDrawable = R.drawable.folder_shared_users
assert(fileOverlayIcon == expectedDrawable)
}

@Test
fun testGetFileOverlayIconWhenFileIsSharedShouldReturnFolderOverlayShareIcon() {
sut?.isSharedWithSharee = true
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
val expectedDrawable = R.drawable.ic_folder_overlay_share
val expectedDrawable = R.drawable.folder_shared_users
assert(fileOverlayIcon == expectedDrawable)
}

@Test
fun testGetFileOverlayIconWhenFileIsExternalShouldReturnFolderOverlayExternalIcon() {
sut?.mountType = MountType.EXTERNAL
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
val expectedDrawable = R.drawable.ic_folder_overlay_external
val expectedDrawable = R.drawable.folder
assert(fileOverlayIcon == expectedDrawable)
}

@Test
fun testGetFileOverlayIconWhenFileIsLockedShouldReturnFolderOverlayLockIcon() {
sut?.isLocked = true
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
val expectedDrawable = R.drawable.ic_folder_overlay_lock
val expectedDrawable = R.drawable.folder_encrypted
assert(fileOverlayIcon == expectedDrawable)
}

@Test
fun testGetFileOverlayIconWhenFileIsFolderShouldReturnNull() {
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
assert(fileOverlayIcon == null)
val expectedDrawable = R.drawable.folder
assert(fileOverlayIcon == expectedDrawable)
}

@After
Expand Down
18 changes: 10 additions & 8 deletions app/src/main/java/com/owncloud/android/datamodel/OCFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -662,23 +662,25 @@ public boolean isGroupFolder() {
return permissions != null && permissions.contains(PERMISSION_GROUPFOLDER);
}

// NMC Customization: We are not using any overlay icons for normal folders
// we have different folder icons with inbuilt overlay
public Integer getFileOverlayIconId(boolean isAutoUploadFolder) {
if (WebdavEntry.MountType.GROUP == mountType || isGroupFolder()) {
return R.drawable.ic_folder_overlay_account_group;
return R.drawable.folder_shared_users;
} else if (sharedViaLink && !encrypted) {
return R.drawable.ic_folder_overlay_link;
return R.drawable.folder_shared_users;
} else if (isSharedWithMe() || sharedWithSharee) {
return R.drawable.ic_folder_overlay_share;
return R.drawable.folder_shared_users;
} else if (encrypted) {
return R.drawable.ic_folder_overlay_key;
return R.drawable.folder_encrypted;
} else if (WebdavEntry.MountType.EXTERNAL == mountType) {
return R.drawable.ic_folder_overlay_external;
return R.drawable.folder;
} else if (locked) {
return R.drawable.ic_folder_overlay_lock;
return R.drawable.folder_encrypted;
} else if (isAutoUploadFolder) {
return R.drawable.ic_folder_overlay_upload;
return R.drawable.folder_auto_upload;
} else {
return null;
return R.drawable.folder;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
package com.owncloud.android.ui.adapter

import android.content.Context
import android.graphics.drawable.LayerDrawable
import android.graphics.drawable.Drawable
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.nextcloud.android.lib.resources.groupfolders.Groupfolder
import com.owncloud.android.R
import com.owncloud.android.databinding.ListItemBinding
import com.owncloud.android.ui.interfaces.GroupfolderListInterface
import com.owncloud.android.utils.MimeTypeUtil
import com.owncloud.android.utils.theme.ViewThemeUtils
import java.io.File

Expand All @@ -33,9 +33,10 @@ class GroupfolderListAdapter(
list = result.values.sortedBy { it.mountPoint }
}

private fun getFolderIcon(): LayerDrawable? {
val overlayDrawableId = R.drawable.ic_folder_overlay_account_group
return MimeTypeUtil.getFolderIcon(false, overlayDrawableId, context, viewThemeUtils)
private fun getFolderIcon(): Drawable? {
val overlayDrawableId = R.drawable.folder_shared_users
// NMC Customization: No overlay icon will be used. Directly using folder icons
return ContextCompat.getDrawable(context, overlayDrawableId)
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/drawable-night/favorite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
android:viewportHeight="16">

<path
android:fillColor="#ffcc00"
android:pathData="M 7.9999993,1.0934068 10.040178,6.0083827 15.418832,6.4256921 11.245738,9.9032694 12.636769,15.003716 7.9999993,12.128919 3.3632295,15.003716 4.7542604,9.9032694 0.5811676,6.4256921 5.9598206,6.0083827 Z"
android:fillColor="#FFD329"
android:strokeColor="#121212"
android:strokeWidth="0.46367699"
android:strokeColor="#121212" />
android:pathData="M 7.9999993,1.0934068 10.040178,6.0083827 15.418832,6.4256921 11.245738,9.9032694 12.636769,15.003716 7.9999993,12.128919 3.3632295,15.003716 4.7542604,9.9032694 0.5811676,6.4256921 5.9598206,6.0083827 Z"/>
</vector>
34 changes: 34 additions & 0 deletions app/src/main/res/drawable-night/ic_checkbox_marked.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
@author Google LLC
Copyright (C) 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,12m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
android:strokeWidth="1"
android:fillColor="#191919"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M12,1C18.0751,1 23,5.9249 23,12C23,18.0751 18.0751,23 12,23C5.9249,23 1,18.0751 1,12C1,5.9249 5.9249,1 12,1ZM18.6661,8.279C18.3761,7.955 17.8791,7.927 17.5551,8.217L17.5551,8.217L9.9971,15.773L6.5081,12.285C6.2031,11.99 5.7191,11.991 5.4141,12.286C5.1021,12.589 5.0941,13.087 5.3971,13.399L5.3971,13.399L9.9971,18L18.6661,9.328C18.9331,9.029 18.9331,8.578 18.6661,8.279Z"
android:strokeWidth="1"
android:fillColor="#73C354"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>
28 changes: 28 additions & 0 deletions app/src/main/res/drawable-night/ic_email.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
@author Google LLC
Copyright (C) 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M0.5,3.5L0.5,17.5C0.5,19.15 1.85,20.5 3.5,20.5L20.5,20.5C22.15,20.5 23.5,19.15 23.5,17.5L23.5,3.5L0.5,3.5ZM22,5L22,5.95L13.55,13.2C12.65,13.95 11.35,13.95 10.45,13.2L2,5.95L2,5L22,5ZM20.5,19L3.5,19C2.65,19 2,18.35 2,17.5L2,7.95L9.45,14.35C10.2,15 11.1,15.3 12,15.3C12.9,15.3 13.8,15 14.55,14.35L22,7.95L22,17.5C22,18.35 21.35,19 20.5,19Z"
android:strokeWidth="1"
android:fillColor="#E3E3E3"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>
12 changes: 7 additions & 5 deletions app/src/main/res/drawable-night/shared_via_link.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFFFF"
android:viewportWidth="960"
android:viewportHeight="960">
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M440,680L280,680Q197,680 138.5,621.5Q80,563 80,480Q80,397 138.5,338.5Q197,280 280,280L440,280L440,360L280,360Q230,360 195,395Q160,430 160,480Q160,530 195,565Q230,600 280,600L440,600L440,680ZM320,520L320,440L640,440L640,520L320,520ZM520,680L520,600L680,600Q730,600 765,565Q800,530 800,480Q800,430 765,395Q730,360 680,360L520,360L520,280L680,280Q763,280 821.5,338.5Q880,397 880,480Q880,563 821.5,621.5Q763,680 680,680L520,680Z" />
android:pathData="M12.225,8.37C14.008,9.097 15.309,10.669 15.69,12.557C16.071,14.445 15.482,16.398 14.12,17.76L14.12,17.76L10.409,21.471C8.972,22.844 6.921,23.382 4.986,22.878C2.971,22.353 1.397,20.779 0.872,18.764C0.347,16.749 0.952,14.607 2.455,13.165L2.455,13.165L5.99,9.65C6.376,9.255 6.817,8.918 7.3,8.65C7.232,9.031 7.197,9.418 7.195,9.805C7.196,10.443 7.287,11.078 7.465,11.69L7.465,11.69L4.22,14.93C3.03,16.213 3.068,18.208 4.305,19.445C5.542,20.682 7.537,20.72 8.82,19.53L8.82,19.53L12.355,15.995C13.621,14.723 13.621,12.667 12.355,11.395L12.355,11.395L12.231,11.262C11.525,10.438 11.512,9.211 12.225,8.37ZM13.415,2.205C15.66,-0.039 19.3,-0.039 21.545,2.205C23.753,4.444 23.753,8.041 21.545,10.28L21.545,10.28L18.01,13.815C17.626,14.21 17.186,14.547 16.705,14.815C16.735,14.665 16.775,14.49 16.775,14.315C16.851,13.474 16.768,12.626 16.53,11.815L16.53,11.815L19.78,8.57C20.654,7.759 21.015,6.536 20.721,5.38C20.427,4.225 19.525,3.323 18.37,3.029C17.214,2.735 15.991,3.096 15.18,3.97L15.18,3.97L11.645,7.505C10.379,8.777 10.379,10.833 11.645,12.105L11.645,12.105L11.769,12.239C12.472,13.064 12.489,14.288 11.785,15.135C11.07,14.848 10.422,14.417 9.88,13.87C8.801,12.792 8.195,11.33 8.195,9.805C8.195,8.28 8.801,6.818 9.88,5.74L9.88,5.74Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>
15 changes: 11 additions & 4 deletions app/src/main/res/drawable/all_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
~ SPDX-FileCopyrightText: 2018-2024 Google LLC
~ SPDX-License-Identifier: Apache-2.0
-->
<vector android:height="24dp" android:tint="#333333"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7.5,2.5C8.55,2.5 9.5,2.95 10.2,3.7L10.2,3.7L10.65,4.15C10.9,4.35 11.2,4.5 11.5,4.5L11.5,4.5L23,4.5L23,19C23,20.65 21.65,22 20,22L20,22L4,22C2.35,22 1,20.65 1,19L1,19L1,2.5ZM7.5,4L2.5,4L2.5,19C2.5,19.85 3.15,20.5 4,20.5L4,20.5L20,20.5C20.85,20.5 21.5,19.85 21.5,19L21.5,19L21.5,6L11.5,6C10.8,6 10.1,5.7 9.6,5.15L9.6,5.15L9.15,4.7C8.7,4.25 8.1,4 7.5,4L7.5,4Z"
android:strokeWidth="1"
android:fillColor="#262626"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>
13 changes: 4 additions & 9 deletions app/src/main/res/drawable/favorite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
~ SPDX-FileCopyrightText: 2018-2024 Google LLC
~ SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#F7CD46"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z" />
<vector android:height="24dp" android:tint="#FFD329"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
</vector>
36 changes: 25 additions & 11 deletions app/src/main/res/drawable/file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@
~ SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#FF969696"
android:fillType="nonZero"
android:pathData="M6,22C5.45,22 4.979,21.804 4.588,21.413C4.196,21.021 4,20.55 4,20L4,4C4,3.45 4.196,2.979 4.588,2.587C4.979,2.196 5.45,2 6,2L14,2L20,8L20,20C20,20.55 19.804,21.021 19.413,21.413C19.021,21.804 18.55,22 18,22L6,22Z" />

xmlns:aapt="http://schemas.android.com/aapt"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">
<path
android:pathData="M58.29,17.14V61.71A2.3,2.3 0,0 1,56 64H8a2.3,2.3 0,0 1,-2.29 -2.29V2.29A2.3,2.3 0,0 1,8 0H41.14Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="32"
android:startY="64"
android:endX="32"
android:endY="0"
android:type="linear">
<item android:offset="0" android:color="#FFDDD6D3"/>
<item android:offset="0.39" android:color="#FFE9E4E2"/>
<item android:offset="1" android:color="#FFE9E4E2"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M58.29,17.14H43.43a2.29,2.29 0,0 1,-2.29 -2.28V0Z"
android:strokeAlpha="0.7"
android:fillColor="#b9ada7"
android:fillAlpha="0.7"/>
</vector>
47 changes: 40 additions & 7 deletions app/src/main/res/drawable/file_analytics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,44 @@
~ SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#b39114"
android:pathData="M18,18H12V12.21C11.34,12.82 10.47,13.2 9.5,13.2C7.46,13.2 5.8,11.54 5.8,9.5A3.7,3.7 0 0,1 9.5,5.8C11.54,5.8 13.2,7.46 13.2,9.5C13.2,10.47 12.82,11.34 12.21,12H18M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z" />
xmlns:aapt="http://schemas.android.com/aapt"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">
<path
android:pathData="M58.29,17.14V61.71A2.3,2.3 0,0 1,56 64H8a2.3,2.3 0,0 1,-2.29 -2.29V2.29A2.3,2.3 0,0 1,8 0H41.14Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="32"
android:startY="64"
android:endX="32"
android:endY="0"
android:type="linear">
<item android:offset="0" android:color="#FFDDD6D3"/>
<item android:offset="0.39" android:color="#FFE9E4E2"/>
<item android:offset="1" android:color="#FFE9E4E2"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M58.29,17.14H43.43a2.29,2.29 0,0 1,-2.29 -2.28V0Z"
android:strokeAlpha="0.7"
android:fillColor="#b9ada7"
android:fillAlpha="0.7"/>
<path
android:pathData="M34.29,40h4.57L38.86,52.57L34.29,52.57ZM25.14,35.43h4.57L29.71,52.57L25.14,52.57ZM43.43,35.43L48,35.43L48,52.57L43.43,52.57ZM16,43.43h4.57v9.14L16,52.57Z"
android:fillColor="#529ad6"/>
<path
android:pathData="M18.29,37.6a1.2,1.2 0,0 1,-0.8 -0.34,1.23 1.23,0 0,1 -0.12,-1.6L27.2,24.57l9.37,7L45,25.14A1.14,1.14 0,0 1,46.4 27l-9.83,7.32 -9,-6.75L19.09,37A0.91,0.91 0,0 1,18.29 37.6Z"
android:fillColor="#a4a4a4"/>
<path
android:pathData="M29.83,26.17a2.4,2.4 0,1 1,-2.4 -2.4A2.41,2.41 0,0 1,29.83 26.17ZM48.11,26.17a2.4,2.4 0,1 1,-2.4 -2.4A2.41,2.41 0,0 1,48.11 26.17Z"
android:fillColor="#6c6c6c"/>
<path
android:pathData="M36.57,33.03m-2.4,0a2.4,2.4 0,1 1,4.8 0a2.4,2.4 0,1 1,-4.8 0"
android:fillColor="#6c6c6c"/>
<path
android:pathData="M20.69,36.46a2.4,2.4 0,1 1,-2.4 -2.4A2.42,2.42 0,0 1,20.69 36.46Z"
android:fillColor="#6c6c6c"/>
</vector>
Loading

0 comments on commit 422bd8f

Please sign in to comment.