Skip to content

Commit b9cff64

Browse files
committed
distinguish tag and system tag
Signed-off-by: alperozturk <alper_ozturk@proton.me>
1 parent e5fb554 commit b9cff64

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

library/src/main/java/com/owncloud/android/lib/common/network/Tag.kt

Lines changed: 0 additions & 11 deletions
This file was deleted.

library/src/main/java/com/owncloud/android/lib/common/network/WebdavEntry.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import com.owncloud.android.lib.resources.files.model.GeoLocation
2020
import com.owncloud.android.lib.resources.files.model.ImageDimension
2121
import com.owncloud.android.lib.resources.shares.ShareType
2222
import com.owncloud.android.lib.resources.shares.ShareeUser
23+
import com.owncloud.android.lib.resources.systemTag.SystemTag
2324
import org.apache.jackrabbit.webdav.MultiStatusResponse
2425
import org.apache.jackrabbit.webdav.property.DavProperty
2526
import org.apache.jackrabbit.webdav.property.DavPropertyName
@@ -86,7 +87,7 @@ class WebdavEntry constructor(ms: MultiStatusResponse, splitElement: String) {
8687
private set
8788
var lockToken: String? = null
8889
private set
89-
var tags = arrayOfNulls<Tag>(0)
90+
var tags = arrayOfNulls<SystemTag>(0)
9091
var imageDimension: ImageDimension? = null
9192
var geoLocation: GeoLocation? = null
9293
var hidden = false
@@ -464,10 +465,10 @@ class WebdavEntry constructor(ms: MultiStatusResponse, splitElement: String) {
464465
}
465466
}
466467

467-
private fun parseTag(element: Element): Tag {
468+
private fun parseTag(element: Element): SystemTag {
468469
val name = element.firstChild.textContent
469-
val color = element.getAttribute("nc:color")
470-
return Tag(name, color)
470+
val color = "#" + element.getAttribute("nc:color")
471+
return SystemTag(name, color)
471472
}
472473

473474
private fun parseLockProperties(

library/src/main/java/com/owncloud/android/lib/resources/files/model/RemoteFile.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ package com.owncloud.android.lib.resources.files.model
88

99
import android.os.Parcel
1010
import android.os.Parcelable
11-
import com.owncloud.android.lib.common.network.Tag
1211
import com.owncloud.android.lib.common.network.WebdavEntry
1312
import com.owncloud.android.lib.common.network.WebdavEntry.MountType
1413
import com.owncloud.android.lib.resources.files.FileUtils
1514
import com.owncloud.android.lib.resources.files.model.FileLockType.Companion.fromValue
1615
import com.owncloud.android.lib.resources.shares.ShareeUser
16+
import com.owncloud.android.lib.resources.systemTag.SystemTag
1717
import java.io.Serializable
1818

1919
/**
@@ -51,7 +51,7 @@ class RemoteFile : Parcelable, Serializable {
5151
var lockOwnerEditor: String? = null
5252
var lockTimeout: Long = 0
5353
var lockToken: String? = null
54-
var tags: Array<Tag?>? = null
54+
var tags: Array<SystemTag?>? = null
5555
var imageDimension: ImageDimension? = null
5656
var geoLocation: GeoLocation? = null
5757
var hidden = false
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Nextcloud - Android Client
3+
*
4+
* SPDX-FileCopyrightText: 2025 Alper Ozturk <alper.ozturk@nextcloud.com>
5+
* SPDX-License-Identifier: AGPL-3.0-or-later
6+
*/
7+
8+
package com.owncloud.android.lib.resources.systemTag
9+
10+
data class SystemTag(val name: String, val color: String?)

0 commit comments

Comments
 (0)