From a0a9321cd76dc0b139ca053e712d7f96af06c6a2 Mon Sep 17 00:00:00 2001 From: Pinghao Wu Date: Sat, 26 Oct 2024 22:33:54 +0800 Subject: [PATCH] CephFSDocumentsProvider: icon for broken symlink based on materl symbols "link off" --- src/main/java/org/safcephfs/CephFSDocumentsProvider.java | 2 ++ src/main/res/drawable/ic_broken_symlink.xml | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/main/res/drawable/ic_broken_symlink.xml diff --git a/src/main/java/org/safcephfs/CephFSDocumentsProvider.java b/src/main/java/org/safcephfs/CephFSDocumentsProvider.java index 0a89afd..9f82e51 100644 --- a/src/main/java/org/safcephfs/CephFSDocumentsProvider.java +++ b/src/main/java/org/safcephfs/CephFSDocumentsProvider.java @@ -68,6 +68,7 @@ public class CephFSDocumentsProvider extends DocumentsProvider { Document.COLUMN_SIZE, Document.COLUMN_FLAGS, Document.COLUMN_SUMMARY, + Document.COLUMN_ICON, }; private static String APP_NAME; @@ -290,6 +291,7 @@ public class CephFSDocumentsProvider extends DocumentsProvider { flags |= Document.FLAG_PARTIAL; var target = executor.executeWithUnchecked(cm -> cm.readlink(dir + displayName)); row.add(Document.COLUMN_SUMMARY, "Broken symlink to " + target); + row.add(Document.COLUMN_ICON, R.drawable.ic_broken_symlink); } if (cs.isDir()) { if (mayWrite(cs)) { flags |= Document.FLAG_DIR_SUPPORTS_CREATE; diff --git a/src/main/res/drawable/ic_broken_symlink.xml b/src/main/res/drawable/ic_broken_symlink.xml new file mode 100644 index 0000000..b2d97af --- /dev/null +++ b/src/main/res/drawable/ic_broken_symlink.xml @@ -0,0 +1,9 @@ + + + -- 2.45.2