Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,62 +40,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 @@ -675,23 +675,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 @@ -23,16 +23,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 @@ -48,9 +48,10 @@ class GroupfolderListAdapter(
list = result.values.sortedBy { it.mountPoint }
}

private fun getFolderIcon(): LayerDrawable? {
val overlayDrawableId = R.drawable.ic_folder_overlay_account_group
return MimeTypeUtil.getFileIcon(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
2 changes: 1 addition & 1 deletion app/src/main/res/drawable-night/favorite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:viewportHeight="16">

<path
android:fillColor="#ffcc00"
android:fillColor="#FFD329"
android:strokeColor="#121212"
android:strokeWidth="0.46367699"
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"/>
Expand Down
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>
24 changes: 9 additions & 15 deletions app/src/main/res/drawable-night/shared_via_link.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,14 @@

-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16.0"
android:viewportHeight="16.0">
<path
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="0.0"
android:strokeMiterLimit="4"
android:pathData="M5.99 5.318a3.332 3.332 0 0 0 0 4.693c 0.116 0.118 0.226 0.22 0.355 0.315l1.383-1.383A1.4 1.4 0 0 1 7.33 6.66l3.352-3.352c 0.568-0.57 1.442-0.57 2.01 0s 0.57 1.442 0 2.01l-1.13 1.132c 0.34 0.725 0.464 1.518 0.377 2.304l2.094-2.095c1.288-1.29 1.288-3.406 0-4.694s-3.405-1.288-4.693 0L5.99 5.318z"/>
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="0.0"
android:strokeMiterLimit="4"
android:pathData="M10.01 10.68a3.332 3.332 0 0 0 0-4.692 3.126 3.126 0 0 0-0.355-0.314L8.272 7.057A1.4 1.4 0 0 1 8.67 9.34l-3.35 3.35c-0.57 0.57-1.444 0.57-2.013 0.002s-0.568-1.442 0-2.01L4.44 9.55a4.288 4.288 0 0 1-0.38-2.305L1.967 9.34c-1.288 1.29-1.288 3.405 0 4.693s3.405 1.29 4.693 0l3.35-3.352z"/>
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 @@ -18,8 +18,15 @@

Icon provided by Android Material Library in Apache License 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>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/favorite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

Icon provided by Android Material Library in Apache License 2.0
-->
<vector android:height="24dp" android:tint="#F7CD46"
<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"/>
Expand Down
34 changes: 25 additions & 9 deletions app/src/main/res/drawable/file.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">

<path
android:fillColor="#969696"
android:pathData="M2.5 1c-0.28 0-0.5 0.22-0.5 0.5v13c0 0.28 0.22 0.5 0.5 0.5h11c0.28 0 0.5-0.22 0.5-0.5v-10.5l-3-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"/>
</vector>
66 changes: 40 additions & 26 deletions app/src/main/res/drawable/file_analytics.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
<!--
Nextcloud Android client application

Copyright (C) 2023 Nextcloud.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU AFFERO GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU Affero General Public
License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:fillColor="#49ABEA"
android:fillType="nonZero"
android:pathData="M2.5,1L11,1L14,4L14,14.5C14,14.78 13.78,15 13.5,15L2.5,15C2.22,15 2,14.78 2,14.5L2,1.5C2,1.22 2.22,1 2.5,1ZM5.126,8.72L6.698,6.972C6.751,6.987 6.808,6.996 6.866,6.996C6.966,6.996 7.06,6.971 7.143,6.927L8.562,7.992C8.554,8.03 8.55,8.07 8.55,8.11C8.55,8.439 8.821,8.71 9.15,8.71C9.479,8.71 9.75,8.439 9.75,8.11C9.75,8.071 9.746,8.032 9.738,7.995L11.166,6.932C11.246,6.973 11.338,6.996 11.434,6.996C11.763,6.996 12.034,6.725 12.034,6.396C12.032,6.068 11.762,5.798 11.434,5.796C11.105,5.796 10.834,6.067 10.834,6.396C10.834,6.417 10.835,6.438 10.837,6.458L9.391,7.562C9.317,7.529 9.235,7.511 9.15,7.511C9.063,7.511 8.981,7.529 8.906,7.563L7.459,6.483C7.464,6.454 7.466,6.426 7.466,6.396C7.464,6.068 7.194,5.798 6.866,5.796C6.537,5.796 6.266,6.067 6.266,6.396C6.266,6.459 6.276,6.52 6.294,6.577L4.696,8.38C4.659,8.372 4.621,8.368 4.582,8.368C4.253,8.368 3.982,8.639 3.982,8.968C3.982,9.296 4.253,9.567 4.582,9.567C4.911,9.567 5.182,9.296 5.182,8.968C5.181,8.879 5.161,8.796 5.126,8.72ZM8.58,9.852L8.58,12.993L9.722,12.993L9.722,9.852L8.58,9.852ZM6.294,8.71L6.294,12.993L7.436,12.993L7.436,8.71L6.294,8.71ZM4.01,10.709L4.01,12.993L5.152,12.993L5.152,10.709L4.01,10.709ZM10.864,8.71L10.864,12.993L12.006,12.993L12.006,8.71L10.864,8.71Z" />
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