From 74665aefedfba11cd5d1ac7182883a797dcf1d85 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 21 Jan 2025 11:37:16 +0100 Subject: [PATCH] use tag Signed-off-by: alperozturk --- .../android/datamodel/FileDataStorageManager.java | 4 ++-- .../main/java/com/owncloud/android/datamodel/OCFile.java | 8 ++++---- .../owncloud/android/ui/adapter/OCFileListAdapter.java | 6 +++--- .../owncloud/android/ui/fragment/FileDetailFragment.java | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java b/app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java index a789aed89472..5562d6200c84 100644 --- a/app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -62,7 +62,7 @@ import com.owncloud.android.lib.resources.status.CapabilityBooleanType; import com.owncloud.android.lib.resources.status.E2EVersion; import com.owncloud.android.lib.resources.status.OCCapability; -import com.owncloud.android.lib.resources.systemTag.SystemTag; +import com.owncloud.android.lib.resources.tags.Tag; import com.owncloud.android.operations.RemoteOperationFailedException; import com.owncloud.android.utils.FileStorageUtils; import com.owncloud.android.utils.MimeType; @@ -1271,7 +1271,7 @@ private OCFile createFileInstance(FileEntity fileEntity) { ocFile.setTags(new ArrayList<>()); } else { try { - SystemTag[] tagsArray = gson.fromJson(tags, SystemTag[].class); + Tag[] tagsArray = gson.fromJson(tags, Tag[].class); ocFile.setTags(new ArrayList<>(Arrays.asList(tagsArray))); } catch (JsonSyntaxException e) { // ignore saved value due to api change diff --git a/app/src/main/java/com/owncloud/android/datamodel/OCFile.java b/app/src/main/java/com/owncloud/android/datamodel/OCFile.java index a11dac8bcdde..92bf6bd55645 100644 --- a/app/src/main/java/com/owncloud/android/datamodel/OCFile.java +++ b/app/src/main/java/com/owncloud/android/datamodel/OCFile.java @@ -30,7 +30,7 @@ import com.owncloud.android.lib.resources.files.model.ImageDimension; import com.owncloud.android.lib.resources.files.model.ServerFileInterface; import com.owncloud.android.lib.resources.shares.ShareeUser; -import com.owncloud.android.lib.resources.systemTag.SystemTag; +import com.owncloud.android.lib.resources.tags.Tag; import com.owncloud.android.utils.MimeType; import java.io.File; @@ -118,7 +118,7 @@ public class OCFile implements Parcelable, Comparable, ServerFileInterfa private long e2eCounter = -1; @Nullable private GeoLocation geolocation; - private List tags = new ArrayList<>(); + private List tags = new ArrayList<>(); private Long internalFolderSyncTimestamp = -1L; private String internalFolderSyncResult = ""; @@ -1048,11 +1048,11 @@ public GeoLocation getGeoLocation() { return geolocation; } - public List getTags() { + public List getTags() { return tags; } - public void setTags(List tags) { + public void setTags(List tags) { this.tags = tags; } diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java index e68c7d4ae4a5..2def9a4a6b67 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java @@ -64,7 +64,7 @@ import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareeUser; -import com.owncloud.android.lib.resources.systemTag.SystemTag; +import com.owncloud.android.lib.resources.tags.Tag; import com.owncloud.android.operations.RefreshFolderOperation; import com.owncloud.android.operations.RemoteOperationFailedException; import com.owncloud.android.ui.activity.ComponentsGetter; @@ -651,7 +651,7 @@ private void bindListItemViewHolder(ListItemViewHolder holder, OCFile file) { configureThumbnail(holder, file); } - private void applyChipVisuals(Chip chip, SystemTag tag) { + private void applyChipVisuals(Chip chip, Tag tag) { viewThemeUtils.material.themeChipSuggestion(chip); chip.setText(tag.getName()); @@ -665,7 +665,7 @@ private void applyChipVisuals(Chip chip, SystemTag tag) { chip.setChipStrokeColor(ColorStateList.valueOf(color)); chip.setTextColor(color); } catch (IllegalArgumentException e) { - // do nothing + Log_OC.d(TAG, "Exception applyChipVisuals: " + e); } } diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java index 0010276a68bc..1fe0739d27f5 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -51,7 +51,7 @@ import com.owncloud.android.lib.resources.files.ToggleFavoriteRemoteOperation; import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.ShareType; -import com.owncloud.android.lib.resources.systemTag.SystemTag; +import com.owncloud.android.lib.resources.tags.Tag; import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.activity.ToolbarActivity; import com.owncloud.android.ui.adapter.FileDetailTabAdapter; @@ -238,7 +238,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, if (getFile().getTags().isEmpty()) { binding.tagsGroup.setVisibility(View.GONE); } else { - for (SystemTag tag : getFile().getTags()) { + for (Tag tag : getFile().getTags()) { Chip chip = new Chip(context); chip.setText(tag.getName()); chip.setChipBackgroundColor(ColorStateList.valueOf(getResources().getColor(R.color.bg_default,