diff --git a/data/src/main/java/one/nem/lacerta/data/impl/CommonsImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/CommonsImpl.java deleted file mode 100644 index ab3188ef..00000000 --- a/data/src/main/java/one/nem/lacerta/data/impl/CommonsImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package one.nem.lacerta.data.impl; - -import java.nio.file.Path; - -import javax.inject.Inject; - -import one.nem.lacerta.data.repository.Commons; - -import one.nem.lacerta.utils.repository.DeviceInfoUtils; - -public class CommonsImpl implements Commons{ - - @Inject - public CommonsImpl() { - } - - @Inject - DeviceInfoUtils fileUtils; - - public Path getExternalFilesDirPath(String type) { - return fileUtils.getExternalFilesDirPath(type); - } - - public Path getExternalFilesDirPath() { - return fileUtils.getExternalFilesDirPath(); - } - -} diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DebugFuncImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DebugFuncImpl.java deleted file mode 100644 index 6c762747..00000000 --- a/data/src/main/java/one/nem/lacerta/data/impl/DebugFuncImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package one.nem.lacerta.data.impl; - -import org.eclipse.jgit.lib.Repository; - -import javax.inject.Inject; - -import one.nem.lacerta.data.repository.DebugFunc; -import one.nem.lacerta.source.jgit.RepoUtils; - -public class DebugFuncImpl implements DebugFunc { - - @Inject - public DebugFuncImpl() { - } - - @Inject - RepoUtils repoUtils; - - public Repository getOrCreateRepositoryById(String id) { - Repository repo = repoUtils.getRepo(id); // TODO-rca: リポジトリの存在確認をもうすこしなんとかする - if (repo == null) { - repo = repoUtils.createRepo(id); - } -// Repository repo = repoUtils.createRepo(id); // debug - return repo; - } -} diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DeviceMetaImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DeviceMetaImpl.java deleted file mode 100644 index 6fc0bdae..00000000 --- a/data/src/main/java/one/nem/lacerta/data/impl/DeviceMetaImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package one.nem.lacerta.data.impl; - -import android.os.Build; - -import one.nem.lacerta.data.repository.DeviceMeta; -import one.nem.lacerta.data.model.DeviceMetaModel; - -import javax.inject.Inject; - -public class DeviceMetaImpl implements DeviceMeta{ - - @Inject - public DeviceMetaImpl() { - } - - public DeviceMetaModel getDeviceMeta() { - DeviceMetaModel deviceMetaModel = new DeviceMetaModel( - Build.MANUFACTURER, - Build.MODEL, - Build.VERSION.RELEASE, - Build.VERSION.SDK_INT - ); - return deviceMetaModel; - } - -} diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentsImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentsImpl.java deleted file mode 100644 index a0dbe84f..00000000 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentsImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package one.nem.lacerta.data.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.inject.Inject; - -import one.nem.lacerta.data.model.documents.DocumentMeta; -import one.nem.lacerta.data.repository.Documents; - -public class DocumentsImpl implements Documents { - - @Inject - public DocumentsImpl() { - } - - public ArrayList getRecentDocuments(int limit) { - return null; // TODO-rca: - } - - public ArrayList getStarredDocuments(int limit) { - return null; // TODO-rca: - } -} diff --git a/data/src/main/java/one/nem/lacerta/data/impl/SharedPrefImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/SharedPrefImpl.java deleted file mode 100644 index 7bc535fe..00000000 --- a/data/src/main/java/one/nem/lacerta/data/impl/SharedPrefImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package one.nem.lacerta.data.impl; - -import android.content.Context; -import android.content.SharedPreferences; - -import javax.inject.Inject; - -import dagger.hilt.android.qualifiers.ApplicationContext; -import one.nem.lacerta.data.repository.SharedPref; - -import one.nem.lacerta.data.model.shared_pref.enums.SharedPrefType; - -public class SharedPrefImpl implements SharedPref{ - - private final Context applicationContext; - - @Inject - public SharedPrefImpl(@ApplicationContext Context applicationContext) { - this.applicationContext = applicationContext; - } - - @Override - public SharedPreferences getSharedPreferencesByTag(SharedPrefType sharedPrefType) { - return applicationContext.getSharedPreferences(sharedPrefType.getTag(), Context.MODE_PRIVATE); - } -} diff --git a/data/src/main/java/one/nem/lacerta/data/impl/stub/DocumentsImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/stub/DocumentsImpl.java deleted file mode 100644 index ec616dc4..00000000 --- a/data/src/main/java/one/nem/lacerta/data/impl/stub/DocumentsImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package one.nem.lacerta.data.impl.stub; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.UUID; - -import java.util.Date; - -import javax.inject.Inject; - -import one.nem.lacerta.data.model.documents.DocumentMeta; - -import one.nem.lacerta.data.model.documents.enums.DocumentType; - -import one.nem.lacerta.data.repository.Documents; - -public class DocumentsImpl implements Documents { - - @Inject - public DocumentsImpl() { - } - - public ArrayList getRecentDocuments(int limit) { // Generate dummy data - ArrayList documentMetaList = new ArrayList<>(); - for (int i = 0; i < limit; i++) { - DocumentMeta documentMeta = new DocumentMeta(); - documentMeta.id = UUID.randomUUID().toString(); - documentMeta.name = "Document " + i; - documentMeta.created = new Date(); - documentMeta.type = new Random(i).nextInt()/2 == 0 ? DocumentType.OTHER : DocumentType.NOTEBOOK; - documentMeta.tags = new String[] {"tag1", "tag2", "tag3"}; - documentMeta.categories = new String[] {"category1", "category2", "category3"}; - documentMetaList.add(documentMeta); - } - - return documentMetaList; - } - - public ArrayList getStarredDocuments(int limit) { // Generate dummy data - ArrayList documentMetaList = new ArrayList<>(); - for (int i = 0; i < limit; i++) { - DocumentMeta documentMeta = new DocumentMeta(); - documentMeta.id = UUID.randomUUID().toString(); - documentMeta.name = "Document " + i; - documentMeta.created = new Date(); - documentMeta.type = new Random(i).nextInt()/2 == 0 ? DocumentType.OTHER : DocumentType.NOTEBOOK; - documentMeta.tags = new String[] {"tag1", "tag2", "tag3"}; - documentMeta.categories = new String[] {"category1", "category2", "category3"}; - documentMetaList.add(documentMeta); - } - - return documentMetaList; - } - -} diff --git a/data/src/main/java/one/nem/lacerta/data/model/DeviceMetaModel.java b/data/src/main/java/one/nem/lacerta/data/model/DeviceMetaModel.java deleted file mode 100644 index 38231fda..00000000 --- a/data/src/main/java/one/nem/lacerta/data/model/DeviceMetaModel.java +++ /dev/null @@ -1,34 +0,0 @@ -package one.nem.lacerta.data.model; - -public class DeviceMetaModel { - private String DeviceManufacturer; - private String DeviceModel; - private String AndroidVersion; - private int AndroidApiLevel; - - public DeviceMetaModel(String DeviceManufacturer, String DeviceModel, String AndroidVersion, int AndroidApiLevel) { - this.DeviceManufacturer = DeviceManufacturer; - this.DeviceModel = DeviceModel; - this.AndroidVersion = AndroidVersion; - this.AndroidApiLevel = AndroidApiLevel; - } - - // Getters - // TODO-rca: ボイラープレートコードなので削減する - - public String getDeviceManufacturer() { - return DeviceManufacturer; - } - - public String getDeviceModel() { - return DeviceModel; - } - - public String getAndroidVersion() { - return AndroidVersion; - } - - public int getAndroidApiLevel() { - return AndroidApiLevel; - } -} diff --git a/data/src/main/java/one/nem/lacerta/data/model/commons/placeholder b/data/src/main/java/one/nem/lacerta/data/model/commons/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentDetail.java b/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentDetail.java deleted file mode 100644 index 75eaef1e..00000000 --- a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentDetail.java +++ /dev/null @@ -1,8 +0,0 @@ -package one.nem.lacerta.data.model.documents; - -public class DocumentDetail { - // ドキュメントの詳細情報 - private DocumentMeta documentMeta; - - // TODO-rca: ドキュメントの詳細情報を格納するフィールドを追加する -} \ No newline at end of file diff --git a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentMeta.java b/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentMeta.java deleted file mode 100644 index 0cdc9fdf..00000000 --- a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentMeta.java +++ /dev/null @@ -1,107 +0,0 @@ -package one.nem.lacerta.data.model.documents; - -import java.util.Date; - -import one.nem.lacerta.data.model.documents.enums.DocumentType; - -// TODO-rca: Dateをデバイスのロケールに合わせてStringに変換するメソッドを実装する? -public class DocumentMeta { - // ドキュメントのメタ情報 - public String id; // ドキュメントの内部ID(UUIDv4?) - public String name; // ドキュメントの名前 - public DocumentType type; // ドキュメントの種類 - public Date created; // ドキュメントの作成日時 - public String[] tags; // ドキュメントのタグ - public String[] categories; // ドキュメントのカテゴリ - - public DocumentMeta(String id, String name, Date created, DocumentType type, String[] tags, String[] categories) { - this.id = id; - this.name = name; - this.created = created; - this.type = type; - this.tags = tags; - this.categories = categories; - } - - public DocumentMeta() { - this.id = ""; - this.name = ""; - this.created = new Date(); - this.type = DocumentType.OTHER; - this.tags = new String[0]; - this.categories = new String[0]; - } - - // TODO-rca: ボイラープレートコードなので削減する - // Getter - - public String getId() { - return id; - } - - public String getName() { - return name; - } - - public Date getCreated() { - return created; - } - - public DocumentType getType() { - return type; - } - - public String[] getTags() { - return tags; - } - - public String[] getCategories() { - return categories; - } - - // Setter - - public void setId(String id) { - this.id = id; - } - - public void setName(String name) { - if (name == null) { - this.name = ""; - } else { - this.name = name; - } - } - - public void setCreated(Date created) { - if (created == null) { - this.created = new Date(); - } else { - this.created = created; - } - } - - public void setType(DocumentType type) { - if (type == null) { - this.type = DocumentType.OTHER; - } else { - this.type = type; - } - } - - public void setTags(String[] tags) { - if (tags == null) { - this.tags = new String[0]; - } else { - this.tags = tags; - } - } - - public void setCategories(String[] categories) { - if (categories == null) { - this.categories = new String[0]; - } else { - this.categories = categories; - } - } -} diff --git a/data/src/main/java/one/nem/lacerta/data/model/documents/enums/DocumentType.java b/data/src/main/java/one/nem/lacerta/data/model/documents/enums/DocumentType.java deleted file mode 100644 index 634dc608..00000000 --- a/data/src/main/java/one/nem/lacerta/data/model/documents/enums/DocumentType.java +++ /dev/null @@ -1,21 +0,0 @@ -package one.nem.lacerta.data.model.documents.enums; - -public enum DocumentType { - // ドキュメントの種類 - // TODO: ユーザーがドキュメントの種類を追加できるようにする - - // テキスト - TEXTBOOK, - // ノート - NOTEBOOK, - // ワークブック - WORKBOOK, - // レシート - RECEIPT, - // チケット - TICKET, - // メモ - MEMO, - // その他 - OTHER -} diff --git a/data/src/main/java/one/nem/lacerta/data/model/shared_pref/enums/SharedPrefType.java b/data/src/main/java/one/nem/lacerta/data/model/shared_pref/enums/SharedPrefType.java deleted file mode 100644 index c3612dc4..00000000 --- a/data/src/main/java/one/nem/lacerta/data/model/shared_pref/enums/SharedPrefType.java +++ /dev/null @@ -1,17 +0,0 @@ -package one.nem.lacerta.data.model.shared_pref.enums; - -public enum SharedPrefType { - - COMMON("common"), - USERDATA("userdata"); - - private String tag; - - SharedPrefType(String tag) { - this.tag = tag; - } - - public String getTag() { - return tag; - } -} diff --git a/data/src/main/java/one/nem/lacerta/data/module/CommonsModule.java b/data/src/main/java/one/nem/lacerta/data/module/CommonsModule.java deleted file mode 100644 index 632b435f..00000000 --- a/data/src/main/java/one/nem/lacerta/data/module/CommonsModule.java +++ /dev/null @@ -1,16 +0,0 @@ -package one.nem.lacerta.data.module; - -import dagger.Binds; -import dagger.Module; -import dagger.hilt.InstallIn; -import dagger.hilt.components.SingletonComponent; -import one.nem.lacerta.data.repository.Commons; -import one.nem.lacerta.data.impl.CommonsImpl; - -@Module -@InstallIn(SingletonComponent.class) -abstract class CommonsModule { - - @Binds - public abstract Commons bindCommons(CommonsImpl commonsImpl); -} diff --git a/data/src/main/java/one/nem/lacerta/data/module/DebugFuncModule.java b/data/src/main/java/one/nem/lacerta/data/module/DebugFuncModule.java deleted file mode 100644 index def0de38..00000000 --- a/data/src/main/java/one/nem/lacerta/data/module/DebugFuncModule.java +++ /dev/null @@ -1,16 +0,0 @@ -package one.nem.lacerta.data.module; - -import dagger.Binds; -import dagger.Module; -import dagger.hilt.InstallIn; -import dagger.hilt.components.SingletonComponent; -import one.nem.lacerta.data.repository.DebugFunc; -import one.nem.lacerta.data.impl.DebugFuncImpl; - -@Module -@InstallIn(SingletonComponent.class) -abstract class DebugFuncModule { - - @Binds - public abstract DebugFunc bindDebugFunc(DebugFuncImpl debugFuncImpl); -} diff --git a/data/src/main/java/one/nem/lacerta/data/module/DeviceMetaModule.java b/data/src/main/java/one/nem/lacerta/data/module/DeviceMetaModule.java deleted file mode 100644 index 21693156..00000000 --- a/data/src/main/java/one/nem/lacerta/data/module/DeviceMetaModule.java +++ /dev/null @@ -1,19 +0,0 @@ -package one.nem.lacerta.data.module; - -import one.nem.lacerta.data.impl.DeviceMetaImpl; -import one.nem.lacerta.data.repository.DeviceMeta; - -import dagger.Binds; -import dagger.Module; -import dagger.hilt.InstallIn; -// Singleton -import dagger.hilt.components.SingletonComponent; - -@Module -@InstallIn(SingletonComponent.class) -abstract class DeviceMetaModule { - - @Binds - public abstract DeviceMeta bindDeviceMeta(DeviceMetaImpl deviceMetaImpl); - -} diff --git a/data/src/main/java/one/nem/lacerta/data/module/DocumentsModule.java b/data/src/main/java/one/nem/lacerta/data/module/DocumentsModule.java deleted file mode 100644 index d0388035..00000000 --- a/data/src/main/java/one/nem/lacerta/data/module/DocumentsModule.java +++ /dev/null @@ -1,18 +0,0 @@ -package one.nem.lacerta.data.module; - -import dagger.Binds; -import dagger.Module; -import dagger.hilt.InstallIn; -import dagger.hilt.components.SingletonComponent; - -import one.nem.lacerta.data.repository.Documents; -import one.nem.lacerta.data.impl.DocumentsImpl; - -@Module -@InstallIn(SingletonComponent.class) -abstract public class DocumentsModule { - - @Binds - public abstract Documents bindDocuments(DocumentsImpl documentsImpl); - -} diff --git a/data/src/main/java/one/nem/lacerta/data/module/SharedPrefModule.java b/data/src/main/java/one/nem/lacerta/data/module/SharedPrefModule.java deleted file mode 100644 index 1bbb5e42..00000000 --- a/data/src/main/java/one/nem/lacerta/data/module/SharedPrefModule.java +++ /dev/null @@ -1,19 +0,0 @@ -package one.nem.lacerta.data.module; - -import android.content.Context; -import android.content.SharedPreferences; - -import dagger.Binds; -import dagger.Module; -import dagger.hilt.InstallIn; -import dagger.hilt.components.SingletonComponent; -import one.nem.lacerta.data.impl.SharedPrefImpl; -import one.nem.lacerta.data.repository.SharedPref; - -@Module -@InstallIn(SingletonComponent.class) -abstract public class SharedPrefModule { - - @Binds - public abstract SharedPref bindSharedPref(SharedPrefImpl sharedPrefImpl); -} diff --git a/data/src/main/java/one/nem/lacerta/data/repository/Commons.java b/data/src/main/java/one/nem/lacerta/data/repository/Commons.java deleted file mode 100644 index 54d46f07..00000000 --- a/data/src/main/java/one/nem/lacerta/data/repository/Commons.java +++ /dev/null @@ -1,11 +0,0 @@ -package one.nem.lacerta.data.repository; - -import java.nio.file.Path; - -public interface Commons { - - Path getExternalFilesDirPath(String type); - - Path getExternalFilesDirPath(); - -} diff --git a/data/src/main/java/one/nem/lacerta/data/repository/DebugFunc.java b/data/src/main/java/one/nem/lacerta/data/repository/DebugFunc.java deleted file mode 100644 index 5cb2c247..00000000 --- a/data/src/main/java/one/nem/lacerta/data/repository/DebugFunc.java +++ /dev/null @@ -1,9 +0,0 @@ -package one.nem.lacerta.data.repository; - -import org.eclipse.jgit.lib.Repository; - -public interface DebugFunc { - - Repository getOrCreateRepositoryById(String id); - -} diff --git a/data/src/main/java/one/nem/lacerta/data/repository/DeviceMeta.java b/data/src/main/java/one/nem/lacerta/data/repository/DeviceMeta.java deleted file mode 100644 index 586dfdd1..00000000 --- a/data/src/main/java/one/nem/lacerta/data/repository/DeviceMeta.java +++ /dev/null @@ -1,7 +0,0 @@ -package one.nem.lacerta.data.repository; - -import one.nem.lacerta.data.model.DeviceMetaModel; - -public interface DeviceMeta { - DeviceMetaModel getDeviceMeta(); -} \ No newline at end of file diff --git a/data/src/main/java/one/nem/lacerta/data/repository/Documents.java b/data/src/main/java/one/nem/lacerta/data/repository/Documents.java deleted file mode 100644 index 2d2bd2d0..00000000 --- a/data/src/main/java/one/nem/lacerta/data/repository/Documents.java +++ /dev/null @@ -1,15 +0,0 @@ -package one.nem.lacerta.data.repository; - -import java.util.ArrayList; -import java.util.List; - -import one.nem.lacerta.data.model.documents.DocumentDetail; -import one.nem.lacerta.data.model.documents.DocumentMeta; - -public interface Documents { - - ArrayList getRecentDocuments(int limit); - - ArrayList getStarredDocuments(int limit); - -} diff --git a/data/src/main/java/one/nem/lacerta/data/repository/SharedPref.java b/data/src/main/java/one/nem/lacerta/data/repository/SharedPref.java deleted file mode 100644 index fb635fa0..00000000 --- a/data/src/main/java/one/nem/lacerta/data/repository/SharedPref.java +++ /dev/null @@ -1,11 +0,0 @@ -package one.nem.lacerta.data.repository; - -import android.content.SharedPreferences; - -import one.nem.lacerta.data.model.shared_pref.enums.SharedPrefType; - -public interface SharedPref { - - // タグのTypoを防ぐ為にEnumで管理して取得させるやつ - SharedPreferences getSharedPreferencesByTag(SharedPrefType sharedPrefType); -} diff --git a/source/src/main/java/one/nem/lacerta/source/jgit/repository/JGitUtils.java b/source/src/main/java/one/nem/lacerta/source/jgit/repository/JGitUtils.java index 38a931b4..dc0c6318 100644 --- a/source/src/main/java/one/nem/lacerta/source/jgit/repository/JGitUtils.java +++ b/source/src/main/java/one/nem/lacerta/source/jgit/repository/JGitUtils.java @@ -1,4 +1,6 @@ package one.nem.lacerta.source.jgit.repository; public interface JGitUtils { + + }