From 57ec698b78fd0ffbe6290747ddc3f091b67e6d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:40:30 +0900 Subject: [PATCH 01/43] =?UTF-8?q?Toxi=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB?= =?UTF-8?q?=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../database/entity/ToxiDocumentTagEntity.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java diff --git a/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java b/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java new file mode 100644 index 00000000..cf0720cf --- /dev/null +++ b/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java @@ -0,0 +1,18 @@ +package one.nem.lacerta.source.database.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +@Entity(tableName = "toxi_document_tag") +public class ToxiDocumentTagEntity { + + // 複合主キー + @PrimaryKey + @ColumnInfo(name = "document_id") + public String documentId; // ドキュメントID + + @PrimaryKey + @ColumnInfo(name = "tag_id") + public String tagId; // タグID +} From cf60bc3423ca48660649cef366a5a80cbae3c583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:44:00 +0900 Subject: [PATCH 02/43] =?UTF-8?q?Tags,=20DefaultBranch=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/model/document/DocumentMeta.java | 72 ++----------------- 1 file changed, 4 insertions(+), 68 deletions(-) diff --git a/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java b/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java index 1093188e..ed686d0c 100644 --- a/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java +++ b/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java @@ -32,17 +32,10 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応 */ Date createdAt; - /** - * ドキュメントのタグ(DocumentTagインスタンスのリスト) - */ - List tags; - String parentId; String author; - String defaultBranch; - // Constructor public DocumentMeta() { @@ -51,49 +44,33 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応 public DocumentMeta(String title) { this.id = UUID.randomUUID().toString(); this.title = title; - this.tags = new ArrayList<>(); - this.author = ""; // TODO-rca: 作者のデフォルト値を設定できるようにする - this.defaultBranch = "main"; // TODO-rca: デフォルトブランチのデフォルト値を設定できるようにする + this.author = ""; // TODO-rca: 作者のデフォルト値を指定できるように this.parentId = null; this.updatedAt = new Date(); this.createdAt = new Date(); } - public DocumentMeta(String title, List tags, String author, String defaultBranch) { + public DocumentMeta(String title, String author) { this.id = UUID.randomUUID().toString(); this.title = title; - this.tags = tags; this.author = author; - this.defaultBranch = defaultBranch; } - public DocumentMeta(String id, String title, List tags, String author, String defaultBranch) { - this.id = id; - this.title = title; - this.tags = tags; - this.author = author; - this.defaultBranch = defaultBranch; - } - - public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List tags, String author, String defaultBranch) { + public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, String author) { this.id = id; this.title = title; this.updatedAt = updatedAt; this.createdAt = createdAt; - this.tags = tags; this.author = author; - this.defaultBranch = defaultBranch; } - public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List tags, String parentId, String author, String defaultBranch) { + public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, String parentId, String author) { this.id = id; this.title = title; this.updatedAt = updatedAt; this.createdAt = createdAt; - this.tags = tags; this.parentId = parentId; this.author = author; - this.defaultBranch = defaultBranch; } // Getter @@ -126,24 +103,6 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応 return createdAt; } - /** - * ドキュメントのタグ(DocumentTagインスタンスのリスト)を取得する - */ - public List getTags() { - return tags; - } - - /** - * ドキュメントのタグ(DocumentTagインスタンスのリスト)のID(String)を取得する - */ - public List getTagIds() { - List tagIds = new ArrayList<>(); - for (DocumentTag tag : tags) { - tagIds.add(tag.getId()); - } - return tagIds; - } - /** * ドキュメントの親フォルダのID(String)を取得する */ @@ -158,13 +117,6 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応 return author; } - /** - * ドキュメントのデフォルトブランチ(String)を取得する - */ - public String getDefaultBranch() { - return defaultBranch; - } - // Setter /** @@ -199,14 +151,6 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応 this.createdAt = createdAt; } - /** - * ドキュメントのタグ(DocumentTagインスタンスのリスト)を設定する - * @param tags ドキュメントのタグ(DocumentTagインスタンスのリスト) - */ - public void setTags(List tags) { - this.tags = tags; - } - /** * ドキュメントの親フォルダのID(String)を設定する * @param parentId ドキュメントの親フォルダのID @@ -223,14 +167,6 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応 this.author = author; } - /** - * ドキュメントのデフォルトブランチ(String)を設定する - * @param defaultBranch ドキュメントのデフォルトブランチ - */ - public void setDefaultBranch(String defaultBranch) { - this.defaultBranch = defaultBranch; - } - /** * updatedAtを現在時刻に設定する */ From 6e50239c9e7a0f6fff60aaa84e3e32d872f544b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:44:33 +0900 Subject: [PATCH 03/43] =?UTF-8?q?Tags,=20DefaultBranch=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/data/impl/DocumentImpl.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java index 9c1e2c47..bcd3318e 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java @@ -78,11 +78,9 @@ public class DocumentImpl implements Document { documentEntity.id = meta.getId(); documentEntity.title = meta.getTitle(); documentEntity.author = meta.getAuthor(); - documentEntity.defaultBranch = meta.getDefaultBranch(); documentEntity.updatedAt = meta.getUpdatedAt(); documentEntity.createdAt = meta.getCreatedAt(); documentEntity.parentId = meta.getParentId(); - documentEntity.tagIds = meta.getTagIds(); database.documentDao().insert(documentEntity); @@ -103,11 +101,9 @@ public class DocumentImpl implements Document { meta.setId(UUID.randomUUID().toString()); meta.setTitle("New Document"); meta.setAuthor("author"); - meta.setDefaultBranch("master"); meta.setUpdatedAt(new Date()); meta.setCreatedAt(new Date()); meta.setParentId(null); - meta.setTags(new ArrayList<>()); return createDocument(meta); } @@ -168,11 +164,9 @@ public class DocumentImpl implements Document { meta.setId(documentEntity.id); meta.setTitle(documentEntity.title); meta.setAuthor(documentEntity.author); - meta.setDefaultBranch(documentEntity.defaultBranch); meta.setUpdatedAt(documentEntity.updatedAt); meta.setCreatedAt(documentEntity.createdAt); meta.setParentId(documentEntity.parentId); - meta.setTags(new ArrayList<>()); // TODO-rca: タグを取得する DocumentDetail detail = new DocumentDetail(); From 0cdd4b1af118dcc00beb464a62eb5ce1a4c6ea0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:44:39 +0900 Subject: [PATCH 04/43] =?UTF-8?q?Tags,=20DefaultBranch=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/source/database/entity/DocumentEntity.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/source/src/main/java/one/nem/lacerta/source/database/entity/DocumentEntity.java b/source/src/main/java/one/nem/lacerta/source/database/entity/DocumentEntity.java index 2c4e03ab..1e7891e9 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/entity/DocumentEntity.java +++ b/source/src/main/java/one/nem/lacerta/source/database/entity/DocumentEntity.java @@ -34,12 +34,6 @@ public class DocumentEntity { @ColumnInfo(name = "author") public String author; // 作成者 - @ColumnInfo(name = "default_branch") - public String defaultBranch; // デフォルトブランチ - - @ColumnInfo(name = "tag_ids") - public List tagIds; // タグ - @ColumnInfo(name = "parent_id") public String parentId; // 親フォルダID } From b91f0ae022c1d0504b13324026a01364b50a8990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:47:35 +0900 Subject: [PATCH 05/43] =?UTF-8?q?Entity=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/source/database/LacertaDatabase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java b/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java index 47e0e4bb..f7f0783f 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java +++ b/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java @@ -9,6 +9,7 @@ import one.nem.lacerta.source.database.entity.FolderEntity; import one.nem.lacerta.source.database.entity.TagEntity; import one.nem.lacerta.source.database.entity.DocumentEntity; import one.nem.lacerta.source.database.entity.LibraryEntity; +import one.nem.lacerta.source.database.entity.ToxiDocumentTagEntity; import one.nem.lacerta.source.database.entity.VcsRevEntity; import one.nem.lacerta.source.database.entity.VcsLogEntity; @@ -19,7 +20,7 @@ import one.nem.lacerta.source.database.dao.LibraryDao; import one.nem.lacerta.source.database.dao.VcsRevDao; import one.nem.lacerta.source.database.dao.VcsLogDao; -@Database(entities = {TagEntity.class, DocumentEntity.class, LibraryEntity.class, VcsRevEntity.class, VcsLogEntity.class, FolderEntity.class}, version = 4) +@Database(entities = {TagEntity.class, DocumentEntity.class, LibraryEntity.class, VcsRevEntity.class, VcsLogEntity.class, FolderEntity.class, ToxiDocumentTagEntity.class}, version = 6) public abstract class LacertaDatabase extends RoomDatabase { public abstract TagDao tagDao(); public abstract DocumentDao documentDao(); From ae0f023e0e9b7dc439147f775e2a7e961a1e6d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:48:22 +0900 Subject: [PATCH 06/43] =?UTF-8?q?Dao=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/database/dao/ToxiDocumentTagDao.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java new file mode 100644 index 00000000..334bd092 --- /dev/null +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java @@ -0,0 +1,13 @@ +package one.nem.lacerta.source.database.dao; + +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.Query; + +import java.util.List; + +import one.nem.lacerta.source.database.entity.ToxiDocumentTagEntity; + +@Dao +public interface ToxiDocumentTagDao { +} From 396c5e914f6509c7c7e6665af1729d32bf2a7f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:48:42 +0900 Subject: [PATCH 07/43] =?UTF-8?q?Dao=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/source/database/LacertaDatabase.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java b/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java index f7f0783f..bb9a5dd9 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java +++ b/source/src/main/java/one/nem/lacerta/source/database/LacertaDatabase.java @@ -5,6 +5,7 @@ import androidx.room.RoomDatabase; // Entities import one.nem.lacerta.source.database.dao.FolderDao; +import one.nem.lacerta.source.database.dao.ToxiDocumentTagDao; import one.nem.lacerta.source.database.entity.FolderEntity; import one.nem.lacerta.source.database.entity.TagEntity; import one.nem.lacerta.source.database.entity.DocumentEntity; @@ -24,6 +25,7 @@ import one.nem.lacerta.source.database.dao.VcsLogDao; public abstract class LacertaDatabase extends RoomDatabase { public abstract TagDao tagDao(); public abstract DocumentDao documentDao(); + public abstract ToxiDocumentTagDao toxiDocumentTagDao(); public abstract LibraryDao libraryDao(); public abstract VcsRevDao vcsRevDao(); public abstract VcsLogDao vcsLogDao(); From 05915a2f4edef0e4f0cf3e6f147a5de45d0f1724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:49:53 +0900 Subject: [PATCH 08/43] =?UTF-8?q?Dao=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../database/dao/ToxiDocumentTagDao.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java index 334bd092..ae1c44b3 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/ToxiDocumentTagDao.java @@ -10,4 +10,28 @@ import one.nem.lacerta.source.database.entity.ToxiDocumentTagEntity; @Dao public interface ToxiDocumentTagDao { + + @Query("SELECT * FROM toxi_document_tag WHERE document_id = :documentId") + List findByDocumentId(String documentId); + + @Query("SELECT * FROM toxi_document_tag WHERE tag_id = :tagId") + List findByTagId(String tagId); + + @Insert + void insert(ToxiDocumentTagEntity toxiDocumentTag); + + @Insert + void insertAll(ToxiDocumentTagEntity... toxiDocumentTags); + + @Insert + void insertAll(List toxiDocumentTags); + + @Query("DELETE FROM toxi_document_tag WHERE document_id = :documentId") + void deleteByDocumentId(String documentId); + + @Query("DELETE FROM toxi_document_tag WHERE tag_id = :tagId") + void deleteByTagId(String tagId); + + @Query("DELETE FROM toxi_document_tag WHERE document_id = :documentId AND tag_id = :tagId") + void deleteByDocumentIdAndTagId(String documentId, String tagId); } From 512ac0b77523503c1b024f20a7cf8681c1a9becc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:52:06 +0900 Subject: [PATCH 09/43] =?UTF-8?q?Tag=E7=B3=BB=E3=82=A4=E3=83=B3=E3=82=BF?= =?UTF-8?q?=E3=83=95=E3=82=A7=E3=83=BC=E3=82=B9=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/data/LacertaLibrary.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java b/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java index 51a236c5..19cd9b34 100644 --- a/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java +++ b/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java @@ -9,6 +9,7 @@ import one.nem.lacerta.model.ListItemType; import one.nem.lacerta.model.LibraryItemPage; import one.nem.lacerta.model.PublicPath; import one.nem.lacerta.model.document.DocumentDetail; +import one.nem.lacerta.model.document.tag.DocumentTag; public interface LacertaLibrary { @@ -29,4 +30,17 @@ public interface LacertaLibrary { // Get Public Path CompletableFuture getPublicPath(String itemId, ListItemType itemType); + + // Tag + CompletableFuture> getTagList(); + + CompletableFuture createTag(DocumentTag tag); + + CompletableFuture updateTag(DocumentTag tag); + + CompletableFuture deleteTag(String tagId); + + CompletableFuture addTagToDocument(String documentId, String tagId); + + CompletableFuture removeTagFromDocument(String documentId, String tagId); } From fce59d74bc18740afd581ec804692779c5750652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:52:21 +0900 Subject: [PATCH 10/43] =?UTF-8?q?Impl=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/data/impl/LacertaLibraryImpl.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index 4a8cd0b3..9ad8fe81 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -18,6 +18,7 @@ import one.nem.lacerta.model.ListItem; import one.nem.lacerta.model.ListItemType; import one.nem.lacerta.model.PublicPath; import one.nem.lacerta.model.document.DocumentDetail; +import one.nem.lacerta.model.document.tag.DocumentTag; import one.nem.lacerta.source.database.LacertaDatabase; import one.nem.lacerta.source.database.common.DateTypeConverter; import one.nem.lacerta.source.database.entity.DocumentEntity; @@ -205,6 +206,36 @@ public class LacertaLibraryImpl implements LacertaLibrary { }); } + @Override + public CompletableFuture> getTagList() { + return null; + } + + @Override + public CompletableFuture createTag(DocumentTag tag) { + return null; + } + + @Override + public CompletableFuture updateTag(DocumentTag tag) { + return null; + } + + @Override + public CompletableFuture deleteTag(String tagId) { + return null; + } + + @Override + public CompletableFuture addTagToDocument(String documentId, String tagId) { + return null; + } + + @Override + public CompletableFuture removeTagFromDocument(String documentId, String tagId) { + return null; + } + /** * 再帰的にパスを解決する * From ea0e52a602809eea326748bdadac6d78c7b27384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:54:47 +0900 Subject: [PATCH 11/43] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/data/impl/LacertaLibraryImpl.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index 9ad8fe81..58640876 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -1,5 +1,7 @@ package one.nem.lacerta.data.impl; +import android.nfc.Tag; + import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.format.DateTimeFormatter; @@ -23,6 +25,7 @@ import one.nem.lacerta.source.database.LacertaDatabase; import one.nem.lacerta.source.database.common.DateTypeConverter; import one.nem.lacerta.source.database.entity.DocumentEntity; import one.nem.lacerta.source.database.entity.FolderEntity; +import one.nem.lacerta.source.database.entity.TagEntity; import one.nem.lacerta.utils.FeatureSwitch; import one.nem.lacerta.utils.LacertaLogger; @@ -206,6 +209,23 @@ public class LacertaLibraryImpl implements LacertaLibrary { }); } + // Converter + private DocumentTag convertTagEntityToDocumentTag(TagEntity tagEntity) { + DocumentTag documentTag = new DocumentTag(); + documentTag.setId(tagEntity.id); + documentTag.setName(tagEntity.tagName); + documentTag.setColor(tagEntity.color); + return documentTag; + } + + private TagEntity convertDocumentTagToTagEntity(DocumentTag documentTag) { + TagEntity tagEntity = new TagEntity(); + tagEntity.id = documentTag.getId(); + tagEntity.tagName = documentTag.getName(); + tagEntity.color = documentTag.getColor(); + return tagEntity; + } + @Override public CompletableFuture> getTagList() { return null; @@ -213,7 +233,9 @@ public class LacertaLibraryImpl implements LacertaLibrary { @Override public CompletableFuture createTag(DocumentTag tag) { - return null; + return CompletableFuture.supplyAsync(() -> { + + }); } @Override From 950e0fe2dcb3d879116689dd797c33460bc8a880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:58:28 +0900 Subject: [PATCH 12/43] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E3=83=A1=E3=82=BD?= =?UTF-8?q?=E3=83=83=E3=83=89=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/data/impl/LacertaLibraryImpl.java | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index 58640876..6d89bb2f 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -26,6 +26,7 @@ import one.nem.lacerta.source.database.common.DateTypeConverter; import one.nem.lacerta.source.database.entity.DocumentEntity; import one.nem.lacerta.source.database.entity.FolderEntity; import one.nem.lacerta.source.database.entity.TagEntity; +import one.nem.lacerta.source.database.entity.ToxiDocumentTagEntity; import one.nem.lacerta.utils.FeatureSwitch; import one.nem.lacerta.utils.LacertaLogger; @@ -234,28 +235,51 @@ public class LacertaLibraryImpl implements LacertaLibrary { @Override public CompletableFuture createTag(DocumentTag tag) { return CompletableFuture.supplyAsync(() -> { - + TagEntity tagEntity = convertDocumentTagToTagEntity(tag); + database.tagDao().insert(tagEntity); + logger.debug("LacertaLibraryImpl", "Database Query: Inserted TagEntity (" + tag.getId() + ")"); + return null; }); } @Override public CompletableFuture updateTag(DocumentTag tag) { - return null; + return CompletableFuture.supplyAsync(() -> { + TagEntity tagEntity = convertDocumentTagToTagEntity(tag); + database.tagDao().update(tagEntity); + logger.debug("LacertaLibraryImpl", "Database Query: Updated TagEntity (" + tag.getId() + ")"); + return null; + }); } @Override public CompletableFuture deleteTag(String tagId) { - return null; + return CompletableFuture.supplyAsync(() -> { + database.tagDao().deleteById(tagId); + logger.debug("LacertaLibraryImpl", "Database Query: Deleted TagEntity (" + tagId + ")"); + return null; + }); } @Override public CompletableFuture addTagToDocument(String documentId, String tagId) { - return null; + CompletableFuture.supplyAsync(() -> { + ToxiDocumentTagEntity toxiDocumentTagEntity = new ToxiDocumentTagEntity(); + toxiDocumentTagEntity.documentId = documentId; + toxiDocumentTagEntity.tagId = tagId; + database.toxiDocumentTagDao().insert(toxiDocumentTagEntity); + logger.debug("LacertaLibraryImpl", "Database Query: Inserted ToxiDocumentTagEntity"); + return null; + }); } @Override public CompletableFuture removeTagFromDocument(String documentId, String tagId) { - return null; + CompletableFuture.supplyAsync(() -> { + database.toxiDocumentTagDao().deleteByDocumentIdAndTagId(documentId, tagId); + logger.debug("LacertaLibraryImpl", "Database Query: Deleted ToxiDocumentTagEntity"); + return null; + }); } /** From 0dad6d30d496bef36be759325650ddd5ac06ccea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 15:59:21 +0900 Subject: [PATCH 13/43] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E3=83=A1=E3=82=BD?= =?UTF-8?q?=E3=83=83=E3=83=89=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/data/impl/LacertaLibraryImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index 6d89bb2f..b6b4aa8e 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -229,7 +229,15 @@ public class LacertaLibraryImpl implements LacertaLibrary { @Override public CompletableFuture> getTagList() { - return null; + return CompletableFuture.supplyAsync(() -> { + List tagEntities = database.tagDao().findAll(); + logger.debug("LacertaLibraryImpl", "Database Query: Get TagEntity List (Size: " + tagEntities.size() + ")"); + ArrayList documentTags = new ArrayList<>(); + for (TagEntity tagEntity : tagEntities) { + documentTags.add(convertTagEntityToDocumentTag(tagEntity)); + } + return documentTags; + }); } @Override From 397244ffddbd4cf8b9fd9553431cdb230b2fcee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:00:07 +0900 Subject: [PATCH 14/43] fix --- .../java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index b6b4aa8e..88ef000f 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -271,7 +271,7 @@ public class LacertaLibraryImpl implements LacertaLibrary { @Override public CompletableFuture addTagToDocument(String documentId, String tagId) { - CompletableFuture.supplyAsync(() -> { + return CompletableFuture.supplyAsync(() -> { ToxiDocumentTagEntity toxiDocumentTagEntity = new ToxiDocumentTagEntity(); toxiDocumentTagEntity.documentId = documentId; toxiDocumentTagEntity.tagId = tagId; @@ -283,7 +283,7 @@ public class LacertaLibraryImpl implements LacertaLibrary { @Override public CompletableFuture removeTagFromDocument(String documentId, String tagId) { - CompletableFuture.supplyAsync(() -> { + return CompletableFuture.supplyAsync(() -> { database.toxiDocumentTagDao().deleteByDocumentIdAndTagId(documentId, tagId); logger.debug("LacertaLibraryImpl", "Database Query: Deleted ToxiDocumentTagEntity"); return null; From f9f395c160f4498193835161116708ff8ac213f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:05:23 +0900 Subject: [PATCH 15/43] =?UTF-8?q?=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/ui/src/main/res/drawable/sell_24px.xml | 10 ++++++++++ shared/ui/src/main/res/drawable/sell_fill24px.xml | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 shared/ui/src/main/res/drawable/sell_24px.xml create mode 100644 shared/ui/src/main/res/drawable/sell_fill24px.xml diff --git a/shared/ui/src/main/res/drawable/sell_24px.xml b/shared/ui/src/main/res/drawable/sell_24px.xml new file mode 100644 index 00000000..a3a97785 --- /dev/null +++ b/shared/ui/src/main/res/drawable/sell_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/shared/ui/src/main/res/drawable/sell_fill24px.xml b/shared/ui/src/main/res/drawable/sell_fill24px.xml new file mode 100644 index 00000000..d87db68b --- /dev/null +++ b/shared/ui/src/main/res/drawable/sell_fill24px.xml @@ -0,0 +1,10 @@ + + + From 48ae5d7ac000eb755408201d5cf66886c50c715e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:06:35 +0900 Subject: [PATCH 16/43] =?UTF-8?q?=E3=82=BF=E3=82=B0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E3=83=95=E3=83=A9=E3=82=B0=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/SettingTagManageFragment.java | 64 +++++++++++++++++++ .../layout/fragment_setting_tag_manage.xml | 14 ++++ 2 files changed, 78 insertions(+) create mode 100644 feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java create mode 100644 feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java new file mode 100644 index 00000000..0cba027d --- /dev/null +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java @@ -0,0 +1,64 @@ +package one.nem.lacerta.setting; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link SettingTagManageFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class SettingTagManageFragment extends Fragment { + + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public SettingTagManageFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment SettingTagManageFragment. + */ + // TODO: Rename and change types and number of parameters + public static SettingTagManageFragment newInstance(String param1, String param2) { + SettingTagManageFragment fragment = new SettingTagManageFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_setting_tag_manage, container, false); + } +} \ No newline at end of file diff --git a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml new file mode 100644 index 00000000..202cac31 --- /dev/null +++ b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file From 994ceb414e3092052b1b74bd25c64bd4dab221be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:06:58 +0900 Subject: [PATCH 17/43] =?UTF-8?q?=E5=BC=95=E6=95=B0=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/SettingTagManageFragment.java | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java index 0cba027d..f3346f14 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java @@ -15,33 +15,13 @@ import android.view.ViewGroup; */ public class SettingTagManageFragment extends Fragment { - // TODO: Rename parameter arguments, choose names that match - // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER - private static final String ARG_PARAM1 = "param1"; - private static final String ARG_PARAM2 = "param2"; - - // TODO: Rename and change types of parameters - private String mParam1; - private String mParam2; - public SettingTagManageFragment() { // Required empty public constructor } - /** - * Use this factory method to create a new instance of - * this fragment using the provided parameters. - * - * @param param1 Parameter 1. - * @param param2 Parameter 2. - * @return A new instance of fragment SettingTagManageFragment. - */ - // TODO: Rename and change types and number of parameters - public static SettingTagManageFragment newInstance(String param1, String param2) { + public static SettingTagManageFragment newInstance() { SettingTagManageFragment fragment = new SettingTagManageFragment(); Bundle args = new Bundle(); - args.putString(ARG_PARAM1, param1); - args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @@ -49,10 +29,6 @@ public class SettingTagManageFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (getArguments() != null) { - mParam1 = getArguments().getString(ARG_PARAM1); - mParam2 = getArguments().getString(ARG_PARAM2); - } } @Override From 7319c8c1a96dfe9179d266601885a0e4c2b4c9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:07:40 +0900 Subject: [PATCH 18/43] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E3=82=B3=E3=83=94=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/fragment_setting_tag_manage.xml | 79 +++++++++++++++++-- 1 file changed, 72 insertions(+), 7 deletions(-) diff --git a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml index 202cac31..dd09f3e6 100644 --- a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml +++ b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml @@ -1,14 +1,79 @@ - + android:background="@color/colorSurface"> - - + android:layout_height="match_parent"> + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From a68ee50e6bdd8c575be31100e82cf20a9cbd3222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:08:42 +0900 Subject: [PATCH 19/43] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/fragment_setting_tag_manage.xml | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml index dd09f3e6..ec0d8f1b 100644 --- a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml +++ b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml @@ -44,32 +44,11 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" > - - - - - - + From cdc3019807ec6f4a56df6dd1acfa3dc02c65377b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:08:53 +0900 Subject: [PATCH 20/43] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/src/main/res/layout/fragment_setting_tag_manage.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml index ec0d8f1b..a05e8fb9 100644 --- a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml +++ b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml @@ -29,7 +29,7 @@ app:layout_scrollFlags="scroll|exitUntilCollapsed"> Date: Thu, 25 Jan 2024 16:13:17 +0900 Subject: [PATCH 21/43] =?UTF-8?q?=E4=BB=AE=E3=82=A2=E3=82=AF=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/SettingTagManageFragment.java | 41 +++++++++++++++++++ .../main/res/menu/setting_tag_manage_menu.xml | 10 +++++ 2 files changed, 51 insertions(+) create mode 100644 feature/setting/src/main/res/menu/setting_tag_manage_menu.xml diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java index f3346f14..5363deee 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java @@ -2,11 +2,14 @@ package one.nem.lacerta.setting; import android.os.Bundle; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; +import androidx.navigation.Navigation; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Toast; /** * A simple {@link Fragment} subclass. @@ -37,4 +40,42 @@ public class SettingTagManageFragment extends Fragment { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_setting_tag_manage, container, false); } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + } + + /** + * ToolbarをInitする + * + * @param toolbar Toolbar + * @param showBackButton 戻るボタンを表示するか + * @param title タイトル + */ + private void toolbarSetup(Toolbar toolbar, boolean showBackButton, String title) { + getActivity().runOnUiThread(() -> { + if (showBackButton) { + toolbar.setNavigationIcon(one.nem.lacerta.shared.ui.R.drawable.arrow_back_24px); + toolbar.setNavigationOnClickListener(v -> { + //this.libraryItemPage = lacertaLibrary.getLibraryPage(this.libraryItemPage.getParentId(), 10).join(); + // Back + Navigation.findNavController(requireView()).popBackStack(); + }); + } else { + toolbar.setNavigationIcon(null); + } + toolbar.setTitle(title); + toolbar.getMenu().clear(); + toolbar.inflateMenu(R.menu.setting_tag_manage_menu); + toolbar.setOnMenuItemClickListener(item -> { + if (item.getItemId() == R.id.setting_tag_manage_menu_add) { + Toast.makeText(getContext(), "Add Clicked", Toast.LENGTH_SHORT).show(); + return true; + } else { + return false; + } + }); + }); + } } \ No newline at end of file diff --git a/feature/setting/src/main/res/menu/setting_tag_manage_menu.xml b/feature/setting/src/main/res/menu/setting_tag_manage_menu.xml new file mode 100644 index 00000000..f012a68b --- /dev/null +++ b/feature/setting/src/main/res/menu/setting_tag_manage_menu.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file From a3a5676136b4e4765283e6498070eb5b5f734b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:14:21 +0900 Subject: [PATCH 22/43] =?UTF-8?q?Fragment=E5=86=85=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/setting/SettingTagManageFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java index 5363deee..c43bf71a 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java @@ -38,7 +38,13 @@ public class SettingTagManageFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_setting_tag_manage, container, false); + View view = inflater.inflate(R.layout.fragment_setting_tag_manage, container, false); + + // Toolbar + Toolbar toolbar = view.findViewById(R.id.tag_manage_toolbar); + toolbarSetup(toolbar, true, "タグ管理"); + + return view; } @Override From 5be465df6768f59c4d3b37dcc1d968db0d813882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:15:22 +0900 Subject: [PATCH 23/43] =?UTF-8?q?=E3=83=8A=E3=83=93=E3=82=B2=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=B0=E3=83=A9=E3=83=95=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/navigation/feature_setting_navigation.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/feature/setting/src/main/res/navigation/feature_setting_navigation.xml b/feature/setting/src/main/res/navigation/feature_setting_navigation.xml index ff08f2a9..4d382d4d 100644 --- a/feature/setting/src/main/res/navigation/feature_setting_navigation.xml +++ b/feature/setting/src/main/res/navigation/feature_setting_navigation.xml @@ -37,6 +37,9 @@ app:exitAnim="@anim/slide_to_left" app:popEnterAnim="@anim/slide_from_left" app:popExitAnim="@anim/slide_to_right" /> + + \ No newline at end of file From a818c59a028fe9110d1081c6dda66d9020d03415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:16:21 +0900 Subject: [PATCH 24/43] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=A1?= =?UTF-8?q?=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=AE=E9=A0=85=E7=9B=AE=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/setting/SettingTopFragment.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java index 6c789b17..364104e0 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java @@ -74,6 +74,15 @@ public class SettingTopFragment extends Fragment { ) ); + settingListItems.add( + new SettingListItem( + "タグ管理", // TODO-rca: リソースに移動 + "タグの追加・編集・削除", // TODO-rca: リソースに移動 + ContextCompat.getDrawable(getContext(), one.nem.lacerta.shared.ui.R.drawable.sell_24px), + R.id.action_settingTopFragment_to_settingTagManageFragment + ) + ); + settingListItems.add( new SettingListItem( getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_about_title), From 28319a60bacd340205e26e485cc294fed41fde85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:17:09 +0900 Subject: [PATCH 25/43] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9=E3=81=AE=E8=89=B2=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/ui/src/main/res/drawable/sell_24px.xml | 2 +- shared/ui/src/main/res/drawable/sell_fill24px.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/ui/src/main/res/drawable/sell_24px.xml b/shared/ui/src/main/res/drawable/sell_24px.xml index a3a97785..60da88d6 100644 --- a/shared/ui/src/main/res/drawable/sell_24px.xml +++ b/shared/ui/src/main/res/drawable/sell_24px.xml @@ -5,6 +5,6 @@ android:viewportHeight="960" android:tint="?attr/colorControlNormal"> diff --git a/shared/ui/src/main/res/drawable/sell_fill24px.xml b/shared/ui/src/main/res/drawable/sell_fill24px.xml index d87db68b..6c9a74d6 100644 --- a/shared/ui/src/main/res/drawable/sell_fill24px.xml +++ b/shared/ui/src/main/res/drawable/sell_fill24px.xml @@ -5,6 +5,6 @@ android:viewportHeight="960" android:tint="?attr/colorControlNormal"> From 1212d5111bf479fcc29297045b60bd17983a9452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:22:54 +0900 Subject: [PATCH 26/43] =?UTF-8?q?=E8=A4=87=E5=90=88=E4=B8=BB=E3=82=AD?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E6=8C=87=E5=AE=9A=E6=96=B9=E6=B3=95=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/database/entity/ToxiDocumentTagEntity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java b/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java index cf0720cf..3e01199c 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java +++ b/source/src/main/java/one/nem/lacerta/source/database/entity/ToxiDocumentTagEntity.java @@ -1,18 +1,18 @@ package one.nem.lacerta.source.database.entity; +import androidx.annotation.NonNull; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.PrimaryKey; -@Entity(tableName = "toxi_document_tag") +@Entity(primaryKeys = {"document_id", "tag_id"}, tableName = "toxi_document_tag") public class ToxiDocumentTagEntity { - // 複合主キー - @PrimaryKey + @NonNull @ColumnInfo(name = "document_id") public String documentId; // ドキュメントID - @PrimaryKey + @NonNull @ColumnInfo(name = "tag_id") public String tagId; // タグID } From b5d7aa4eddbe07736164978204ded229232cd099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:26:25 +0900 Subject: [PATCH 27/43] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/layout/fragment_setting_tag_manage.xml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml index a05e8fb9..7fc105e4 100644 --- a/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml +++ b/feature/setting/src/main/res/layout/fragment_setting_tag_manage.xml @@ -39,19 +39,11 @@ - - - - - - - + app:layout_behavior="@string/appbar_scrolling_view_behavior"/> app:layout_behavior="@string/appbar_scrolling_view_behavior" /> From 0f6412c79234c3c98d30308731f64df398f5f9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:29:04 +0900 Subject: [PATCH 28/43] =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AB,=20=E3=82=A2?= =?UTF-8?q?=E3=83=80=E3=83=97=E3=82=BF=E4=BD=9C=E6=88=90WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/setting/TagListItemAdapter.java | 33 +++++++++++++++++++ .../lacerta/setting/model/TagListItem.java | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java create mode 100644 feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java new file mode 100644 index 00000000..63d599d1 --- /dev/null +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java @@ -0,0 +1,33 @@ +package one.nem.lacerta.setting; + +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +public class TagListItemAdapter extends RecyclerView.Adapter { + + @NonNull + @Override + public TagListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return null; + } + + @Override + public void onBindViewHolder(@NonNull TagListItemViewHolder holder, int position) { + + } + + @Override + public int getItemCount() { + return 0; + } + + public static class TagListItemViewHolder extends RecyclerView.ViewHolder { + + public TagListItemViewHolder(@NonNull View itemView) { + super(itemView); + } + } +} diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java b/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java new file mode 100644 index 00000000..877fb3a6 --- /dev/null +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java @@ -0,0 +1,4 @@ +package one.nem.lacerta.setting.model; + +public class TagListItem { +} From 26b0994343cc484fa0aa9c64fbdced96eb23e6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:30:31 +0900 Subject: [PATCH 29/43] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=91=E3=83=86?= =?UTF-8?q?=E3=82=A3,=20=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9?= =?UTF-8?q?=E3=82=AF=E3=82=BF,=20Getter/Setter=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/setting/model/TagListItem.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java b/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java index 877fb3a6..6b25b8c6 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java @@ -1,4 +1,51 @@ package one.nem.lacerta.setting.model; public class TagListItem { + + String tagId; + String tagName; + String tagDescription; + String tagColor; + + public TagListItem(String tagId, String tagName, String tagDescription, String tagColor) { + this.tagId = tagId; + this.tagName = tagName; + this.tagDescription = tagDescription; + this.tagColor = tagColor; + } + + public TagListItem() { + } + + public String getTagId() { + return tagId; + } + + public void setTagId(String tagId) { + this.tagId = tagId; + } + + public String getTagName() { + return tagName; + } + + public void setTagName(String tagName) { + this.tagName = tagName; + } + + public String getTagDescription() { + return tagDescription; + } + + public void setTagDescription(String tagDescription) { + this.tagDescription = tagDescription; + } + + public String getTagColor() { + return tagColor; + } + + public void setTagColor(String tagColor) { + this.tagColor = tagColor; + } } From 070cfda21d39786c5375f8a0e4b49d53fd6c9815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:30:57 +0900 Subject: [PATCH 30/43] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/setting/model/TagListItem.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java b/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java index 6b25b8c6..bf9796b4 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java @@ -4,13 +4,11 @@ public class TagListItem { String tagId; String tagName; - String tagDescription; String tagColor; - public TagListItem(String tagId, String tagName, String tagDescription, String tagColor) { + public TagListItem(String tagId, String tagName, String tagColor) { this.tagId = tagId; this.tagName = tagName; - this.tagDescription = tagDescription; this.tagColor = tagColor; } @@ -33,14 +31,6 @@ public class TagListItem { this.tagName = tagName; } - public String getTagDescription() { - return tagDescription; - } - - public void setTagDescription(String tagDescription) { - this.tagDescription = tagDescription; - } - public String getTagColor() { return tagColor; } From 165d45ad40328ec92419ec8d271105052221c8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:31:47 +0900 Subject: [PATCH 31/43] =?UTF-8?q?TagListItem=E5=BB=83=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/setting/model/TagListItem.java | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java b/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java deleted file mode 100644 index bf9796b4..00000000 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/model/TagListItem.java +++ /dev/null @@ -1,41 +0,0 @@ -package one.nem.lacerta.setting.model; - -public class TagListItem { - - String tagId; - String tagName; - String tagColor; - - public TagListItem(String tagId, String tagName, String tagColor) { - this.tagId = tagId; - this.tagName = tagName; - this.tagColor = tagColor; - } - - public TagListItem() { - } - - public String getTagId() { - return tagId; - } - - public void setTagId(String tagId) { - this.tagId = tagId; - } - - public String getTagName() { - return tagName; - } - - public void setTagName(String tagName) { - this.tagName = tagName; - } - - public String getTagColor() { - return tagColor; - } - - public void setTagColor(String tagColor) { - this.tagColor = tagColor; - } -} From 2dc3ab6bc63d3c8b42d7fdf16e20edb04ea5726a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:32:41 +0900 Subject: [PATCH 32/43] =?UTF-8?q?=E4=BE=9D=E5=AD=98=E9=96=A2=E4=BF=82?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/setting/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/setting/build.gradle b/feature/setting/build.gradle index 31595be7..3f9a87af 100644 --- a/feature/setting/build.gradle +++ b/feature/setting/build.gradle @@ -45,6 +45,8 @@ dependencies { // shared implementation project(':shared:ui') + implementation project(':model') + // https://mvnrepository.com/artifact/androidx.preference/preference implementation 'androidx.preference:preference:1.2.1' From b44d1b07463652e0c0b4a6a21daf1bc0e3163b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:34:05 +0900 Subject: [PATCH 33/43] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E3=83=95?= =?UTF-8?q?=E3=82=A7=E3=83=BC=E3=82=B9=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/setting/TagListItemSelectListener.java | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemSelectListener.java diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemSelectListener.java b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemSelectListener.java new file mode 100644 index 00000000..df0f7dd0 --- /dev/null +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemSelectListener.java @@ -0,0 +1,6 @@ +package one.nem.lacerta.setting; + +public interface TagListItemSelectListener { + + void onTagListItemSelect(String tagId, String tagName, String tagColor); +} From 3a47cd97fd6eb29d58cfa7d02e14759579155452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:35:18 +0900 Subject: [PATCH 34/43] =?UTF-8?q?=E3=82=A2=E3=83=80=E3=83=97=E3=82=BF?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/setting/TagListItemAdapter.java | 58 ++++++++++++------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java index 63d599d1..482b1198 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java @@ -6,28 +6,44 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import java.util.ArrayList; + +import one.nem.lacerta.model.document.tag.DocumentTag; + public class TagListItemAdapter extends RecyclerView.Adapter { - @NonNull - @Override - public TagListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - return null; - } - - @Override - public void onBindViewHolder(@NonNull TagListItemViewHolder holder, int position) { - - } - - @Override - public int getItemCount() { - return 0; - } - - public static class TagListItemViewHolder extends RecyclerView.ViewHolder { - - public TagListItemViewHolder(@NonNull View itemView) { - super(itemView); - } + ArrayList documentTags; + + TagListItemSelectListener listener; + + public TagListItemAdapter(TagListItemSelectListener listener) { + this.listener = listener; + } + + public void setDocumentTags(ArrayList documentTags) { + this.documentTags = documentTags; + } + + @NonNull + @Override + public TagListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return null; + } + + @Override + public void onBindViewHolder(@NonNull TagListItemViewHolder holder, int position) { + + } + + @Override + public int getItemCount() { + return documentTags == null ? 0 : documentTags.size(); + } + + public static class TagListItemViewHolder extends RecyclerView.ViewHolder { + + public TagListItemViewHolder(@NonNull View itemView) { + super(itemView); } + } } From 74fcc50615ab76fd79bb77542101a8a730c8946a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:36:09 +0900 Subject: [PATCH 35/43] =?UTF-8?q?=E3=83=AA=E3=82=B9=E3=83=88=E3=82=A2?= =?UTF-8?q?=E3=82=A4=E3=83=86=E3=83=A0=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/ui/src/main/res/layout/tag_list_full_item.xml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 shared/ui/src/main/res/layout/tag_list_full_item.xml diff --git a/shared/ui/src/main/res/layout/tag_list_full_item.xml b/shared/ui/src/main/res/layout/tag_list_full_item.xml new file mode 100644 index 00000000..77d9ef65 --- /dev/null +++ b/shared/ui/src/main/res/layout/tag_list_full_item.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file From 71986bb17dae0b158308cefe762206fd8629660b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:38:53 +0900 Subject: [PATCH 36/43] =?UTF-8?q?=E3=83=AA=E3=82=B9=E3=83=88=E3=82=A2?= =?UTF-8?q?=E3=82=A4=E3=83=86=E3=83=A0=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/tag_list_full_item.xml | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/shared/ui/src/main/res/layout/tag_list_full_item.xml b/shared/ui/src/main/res/layout/tag_list_full_item.xml index 77d9ef65..e0c5bc13 100644 --- a/shared/ui/src/main/res/layout/tag_list_full_item.xml +++ b/shared/ui/src/main/res/layout/tag_list_full_item.xml @@ -1,6 +1,45 @@ + android:layout_height="wrap_content" + android:paddingHorizontal="24dp" + android:paddingVertical="16dp"> + + + + + + + + + + + \ No newline at end of file From 7eb87305ead6f21451898bf79df4e4771b28c82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:42:08 +0900 Subject: [PATCH 37/43] =?UTF-8?q?Adapter=E5=AE=9F=E8=A3=85WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/setting/TagListItemAdapter.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java index 482b1198..594e9908 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java @@ -1,7 +1,11 @@ package one.nem.lacerta.setting; +import android.media.Image; +import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; @@ -27,12 +31,20 @@ public class TagListItemAdapter extends RecyclerView.Adapter Date: Thu, 25 Jan 2024 16:42:42 +0900 Subject: [PATCH 38/43] fix --- .../main/java/one/nem/lacerta/setting/TagListItemAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java index 594e9908..539f12cd 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/TagListItemAdapter.java @@ -1,5 +1,6 @@ package one.nem.lacerta.setting; +import android.graphics.Color; import android.media.Image; import android.view.LayoutInflater; import android.view.View; @@ -41,7 +42,7 @@ public class TagListItemAdapter extends RecyclerView.Adapter Date: Thu, 25 Jan 2024 16:44:12 +0900 Subject: [PATCH 39/43] =?UTF-8?q?=E4=BE=9D=E5=AD=98=E9=96=A2=E4=BF=82?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/setting/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/setting/build.gradle b/feature/setting/build.gradle index 3f9a87af..ee4c89b1 100644 --- a/feature/setting/build.gradle +++ b/feature/setting/build.gradle @@ -45,6 +45,8 @@ dependencies { // shared implementation project(':shared:ui') + implementation project(':data') + implementation project(':model') // https://mvnrepository.com/artifact/androidx.preference/preference From 885f1b40c8f49a0c6ddb9e41e68da08d4bc71b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:45:41 +0900 Subject: [PATCH 40/43] =?UTF-8?q?Plugin=E3=81=ABHilt=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/setting/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/setting/build.gradle b/feature/setting/build.gradle index ee4c89b1..db8a19e6 100644 --- a/feature/setting/build.gradle +++ b/feature/setting/build.gradle @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.com.android.library) + id 'com.google.dagger.hilt.android' } android { From 87f6d582dc6859b537e1c98ddb2b81e6d5d2f221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:46:12 +0900 Subject: [PATCH 41/43] =?UTF-8?q?Fragment=E3=81=AE=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=82=92=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/SettingTagManageFragment.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java index c43bf71a..46f96a7a 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTagManageFragment.java @@ -5,19 +5,30 @@ import android.os.Bundle; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.navigation.Navigation; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; +import javax.inject.Inject; + +import dagger.hilt.android.AndroidEntryPoint; +import one.nem.lacerta.data.LacertaLibrary; + /** * A simple {@link Fragment} subclass. * Use the {@link SettingTagManageFragment#newInstance} factory method to * create an instance of this fragment. */ +@AndroidEntryPoint public class SettingTagManageFragment extends Fragment { + @Inject + LacertaLibrary lacertaLibrary; + public SettingTagManageFragment() { // Required empty public constructor } @@ -50,6 +61,20 @@ public class SettingTagManageFragment extends Fragment { @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + + RecyclerView recyclerView = view.findViewById(R.id.tag_item_recycler_view); + TagListItemAdapter adapter = new TagListItemAdapter((tagId, tagName, tagColor) -> { + Toast.makeText(getContext(), "Tag Clicked", Toast.LENGTH_SHORT).show(); + }); + + recyclerView.setAdapter(adapter); + recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + + lacertaLibrary.getTagList().thenAccept(documentTags -> { + adapter.setDocumentTags(documentTags); + adapter.notifyDataSetChanged(); + }); + } /** From c2a8728098e71ba7eb0f862b384014f0eb7334c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:46:55 +0900 Subject: [PATCH 42/43] =?UTF-8?q?=E3=82=BF=E3=82=B0=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=81=AE=E3=83=AC?= =?UTF-8?q?=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/lacerta_dialog_create_tag.xml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 component/common/src/main/res/layout/lacerta_dialog_create_tag.xml diff --git a/component/common/src/main/res/layout/lacerta_dialog_create_tag.xml b/component/common/src/main/res/layout/lacerta_dialog_create_tag.xml new file mode 100644 index 00000000..77d9ef65 --- /dev/null +++ b/component/common/src/main/res/layout/lacerta_dialog_create_tag.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file From b259f11529ded08fc47a0752061ab3b90ff85538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 25 Jan 2024 16:54:01 +0900 Subject: [PATCH 43/43] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/lacerta_dialog_create_tag.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/component/common/src/main/res/layout/lacerta_dialog_create_tag.xml b/component/common/src/main/res/layout/lacerta_dialog_create_tag.xml index 77d9ef65..4e72834f 100644 --- a/component/common/src/main/res/layout/lacerta_dialog_create_tag.xml +++ b/component/common/src/main/res/layout/lacerta_dialog_create_tag.xml @@ -1,6 +1,15 @@ - + android:layout_height="match_parent" + android:orientation="vertical"> - \ No newline at end of file + + + + + + \ No newline at end of file