Skip to content

Commit b78a977

Browse files
committed
Updated app icons for dark and light mode as per MC customization.
1 parent 1704972 commit b78a977

File tree

96 files changed

+1410
-550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1410
-550
lines changed

app/src/androidTest/java/com/owncloud/android/datamodel/OCFileIconTests.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,62 +26,63 @@ class OCFileIconTests {
2626
@Test
2727
fun testGetFileOverlayIconWhenFileIsAutoUploadFolderShouldReturnFolderOverlayUploadIcon() {
2828
val fileOverlayIcon = sut?.getFileOverlayIconId(true)
29-
val expectedDrawable = R.drawable.ic_folder_overlay_upload
29+
val expectedDrawable = R.drawable.folder_auto_upload
3030
assert(fileOverlayIcon == expectedDrawable)
3131
}
3232

3333
@Test
3434
fun testGetFileOverlayIconWhenFileIsEncryptedShouldReturnFolderOverlayKeyIcon() {
3535
sut?.isEncrypted = true
3636
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
37-
val expectedDrawable = R.drawable.ic_folder_overlay_key
37+
val expectedDrawable = R.drawable.folder_encrypted
3838
assert(fileOverlayIcon == expectedDrawable)
3939
}
4040

4141
@Test
4242
fun testGetFileOverlayIconWhenFileIsGroupFolderShouldReturnFolderOverlayAccountGroupIcon() {
4343
sut?.mountType = MountType.GROUP
4444
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
45-
val expectedDrawable = R.drawable.ic_folder_overlay_account_group
45+
val expectedDrawable = R.drawable.folder_shared_users
4646
assert(fileOverlayIcon == expectedDrawable)
4747
}
4848

4949
@Test
5050
fun testGetFileOverlayIconWhenFileIsSharedViaLinkShouldReturnFolderOverlayLinkIcon() {
5151
sut?.isSharedViaLink = true
5252
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
53-
val expectedDrawable = R.drawable.ic_folder_overlay_link
53+
val expectedDrawable = R.drawable.folder_shared_users
5454
assert(fileOverlayIcon == expectedDrawable)
5555
}
5656

5757
@Test
5858
fun testGetFileOverlayIconWhenFileIsSharedShouldReturnFolderOverlayShareIcon() {
5959
sut?.isSharedWithSharee = true
6060
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
61-
val expectedDrawable = R.drawable.ic_folder_overlay_share
61+
val expectedDrawable = R.drawable.folder_shared_users
6262
assert(fileOverlayIcon == expectedDrawable)
6363
}
6464

6565
@Test
6666
fun testGetFileOverlayIconWhenFileIsExternalShouldReturnFolderOverlayExternalIcon() {
6767
sut?.mountType = MountType.EXTERNAL
6868
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
69-
val expectedDrawable = R.drawable.ic_folder_overlay_external
69+
val expectedDrawable = R.drawable.folder
7070
assert(fileOverlayIcon == expectedDrawable)
7171
}
7272

7373
@Test
7474
fun testGetFileOverlayIconWhenFileIsLockedShouldReturnFolderOverlayLockIcon() {
7575
sut?.isLocked = true
7676
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
77-
val expectedDrawable = R.drawable.ic_folder_overlay_lock
77+
val expectedDrawable = R.drawable.folder_encrypted
7878
assert(fileOverlayIcon == expectedDrawable)
7979
}
8080

8181
@Test
8282
fun testGetFileOverlayIconWhenFileIsFolderShouldReturnNull() {
8383
val fileOverlayIcon = sut?.getFileOverlayIconId(false)
84-
assert(fileOverlayIcon == null)
84+
val expectedDrawable = R.drawable.folder
85+
assert(fileOverlayIcon == expectedDrawable)
8586
}
8687

8788
@After

app/src/main/java/com/owncloud/android/datamodel/OCFile.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -666,23 +666,25 @@ public boolean isGroupFolder() {
666666
return permissions != null && permissions.contains(PERMISSION_GROUPFOLDER);
667667
}
668668

669+
// NMC Customization: We are not using any overlay icons for normal folders
670+
// we have different folder icons with inbuilt overlay
669671
public Integer getFileOverlayIconId(boolean isAutoUploadFolder) {
670672
if (WebdavEntry.MountType.GROUP == mountType || isGroupFolder()) {
671-
return R.drawable.ic_folder_overlay_account_group;
673+
return R.drawable.folder_shared_users;
672674
} else if (sharedViaLink && !encrypted) {
673-
return R.drawable.ic_folder_overlay_link;
675+
return R.drawable.folder_shared_users;
674676
} else if (isSharedWithMe() || sharedWithSharee) {
675-
return R.drawable.ic_folder_overlay_share;
677+
return R.drawable.folder_shared_users;
676678
} else if (encrypted) {
677-
return R.drawable.ic_folder_overlay_key;
679+
return R.drawable.folder_encrypted;
678680
} else if (WebdavEntry.MountType.EXTERNAL == mountType) {
679-
return R.drawable.ic_folder_overlay_external;
681+
return R.drawable.folder;
680682
} else if (locked) {
681-
return R.drawable.ic_folder_overlay_lock;
683+
return R.drawable.folder_encrypted;
682684
} else if (isAutoUploadFolder) {
683-
return R.drawable.ic_folder_overlay_upload;
685+
return R.drawable.folder_auto_upload;
684686
} else {
685-
return null;
687+
return R.drawable.folder;
686688
}
687689
}
688690

app/src/main/java/com/owncloud/android/ui/adapter/GroupfolderListAdapter.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
package com.owncloud.android.ui.adapter
99

1010
import android.content.Context
11-
import android.graphics.drawable.LayerDrawable
11+
import android.graphics.drawable.Drawable
1212
import android.view.LayoutInflater
1313
import android.view.View
1414
import android.view.ViewGroup
15+
import androidx.core.content.ContextCompat
1516
import androidx.recyclerview.widget.RecyclerView
1617
import com.nextcloud.android.lib.resources.groupfolders.Groupfolder
1718
import com.owncloud.android.R
1819
import com.owncloud.android.databinding.ListItemBinding
1920
import com.owncloud.android.ui.interfaces.GroupfolderListInterface
20-
import com.owncloud.android.utils.MimeTypeUtil
2121
import com.owncloud.android.utils.theme.ViewThemeUtils
2222
import java.io.File
2323

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

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

4142
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {

app/src/main/res/drawable-night/favorite.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
android:viewportHeight="16">
1313

1414
<path
15-
android:fillColor="#ffcc00"
16-
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"
15+
android:fillColor="#FFD329"
16+
android:strokeColor="#121212"
1717
android:strokeWidth="0.46367699"
18-
android:strokeColor="#121212" />
18+
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"/>
1919
</vector>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--
2+
@author Google LLC
3+
Copyright (C) 2018 Google LLC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="24dp"
19+
android:height="24dp"
20+
android:viewportWidth="24"
21+
android:viewportHeight="24">
22+
<path
23+
android:pathData="M12,12m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
24+
android:strokeWidth="1"
25+
android:fillColor="#191919"
26+
android:fillType="evenOdd"
27+
android:strokeColor="#00000000"/>
28+
<path
29+
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"
30+
android:strokeWidth="1"
31+
android:fillColor="#73C354"
32+
android:fillType="evenOdd"
33+
android:strokeColor="#00000000"/>
34+
</vector>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
@author Google LLC
3+
Copyright (C) 2018 Google LLC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="24dp"
19+
android:height="24dp"
20+
android:viewportWidth="24"
21+
android:viewportHeight="24">
22+
<path
23+
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"
24+
android:strokeWidth="1"
25+
android:fillColor="#E3E3E3"
26+
android:fillType="evenOdd"
27+
android:strokeColor="#00000000"/>
28+
</vector>

app/src/main/res/drawable-night/shared_via_link.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
<vector xmlns:android="http://schemas.android.com/apk/res/android"
88
android:width="24dp"
99
android:height="24dp"
10-
android:tint="#FFFFFFFF"
11-
android:viewportWidth="960"
12-
android:viewportHeight="960">
10+
android:viewportWidth="24"
11+
android:viewportHeight="24">
1312
<path
14-
android:fillColor="@android:color/white"
15-
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" />
13+
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"
14+
android:strokeWidth="1"
15+
android:fillColor="#FFFFFF"
16+
android:fillType="evenOdd"
17+
android:strokeColor="#00000000"/>
1618
</vector>

app/src/main/res/drawable/all_files.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
~ SPDX-FileCopyrightText: 2018-2024 Google LLC
55
~ SPDX-License-Identifier: Apache-2.0
66
-->
7-
<vector android:height="24dp" android:tint="#333333"
8-
android:viewportHeight="24.0" android:viewportWidth="24.0"
9-
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
10-
<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"/>
7+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
8+
android:width="24dp"
9+
android:height="24dp"
10+
android:viewportWidth="24"
11+
android:viewportHeight="24">
12+
<path
13+
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"
14+
android:strokeWidth="1"
15+
android:fillColor="#262626"
16+
android:fillType="evenOdd"
17+
android:strokeColor="#00000000"/>
1118
</vector>

app/src/main/res/drawable/favorite.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44
~ SPDX-FileCopyrightText: 2018-2024 Google LLC
55
~ SPDX-License-Identifier: Apache-2.0
66
-->
7-
<vector xmlns:android="http://schemas.android.com/apk/res/android"
8-
android:width="24dp"
9-
android:height="24dp"
10-
android:tint="#F7CD46"
11-
android:viewportWidth="24.0"
12-
android:viewportHeight="24.0">
13-
<path
14-
android:fillColor="#FF000000"
15-
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" />
7+
<vector android:height="24dp" android:tint="#FFD329"
8+
android:viewportHeight="24.0" android:viewportWidth="24.0"
9+
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
10+
<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"/>
1611
</vector>

app/src/main/res/drawable/file.xml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,29 @@
66
~ SPDX-License-Identifier: Apache-2.0
77
-->
88
<vector xmlns:android="http://schemas.android.com/apk/res/android"
9-
android:width="24dp"
10-
android:height="24dp"
11-
android:autoMirrored="true"
12-
android:viewportWidth="24"
13-
android:viewportHeight="24">
14-
15-
<path
16-
android:fillColor="#FF969696"
17-
android:fillType="nonZero"
18-
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" />
19-
9+
xmlns:aapt="http://schemas.android.com/aapt"
10+
android:width="64dp"
11+
android:height="64dp"
12+
android:viewportWidth="64"
13+
android:viewportHeight="64">
14+
<path
15+
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">
16+
<aapt:attr name="android:fillColor">
17+
<gradient
18+
android:startX="32"
19+
android:startY="64"
20+
android:endX="32"
21+
android:endY="0"
22+
android:type="linear">
23+
<item android:offset="0" android:color="#FFDDD6D3"/>
24+
<item android:offset="0.39" android:color="#FFE9E4E2"/>
25+
<item android:offset="1" android:color="#FFE9E4E2"/>
26+
</gradient>
27+
</aapt:attr>
28+
</path>
29+
<path
30+
android:pathData="M58.29,17.14H43.43a2.29,2.29 0,0 1,-2.29 -2.28V0Z"
31+
android:strokeAlpha="0.7"
32+
android:fillColor="#b9ada7"
33+
android:fillAlpha="0.7"/>
2034
</vector>

0 commit comments

Comments
 (0)