Compare commits

...
Author SHA1 Message Date
r-ca 153242ef66 WIP 2024-01-22 11:27:56 +09:00
r-ca 05997eafe1 フラグメントからToolBarのアイテムを制御できるようにした 2024-01-22 11:26:11 +09:00
r-ca d6f4885b4a iroiro 2024-01-22 11:08:48 +09:00
r-ca 0b33c60a5a ToolBar削除 2024-01-22 11:04:21 +09:00
r-ca ad3a600e8c ToolBar削除 2024-01-22 11:03:44 +09:00
r-ca 50dfb9be8b ToolBar削除 2024-01-22 11:03:14 +09:00
r-ca fafb996453 ToolBar削除 2024-01-22 11:02:08 +09:00
r-ca e1129bc009 ToolBar削除 2024-01-22 11:02:01 +09:00
r-ca 5752e3285b ToolBar削除 2024-01-22 11:01:57 +09:00
r-ca a2ed78dfb8 プロパティ追加 2024-01-22 10:58:52 +09:00
r-ca 0eadc3c3d5 レイアウト移植 2024-01-22 10:56:19 +09:00
r-ca 6d0b24eb70 レイアウト移植 WIP 2024-01-22 10:54:51 +09:00
ろむねこ 9da41e73aa Merge pull request #90 from lacerta-doc/feature/library/add
Feature/library/add
2024-01-22 10:32:47 +09:00
r-ca 01f28ecd4d ドキュメントを正常に取得できるように 2024-01-22 10:31:26 +09:00
r-ca 2f3a331527 FeatureSwitch切り替え 2024-01-22 10:31:09 +09:00
r-ca 9496c3efbb 依存関係追加 2024-01-22 10:23:08 +09:00
r-ca 93b833f7a9 nullの場合は0を返すように 2024-01-22 10:20:38 +09:00
r-ca 3130be88be getLibraryPage実装WIP 2024-01-22 10:12:21 +09:00
r-ca bb7b628d2f 壊れた実装を削除 2024-01-22 10:00:17 +09:00
r-ca 5f9ea732cf 実装 WIP 2024-01-22 01:24:55 +09:00
r-ca 42f6bc17d3 レイアウトコピー 2024-01-22 01:21:10 +09:00
r-ca 1c6878c3fd コピー 2024-01-22 01:21:00 +09:00
r-ca b5beb7cc15 Adapter修正 2024-01-22 01:20:55 +09:00
r-ca c6fb06ffe2 レイアウトコピー 2024-01-22 01:17:57 +09:00
ろむねこ 95d808dc75 Merge pull request #89 from lacerta-doc/feature/switch
Feature/switch
2024-01-22 01:12:16 +09:00
r-ca b4135f9ec0 リファクタリング 2024-01-21 20:37:04 +09:00
r-ca a62d748c72 ログ追加 2024-01-21 20:35:20 +09:00
r-ca ea0b1a7665 初回起動の場合に初期化処理としてデフォルト値を書き込むように 2024-01-21 20:34:47 +09:00
r-ca 4cfc87a40b 初回起動フラグ追加 2024-01-21 20:32:29 +09:00
r-ca 40a0d08a1f デバッグメニューを無効に 2024-01-21 20:28:56 +09:00
r-ca fd850651b3 実装を単純にした 2024-01-21 20:28:33 +09:00
r-ca ec633a7238 FeatureSwitch実装仮 2024-01-21 20:16:38 +09:00
r-ca e10207959b Merge branch 'develop' into feature/switch 2024-01-21 19:53:55 +09:00
ろむねこ c46ec70d97 Merge pull request #88 from lacerta-doc/fix_versions
compileSDKバージョンを34にアップデート
2024-01-21 19:53:25 +09:00
r-ca 871dfad6c4 compileSDKバージョンを34にアップデート 2024-01-21 19:48:30 +09:00
r-ca 676a0e2772 WIP 2024-01-21 19:45:02 +09:00
r-ca d9d22198d5 FeatureSwitch実装WIP 2024-01-21 19:18:43 +09:00
r-ca 2dc3407217 FeatureSwitchのOverrideができるように 2024-01-21 19:11:25 +09:00
r-ca d40f61928c 依存関係追加 2024-01-21 19:10:03 +09:00
r-ca 19ff824591 Enum追加 2024-01-21 19:09:37 +09:00
r-ca ec7adbe331 SharedPrefUtilsメソッド追加 2024-01-21 19:07:33 +09:00
r-ca af626f4dc0 依存関係追加 2024-01-21 19:04:01 +09:00
r-ca acea8ba27d Revert "依存関係追加"
This reverts commit 8f1849591d.
2024-01-21 19:03:45 +09:00
r-ca 8f1849591d 依存関係追加 2024-01-21 19:02:33 +09:00
r-ca 882207682f FeatureSwitchクラス作成 WIP 2024-01-21 18:56:15 +09:00
ろむねこ 0be12e73a8 Merge pull request #87 from lacerta-doc/component/viewer/1
ビューワー実装 WIP
2024-01-21 18:49:50 +09:00
r-ca f0b4cc556e 正常に画像を取得できるように 2024-01-21 18:45:51 +09:00
r-ca 8c71dedd85 XmlMetaのパース処理を修正 2024-01-21 18:44:26 +09:00
r-ca c1151b778c 画像の表示時にアニメーションするように 2024-01-21 17:56:52 +09:00
r-ca 10e3093c53 レイアウト調整 2024-01-21 17:56:07 +09:00
r-ca 9ef49e0226 レイアウト調整 2024-01-21 17:55:51 +09:00
r-ca a8ce70e6d9 レイアウト調整 2024-01-21 17:54:52 +09:00
r-ca 2f9777f1f4 adjustViewBounds 2024-01-21 17:53:56 +09:00
r-ca 0a867051f2 パス修正 2024-01-21 16:43:51 +09:00
r-ca 673918771c XmlMetaを正常に更新できるようにした 2024-01-21 16:36:52 +09:00
r-ca df14850df1 メソッドチェーン対応 2024-01-21 16:34:07 +09:00
r-ca 28cae3fa19 メソッドチェーン対応WIP 2024-01-21 16:33:26 +09:00
r-ca c167d83940 引数変更 2024-01-21 16:28:06 +09:00
r-ca 722a3d8c7b Xmlを保存できるようにした 2024-01-21 16:26:56 +09:00
r-ca d7f22c8e36 nullをキャッチするようにした 2024-01-21 16:15:11 +09:00
r-ca 0da5e8a961 WIP 2024-01-21 15:43:09 +09:00
r-ca c45847ecd2 NavigationComponent廃止 2024-01-21 15:31:06 +09:00
r-ca d6faf8ec16 ナビゲーショングラフに追加 2024-01-21 15:23:51 +09:00
r-ca 3e21b0ea1c Hiltをプラグインとして追加 2024-01-21 15:18:21 +09:00
r-ca a8e15d8e18 リスナに対応するイベントを実装 2024-01-21 15:17:43 +09:00
r-ca 50eeaa03bf 不要な実装を削除 2024-01-21 15:16:29 +09:00
r-ca f5b94e0f6a コンストラクタに追加 2024-01-21 15:16:18 +09:00
r-ca e9145d491c インターフェース作成 2024-01-21 15:15:35 +09:00
r-ca cb662fe1ff WIP 2024-01-21 15:13:53 +09:00
r-ca 8ad3150f33 コールバックインターフェース作成 2024-01-21 15:10:52 +09:00
r-ca 5cc718e35d Setter, コンストラクタ追加 2024-01-21 15:06:48 +09:00
r-ca 0accd4fa79 Merge branch 'develop' into component/viewer/1 2024-01-21 15:04:37 +09:00
ろむねこ 5840c0126e Merge pull request #86 from lacerta-doc/fix/async
非同期化
2024-01-21 15:03:21 +09:00
r-ca 017a2413b6 挿入時にアニメーションが発生するように 2024-01-20 23:51:34 +09:00
r-ca c53c4ed9a1 Debug 2024-01-20 23:51:20 +09:00
r-ca 12ba9234a4 遅れて追加されたアイテムをUIに反映できるように 2024-01-20 23:49:13 +09:00
r-ca aaff0be438 Debug 2024-01-20 23:40:32 +09:00
r-ca 11e32572ef エラー回避(暫定, 廃止予定) 2024-01-20 23:30:14 +09:00
r-ca ce3f9ebfd7 エラー回避(暫定, 廃止予定) 2024-01-20 23:30:09 +09:00
r-ca 1b70b444f2 コンストラクタ追加 2024-01-20 23:23:54 +09:00
r-ca 7214da80fa 仮置きを非同期に 2024-01-20 23:19:20 +09:00
r-ca 4e5aab276a getRecentDocumentを非同期に 2024-01-20 23:17:31 +09:00
r-ca 4ab13508c4 InterfaceをCompletableFutureに変更 2024-01-20 23:08:49 +09:00
r-ca df22a754b7 ProgressDialogをShowしていなかったので修正 2024-01-20 23:07:17 +09:00
r-ca 9efecab4b6 コンストラクタ追加 2024-01-20 23:00:57 +09:00
r-ca 9aea4bb90e LacertaLibraryのスタブを廃止 2024-01-20 23:00:21 +09:00
r-ca 5c17f96d3d ドキュメントを非同期で取得できるようにした WIP 2024-01-20 22:59:00 +09:00
r-ca d47c6d0cc8 修正 2024-01-20 22:40:59 +09:00
r-ca 176160cd8f createDocument修正 2024-01-20 22:40:03 +09:00
r-ca e6a4393b6d 非同期化 2024-01-20 22:39:35 +09:00
r-ca acc5b166d5 CompletableFeatureを使用して処理するように 2024-01-20 22:24:12 +09:00
r-ca 1d2f3345df CompletableFeatureを使用して処理するように 2024-01-20 22:22:59 +09:00
r-ca b63e9a6747 テスト 2024-01-20 17:46:23 +09:00
r-ca 1f8b56bc78 依存関係追加 2024-01-20 17:45:42 +09:00
r-ca dc9a6bfd9b iroiro 2024-01-20 17:43:23 +09:00
r-ca a825ad6a36 アダプタ実装 2024-01-20 17:39:21 +09:00
r-ca dd1be73904 アダプタ作成 WIP 2024-01-20 17:37:26 +09:00
r-ca 7156bc417c モデル作成 2024-01-20 17:35:57 +09:00
r-ca d9c46898ab 依存関係追加 2024-01-20 17:29:24 +09:00
r-ca 19ce9cbd7e レイアウト修正 WIP 2024-01-20 17:27:28 +09:00
r-ca 584556faca レイアウトコピー 2024-01-20 17:26:59 +09:00
r-ca 028ca6303a 引数追加 2024-01-20 17:25:44 +09:00
r-ca 76734de987 引数削除 2024-01-20 17:24:32 +09:00
r-ca 646a97e77b Arg取得 WIP 2024-01-20 17:21:48 +09:00
r-ca 1aa41eb638 依存関係追加 2024-01-20 17:19:50 +09:00
r-ca 2a34100bf2 NavHost追加 2024-01-20 17:15:39 +09:00
r-ca 5d33d188bd ComponentViewerTopFragment作成 2024-01-20 17:13:27 +09:00
r-ca 8343ba9c2d 依存関係追加 2024-01-20 17:11:44 +09:00
r-ca 95cbfdf42c ナビゲーショングラフ作成 2024-01-20 17:10:30 +09:00
r-ca 7e72cbef54 アクティビティ作成 2024-01-20 17:06:28 +09:00
ろむねこ a7642795ca Merge pull request #85 from lacerta-doc/feature/settings/create
設定画面の骨組みを作成
2024-01-20 16:31:49 +09:00
r-ca f392991988 アニメーションのDurationを変更 2024-01-20 16:18:15 +09:00
r-ca 556c7d0841 アニメーションを全部に追加 2024-01-20 16:14:36 +09:00
r-ca d43bcf09b2 UI調整 2024-01-20 16:13:42 +09:00
r-ca 6120427400 カラーリソース追加 2024-01-20 16:10:46 +09:00
r-ca 2b087a4c45 アイコン背景色変更 2024-01-20 16:06:57 +09:00
r-ca 457e58264b Stringリソースからタイトルを取得するように 2024-01-20 16:05:55 +09:00
r-ca 4d5d02c794 アイコン変更 2024-01-20 16:02:57 +09:00
r-ca b8f3b016b7 メニューに追加 2024-01-20 16:00:10 +09:00
r-ca b6307f67ce ナビゲーションに追加 2024-01-20 15:59:21 +09:00
r-ca 1e8dec3021 引数削除 2024-01-20 15:58:12 +09:00
r-ca 86d290b217 引数削除 2024-01-20 15:57:55 +09:00
r-ca 02d26f864d 引数削除 2024-01-20 15:57:34 +09:00
r-ca 5aa6c975da スキャンページフラグメント作成 2024-01-20 15:56:49 +09:00
r-ca 7075fc710d Dataページフラグメント作成 2024-01-20 15:56:14 +09:00
r-ca ba0cb871a4 Display設定ページフラグメント作成 2024-01-20 15:55:43 +09:00
r-ca 95a2a44cb1 ハイフン削除 2024-01-20 15:54:51 +09:00
r-ca fd65b17921 Drawable追加 2024-01-20 15:54:13 +09:00
r-ca a3f469b466 アニメーションを追加 テスト 2024-01-20 15:50:03 +09:00
r-ca e86129295a Durationを200msに変更 2024-01-20 15:49:53 +09:00
r-ca f4c46fbd5d アイテムをタッチしたら画面推移するように 2024-01-20 15:40:52 +09:00
r-ca 439b76f8bf Stringリソースを参照するように 2024-01-20 15:38:59 +09:00
r-ca ffd455c6d8 Stringリソースを参照するように 2024-01-20 15:38:13 +09:00
r-ca 29c3fddd14 Stringリソース追加 2024-01-20 15:37:55 +09:00
r-ca 516a55e4e0 ボトムナビゲーションに追加 2024-01-20 15:29:09 +09:00
r-ca 68e4d0639a メインナビゲーションにinclude 2024-01-20 15:28:08 +09:00
r-ca db26e639e6 テスト用にアイテム追加 2024-01-20 15:27:39 +09:00
r-ca 32cd27997c モデル変更 2024-01-20 15:27:11 +09:00
r-ca 6fb8091754 ナビゲーショングラフに追加 2024-01-20 15:24:58 +09:00
r-ca 0d7d47ea10 引数削除 2024-01-20 15:24:37 +09:00
r-ca 3d544fa423 フラグメント生成 2024-01-20 15:23:56 +09:00
r-ca 487451712e ナビゲーショングラフ生成 2024-01-20 15:22:23 +09:00
r-ca e78718ab79 id修正 2024-01-20 15:20:09 +09:00
r-ca 35c58e14ad インポート修正 2024-01-20 15:19:00 +09:00
r-ca 4efad853f7 アダプタ実装 2024-01-20 15:18:39 +09:00
r-ca 6c22050906 設定画面のリストアイテム用モデル作成 2024-01-20 15:18:32 +09:00
r-ca 17dc90162b ファイル移動 2024-01-20 15:14:16 +09:00
r-ca 72933fd45b ファイル移動 2024-01-20 15:13:49 +09:00
r-ca c8c0e37052 リネーム 2024-01-20 15:11:59 +09:00
r-ca 7b6d8e3a18 レイアウトコピー 2024-01-20 15:10:52 +09:00
r-ca 6167c412c7 依存関係追加 2024-01-20 15:10:00 +09:00
r-ca 226f09f8bb 引数削除 2024-01-20 15:09:13 +09:00
r-ca 0c4ba99a07 TopFragment作成 2024-01-20 15:08:44 +09:00
r-ca 097adebd9b .idea 2024-01-20 15:07:51 +09:00
r-ca 03a75a5b29 依存関係に追加 2024-01-20 15:07:45 +09:00
r-ca 0c6e2b1a98 settingモジュール作成 2024-01-20 15:07:07 +09:00
ろむねこ a7b92120ba Merge pull request #84 from lacerta-doc/feature/home/fix
ホーム画面改修
2024-01-20 15:06:00 +09:00
r-ca 3f78dccf3b コード整理 2024-01-20 15:02:17 +09:00
r-ca c6ddd6fd03 なんかもう全部変えた 2024-01-19 20:09:26 +09:00
r-ca eab00983a8 色変更 2024-01-19 18:46:06 +09:00
r-ca 038c526652 いろいろ 2024-01-19 18:43:26 +09:00
r-ca 704c128801 いろいろ 2024-01-19 18:43:22 +09:00
r-ca 209eab0755 ListItemAdapter実装 WIP 2024-01-19 18:28:26 +09:00
r-ca 65d48d03fd 依存関係に追加 2024-01-19 18:23:08 +09:00
r-ca dcd5f1b650 Placeholderテキスト追加 2024-01-19 18:19:51 +09:00
r-ca a74eb821f8 レイアウト作成 WIP 2024-01-19 18:19:42 +09:00
r-ca 738d8a055c 依存関係追加 2024-01-19 18:15:45 +09:00
r-ca 2e5559df88 WIP 2024-01-19 18:00:45 +09:00
r-ca dc1cc429e9 ドロワーを廃止 2024-01-19 17:47:57 +09:00
r-ca 339566b243 ドロワーを廃止 2024-01-19 17:46:33 +09:00
r-ca 0e1d4703e5 Revert "Revert "Revert "テスト"""
This reverts commit bcaa0e5c5c.
2024-01-19 17:42:55 +09:00
r-ca bcaa0e5c5c Revert "Revert "テスト""
This reverts commit cbc1d139af.
2024-01-19 17:35:55 +09:00
r-ca cbc1d139af Revert "テスト"
This reverts commit ef48223d46.
2024-01-19 17:27:43 +09:00
r-ca ef48223d46 テスト 2024-01-19 17:27:38 +09:00
r-ca 81ba96a3d0 WIP 2024-01-19 16:51:20 +09:00
r-ca 80104a2285 テスト用のリソース追加 2024-01-19 16:43:45 +09:00
r-ca b9973b845f WIP 2024-01-19 16:00:37 +09:00
r-ca a325ace6f3 レイアウト訂正 WIP 2024-01-19 15:51:03 +09:00
r-ca 7a2beececc レイアウト訂正 WIP 2024-01-19 15:49:23 +09:00
r-ca 4b5ce622fd 一旦コメントアウト(ビルドエラー回避) 2024-01-19 15:45:33 +09:00
r-ca 5d8b9f338d CollapsingToolBar実装テスト 2024-01-19 15:45:18 +09:00
r-ca 9d2e5dd217 ConstraintLayoutに変更 2024-01-19 15:37:15 +09:00
ろむねこ 9ad6a6291d Merge pull request #82 from lacerta-doc/improve/extract_resource_1
テキストリソースを抽出 1
2024-01-19 15:32:45 +09:00
r-ca 4235030986 外部リソースを使うように 2024-01-19 15:27:51 +09:00
r-ca c60fedeb87 WIP 2024-01-19 15:26:57 +09:00
r-ca 2f18134581 WIP 2024-01-19 15:25:28 +09:00
ろむねこ 4101f75685 Merge pull request #81 from lacerta-doc/refactor/refactor1
リファクタリング
2024-01-19 15:20:52 +09:00
r-ca 184771c92d リソースを切り出す準備 2024-01-19 15:19:15 +09:00
r-ca 3e12f1222b ナビゲーションの並び順を変更 2024-01-19 15:17:44 +09:00
r-ca 29f2749cb7 整形 2024-01-19 15:16:20 +09:00
r-ca 244b2fb123 リファクタリング 2024-01-19 15:15:46 +09:00
r-ca 725d541316 リファクタリング 2024-01-19 15:14:08 +09:00
r-ca fc712a131a Revert "utilsを依存関係に追加, LoggerをInject"
This reverts commit 42eb3d4c80.
2024-01-19 15:07:35 +09:00
r-ca cc7b0dc5d1 Revert "utilsを依存関係に追加, LoggerをInject"
This reverts commit 169a6c6e0a.
2024-01-19 15:07:34 +09:00
r-ca 169a6c6e0a utilsを依存関係に追加, LoggerをInject 2024-01-19 15:07:27 +09:00
r-ca 42eb3d4c80 utilsを依存関係に追加, LoggerをInject 2024-01-19 15:07:23 +09:00
r-ca 1c87b73a5b テスト用に設置していたトーストを削除 2024-01-19 15:05:44 +09:00
ろむねこ 46f119b531 Merge pull request #80 from lacerta-doc/improve/bottom_nav_color
システムナビゲーションの色をUIにあわせるようにした
2024-01-19 15:02:32 +09:00
r-ca def799bbe6 APIレベル27以上でシステムナビゲーションのアイコン色を適切に変更できるようにした 2024-01-19 15:01:20 +09:00
r-ca defc051436 システムナビゲーションの背景をボトムナビゲーションと同じに 2024-01-19 14:56:44 +09:00
r-ca de9b68de87 Revert "依存関係追加"
This reverts commit 802e4cc75a.
2024-01-19 14:50:20 +09:00
r-ca 802e4cc75a 依存関係追加 2024-01-19 14:48:17 +09:00
ろむねこ abc91b79ee Merge pull request #79 from lacerta-doc/feature/search/add_ui
Feature/search/add UI
2024-01-19 14:24:03 +09:00
Fuchimoto1234 b601b28f81 search UI 2024-01-19 12:49:33 +09:00
Fuchimoto1234 853ac1eca3 search UI 2024-01-19 12:42:04 +09:00
Fuchimoto1234 834bc35318 search UI 2024-01-19 12:30:17 +09:00
Fuchimoto1234 1e3a3262a4 search UI 2024-01-19 12:11:56 +09:00
r-ca 475c511d32 hotfix 2024-01-18 18:23:14 +09:00
r-ca 474d6417c9 hotfix: Adapterの初期化処理修正 2024-01-18 18:22:10 +09:00
r-ca c7e141b892 hotfix: 型の変更に追従 2024-01-18 18:21:01 +09:00
ろむねこ 3d2cc5ac05 Merge pull request #78 from lacerta-doc/feature/home/add_document_history
ドキュメント履歴をホームに追加
2024-01-18 18:19:49 +09:00
r-ca 73c310ee01 hotfix: 型の変更に追従 2024-01-18 18:16:44 +09:00
ろむねこ 5c3d811979 Merge pull request #77 from lacerta-doc/feature/lacerta_library_recent
Feature/lacerta library recent
2024-01-18 18:12:18 +09:00
ろむねこ f5bc740f58 Merge pull request #76 from lacerta-doc/feature/scan_and_save_document
Feature/scan and save document
2024-01-18 18:11:21 +09:00
r-ca 8a57331d32 メニューに検索を追加 2024-01-18 14:33:27 +09:00
r-ca abdca108d4 ナビゲーショングラフに追加 2024-01-18 14:32:57 +09:00
r-ca 8b66646e7d ナビゲーショングラフ作成 2024-01-18 14:32:36 +09:00
r-ca c9160a2df0 依存関係修正 2024-01-18 14:31:52 +09:00
r-ca c5b0a33720 Revert "ナビゲーショングラフ作成"
This reverts commit 13f31017f7.
2024-01-18 14:31:30 +09:00
r-ca 13f31017f7 ナビゲーショングラフ作成 2024-01-18 14:30:22 +09:00
r-ca e6778e6214 フラグメント作成 2024-01-18 14:29:29 +09:00
Fuchimoto1234 71f9be77cd fix 2024-01-17 12:58:25 +09:00
r-ca e0d63122bd getRecentDocument実装 2024-01-17 12:52:13 +09:00
r-ca 1c3fdf921d Dao追加 2024-01-17 12:52:05 +09:00
Fuchimoto1234 d07e63f534 Merge branch 'develop' into feature/home/add_document_history
# Conflicts:
#	data/src/main/java/one/nem/lacerta/data/Document.java
#	data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java
2024-01-17 12:42:55 +09:00
Fuchimoto1234 5160411c76 fix 2024-01-17 12:41:31 +09:00
Fuchimoto1234 20d30e338e wip 2024-01-17 12:35:30 +09:00
r-ca 3be6185c21 getRecentDocumentの戻り値を変更 2024-01-17 12:15:47 +09:00
r-ca c82952f397 スキーマ更新, Dao更新 2024-01-17 12:11:12 +09:00
r-ca 8c9dc14f16 DBスキーマアップデート 2024-01-17 12:09:27 +09:00
r-ca d22644e37a 依存関係に追加 2024-01-17 12:08:54 +09:00
r-ca c80576d046 修正 2024-01-17 12:08:45 +09:00
r-ca b7cb4369d1 クエリ追加 2024-01-17 12:08:24 +09:00
r-ca 2cfab24c76 Injection追加 2024-01-17 12:07:28 +09:00
r-ca 55b34d964c Folderをデータベースに保存するように WIP 2024-01-17 12:07:18 +09:00
r-ca 744a2bef65 actionを追加するように WIP 2024-01-17 11:25:41 +09:00
r-ca 74becab37b デバッグ用のログポイント追加 2024-01-17 11:09:33 +09:00
r-ca 58d6ae17c6 タイミングの都合でエラーが出るのでloggerを使わないように 2024-01-17 11:07:54 +09:00
r-ca dea5f240f0 ドキュメント新規保存のロジックを実装 WIP 2024-01-17 11:05:25 +09:00
r-ca 119771a7f9 コメント追加, デバッグ用の実装を追加 2024-01-17 11:00:20 +09:00
r-ca b6a30d5cbf Document実装 2024-01-17 10:57:08 +09:00
r-ca 2ec4b96c14 Vcs変更 2024-01-17 10:55:39 +09:00
r-ca 151911d0b2 バージョンコード更新 2024-01-17 10:46:55 +09:00
r-ca d832438f8f Vcs実装 2024-01-17 10:46:31 +09:00
r-ca 0487553f3b Dao追加 2024-01-17 10:40:01 +09:00
r-ca 678c9730ef Dao追加 2024-01-17 10:39:17 +09:00
r-ca e1b43a5f22 EntityにisIncludedを追加 2024-01-17 10:37:42 +09:00
r-ca d384347e0a Merge branch 'develop' into feature/scan_and_save_document 2024-01-17 10:31:28 +09:00
r-ca 8faaf1e84a hotfix: 起動できないので暫定で修正 2024-01-16 13:01:35 +09:00
ろむねこ a81d79a972 Merge pull request #75 from lacerta-doc/refactor/refactoring2
リファクタリング
2024-01-16 12:59:08 +09:00
ろむねこ cc62529224 Merge pull request #74 from lacerta-doc/r-ca-patch-2
Create PULL_REQUEST_TEMPLATE.md
2024-01-16 12:42:06 +09:00
ろむねこ 2d686ce776 Create PULL_REQUEST_TEMPLATE.md 2024-01-16 12:41:50 +09:00
r-ca a61c044391 新ドキュメントを生成できるように 2024-01-16 12:36:28 +09:00
r-ca bc19dd22d8 DocumentMetaにコンストラクタを追加 2024-01-16 12:35:19 +09:00
Fuchimoto1234 a5efab5838 アイテムのレイアウトを作成 2023-12-20 10:00:16 +09:00
Fuchimoto1234 f186064f6e 途中 2023-12-19 12:56:31 +09:00
Fuchimoto1234 59a35cbb4a 依存関係追加 2023-12-19 10:36:27 +09:00
Fuchimoto1234 a78e60416d 依存関係追加 2023-12-19 10:34:31 +09:00
Fuchimoto1234 ac5a950ce3 依存関係追加 2023-12-18 15:16:57 +09:00
120 changed files with 2955 additions and 528 deletions

No files matched your search

+2 -2
View File
@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2023-12-18T03:36:14.973846Z">
<DropdownSelection timestamp="2024-01-20T07:15:21.179573376Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=ZY22H7V3G7" />
<DeviceId pluginId="LocalEmulator" identifier="path=/home/rca/.android/avd/Pixel_3a_API_34_extension_level_7_x86_64.avd" />
</handle>
</Target>
</DropdownSelection>
+1
View File
@@ -22,6 +22,7 @@
<option value="$PROJECT_DIR$/feature/library" />
<option value="$PROJECT_DIR$/feature/scan" />
<option value="$PROJECT_DIR$/feature/search" />
<option value="$PROJECT_DIR$/feature/setting" />
<option value="$PROJECT_DIR$/model" />
<option value="$PROJECT_DIR$/processor" />
<option value="$PROJECT_DIR$/shared" />
-1
View File
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
+18
View File
@@ -0,0 +1,18 @@
# 概要
<!-- PRの概要 -->
# 関連Issue
- #000 <!-- 関連するIssueを指定(なければ省略可) -->
# 詳細
<!-- 詳細 -->
# 影響箇所
<!-- 予想される影響箇所 -->
# チェック
<!-- 参考用, 全てにチェックがついている必要があるわけではありません -->
- [ ] 機能として完成している
- [ ] WIP(Work in progress: 作業中)
- [ ] 正常にビルド/起動ができる
- [ ] 既存の機能を壊していない
+14 -24
View File
@@ -59,30 +59,6 @@ dependencies {
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
// 内部モジュール
// Feature
implementation project(':feature:home')
implementation project(':feature:search')
implementation project(':feature:library')
implementation project(':feature:scan')
implementation project(':feature:debug') // デバッグメニュー
// // Component
// implementation project(':component:common')
// implementation project(':component:scanner')
// implementation project(':component:viewer')
// // Data
// implementation project(':data:repository')
//
// // Source
// implementation project(':data:source:database')
// implementation project(':data:source:preference')
//
implementation project(':data')
implementation project(':shared:ui')
// Hilt (DI)
implementation libs.com.google.dagger.hilt.android
annotationProcessor libs.com.google.dagger.hilt.compiler
@@ -92,4 +68,18 @@ dependencies {
implementation libs.navigation.ui
implementation libs.navigation.dynamic.features.fragment
// Feature
implementation project(':feature:home')
implementation project(':feature:search')
implementation project(':feature:library')
implementation project(':feature:scan')
implementation project(':feature:debug') // デバッグメニュー
implementation project(':feature:setting') // 設定画面
implementation project(':data')
implementation project(':shared:ui')
implementation project(':model')
implementation project(':utils')
}
@@ -1,6 +1,7 @@
package one.nem.lacerta;
import android.app.Application;
import android.util.Log;
import com.google.android.material.color.DynamicColors;
@@ -12,7 +13,13 @@ public class LacertaApplication extends Application {
public void onCreate() {
super.onCreate();
// DynamicColorを有効化
DynamicColors.applyToActivitiesIfAvailable(this);
if (DynamicColors.isDynamicColorAvailable()) {
Log.d("DynamicColors", "DynamicColors is available. Applying to activities...");
DynamicColors.applyToActivitiesIfAvailable(this);
} else {
Log.d("DynamicColors", "DynamicColors is not available.");
}
}
}
@@ -1,40 +1,123 @@
package one.nem.lacerta;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.navigation.NavController;
import androidx.navigation.fragment.NavHostFragment;
import androidx.navigation.ui.NavigationUI;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import one.nem.lacerta.model.pref.FeatureSwitchOverride;
import one.nem.lacerta.utils.FeatureSwitch;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import java.io.NotActiveException;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.utils.repository.SharedPrefUtils;
import javax.inject.Inject;
@AndroidEntryPoint
public class MainActivity extends AppCompatActivity {
@Inject
SharedPrefUtils sharedPrefUtils;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Debug
FragmentManager supportFragmentManager = getSupportFragmentManager();
NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment);
NavController navController = navHostFragment.getNavController();
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav);
NavigationUI.setupWithNavController(bottomNavigationView, navController);
// Initialize app
if (sharedPrefUtils.getIsFirstLaunch()) initializeApp();
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
// Init navigation
try {
FragmentManager supportFragmentManager = getSupportFragmentManager();
NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment);
assert navHostFragment != null;
NavController navController = navHostFragment.getNavController();
NavigationUI.setupWithNavController(bottomNavigationView, navController);
}
catch (Exception e) {
Log.e("Init", "Failed to init navigation");
Log.e("Init", "Searchable Error code: " + "894b5941-3bc0-46fe-b752-0dbc88be29a8");
Toast.makeText(this, "Failed to init navigation", Toast.LENGTH_LONG).show();
finish(); // Exit app
}
// Apply feature switch
applyFeatureSwitch(bottomNavigationView, FeatureSwitchOverride.ENABLE_SEARCH, FeatureSwitch.FeatureMaster.enableSearch, one.nem.lacerta.feature.search.R.id.feature_search_navigation);
applyFeatureSwitch(bottomNavigationView, FeatureSwitchOverride.ENABLE_DEBUG_MENU, FeatureSwitch.FeatureMaster.enableDebugMenu, one.nem.lacerta.feature.debug.R.id.feature_debug_navigation);
// Set navigation bar color
getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer));
// Set status bar color
getWindow().setStatusBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurface));
// Set app bar color
AppBarLayout appBarLayout = findViewById(R.id.app_bar_layout);
appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) {
// Collapsed
getWindow().setStatusBarColor(ContextCompat.getColor(getApplicationContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer));
} else if (verticalOffset == 0) {
// Expanded
getWindow().setStatusBarColor(ContextCompat.getColor(getApplicationContext(), one.nem.lacerta.shared.ui.R.color.colorSurface));
} else {
// Somewhere in between
// Here you can add a color transition if you want
}
}
});
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
}
// Public
public void setActionBarTitle(String title) {
getSupportActionBar().setTitle(title);
}
public void setActionBarBackButton(boolean isEnabled) {
getSupportActionBar().setDisplayHomeAsUpEnabled(isEnabled);
}
public void setActionBarMenuItem(int itemId, boolean isEnabled) {
}
private void initializeApp() {
Log.d("Init", "Initializing app");
// Set feature switch override to default value
sharedPrefUtils.setFeatureSwitchOverride(FeatureSwitchOverride.ENABLE_SEARCH, FeatureSwitch.FeatureMaster.enableSearch);
sharedPrefUtils.setFeatureSwitchOverride(FeatureSwitchOverride.ENABLE_DEBUG_MENU, FeatureSwitch.FeatureMaster.enableDebugMenu);
// Set isFirstLaunch to false
sharedPrefUtils.setIsFirstLaunch(false);
}
private void applyFeatureSwitch(BottomNavigationView bottomNavigationView, FeatureSwitchOverride featureSwitchOverride, boolean defaultValue, int menuId) {
boolean isEnabled = FeatureSwitch.Meta.canOverrideSwitch ? sharedPrefUtils.getFeatureSwitchOverride(featureSwitchOverride) : defaultValue;
if (!isEnabled) bottomNavigationView.getMenu().removeItem(menuId);
}
}
+54 -12
View File
@@ -1,32 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/Theme.Lacerta"
tools:context=".MainActivity">
android:background="@color/colorSurface">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="0dp"
android:layout_height="0dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@+id/bottom_nav"
app:layout_constraintBottom_toTopOf="@id/bottom_nav"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/main_nav"
tools:layout="@layout/fragment_debug_menu_container" />
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="@color/colorSurface"
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
app:collapsedTitleGravity="start|center_vertical"
app:contentScrim="@color/colorSecondaryContainer"
app:expandedTitleGravity="start|bottom"
app:expandedTitleMarginBottom="16dp"
app:expandedTitleMarginStart="16dp"
app:expandedTitleTextAppearance="@style/TextAppearance.MaterialComponents.Headline4"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:title="HOGE" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/main_nav"
tools:layout="@layout/fragment_home_top"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorSecondaryContainer"
app:itemIconTint="@color/colorOnSecondaryContainer"
app:itemTextColor="@color/colorOnSecondaryContainer"
app:itemActiveIndicatorStyle="@style/Lacerta.Custom.Indicator"
app:labelVisibilityMode="selected"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/bottom_nav_menu"/>
app:menu="@menu/bottom_nav_menu" />
</androidx.constraintlayout.widget.ConstraintLayout>
+12 -3
View File
@@ -4,17 +4,26 @@
<item
android:id="@id/feature_home_navigation"
android:icon="@drawable/home_24px"
android:title="Home"/>
android:title="@string/home_title"/>
<item
android:id="@id/feature_search_navigation"
android:icon="@drawable/search_24px"
android:title="@string/search_title"/>
<item
android:id="@id/feature_library_navigation"
android:icon="@drawable/folder_24px"
android:title="Library"/>
android:title="@string/library_title"/>
<item
android:id="@id/feature_debug_navigation"
android:icon="@drawable/developer_mode_24px"
android:title="Debug menu"/>
android:title="@string/debug_menu_title" />
<item
android:id="@id/feature_setting_navigation"
android:icon="@drawable/settings_24px"
android:title="@string/setting_title"/>
</menu>
+5 -1
View File
@@ -2,7 +2,7 @@
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/app_main_nav"
app:startDestination="@id/feature_debug_navigation">
app:startDestination="@id/feature_home_navigation">
<include app:graph="@navigation/feature_debug_navigation" />
@@ -10,5 +10,9 @@
<include app:graph="@navigation/feature_home_navigation" />
<include app:graph="@navigation/feature_search_navigation" />
<include app:graph="@navigation/feature_setting_navigation" />
</navigation>
+3 -1
View File
@@ -4,7 +4,7 @@ plugins {
android {
namespace 'one.nem.lacerta.component.common'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
@@ -32,4 +32,6 @@ dependencies {
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
implementation project(':shared:ui')
}
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
android {
namespace 'one.nem.lacerta.component.scanner'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
@@ -1,5 +1,6 @@
package one.nem.lacerta.component.scanner;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
@@ -22,12 +23,17 @@ import com.websitebeaver.documentscanner.DocumentScanner;
import java.util.ArrayList;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.model.document.DocumentMeta;
import one.nem.lacerta.processor.factory.DocumentProcessorFactory;
import one.nem.lacerta.utils.LacertaLogger;
import one.nem.lacerta.data.Document;
import one.nem.lacerta.vcs.factory.LacertaVcsFactory;
@AndroidEntryPoint
public class ScannerManagerActivity extends AppCompatActivity {
@@ -40,6 +46,11 @@ public class ScannerManagerActivity extends AppCompatActivity {
@Inject
Document document;
@Inject
DocumentProcessorFactory documentProcessorFactory;
@Inject
LacertaVcsFactory lacertaVcsFactory;
// Variables
private ArrayList<Bitmap> croppedImages = new ArrayList<>();
@@ -143,9 +154,37 @@ public class ScannerManagerActivity extends AppCompatActivity {
private void saveNewDocument() {
logger.debug(TAG, "saveNewDocument");
// Deprecatedだが、中断機能が存在しないので操作をブロックする目的で(意図的に)使用
ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("保存中..."); // TODO-rca: テキストをリソースに移動
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setCancelable(false);
dialog.show();
DocumentMeta documentMeta = new DocumentMeta("Untitled"); // TODO-rca: デフォルトタイトルを指定できるようにする
document.createDocument(documentMeta).thenAccept((documentDetail) -> {
Bitmap[] bitmaps = new Bitmap[croppedImages.size()];
croppedImages.toArray(bitmaps);
logger.debug(TAG, "bitmaps.length: " + bitmaps.length);
addPagesToDocumentDetail(documentDetail, bitmaps).join();
document.updateDocument(documentDetail).join();
dialog.dismiss();
finish();
});
}
private CompletableFuture<Void> addPagesToDocumentDetail(DocumentDetail documentDetail, Bitmap[] bitmaps) {
return CompletableFuture.runAsync(() -> {
try {
document.updateDocument(documentProcessorFactory.create(documentDetail).addNewPagesToLast(bitmaps).getDocumentDetail()).join();
lacertaVcsFactory.create(documentDetail.getMeta().getId()).generateRevisionAtCurrent("Initial commit");
} catch (Exception e) {
logger.error(TAG, "Error: " + e.getMessage());
logger.e_code("9dff2a28-20e8-4ccd-9d04-f0c7646faa6a");
}
});
}
private void insertToExistDocument() {
logger.debug(TAG, "insertToExistDocument");
// TODO-rca: 実装
+23 -1
View File
@@ -1,10 +1,11 @@
plugins {
alias(libs.plugins.com.android.library)
id 'com.google.dagger.hilt.android'
}
android {
namespace 'one.nem.lacerta.component.viewer'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
@@ -29,7 +30,28 @@ dependencies {
implementation libs.androidx.appcompat
implementation libs.com.google.android.material
implementation libs.androidx.activity
implementation libs.androidx.constraintlayout
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
// Navigation
implementation libs.navigation.fragment
implementation libs.navigation.ui
implementation libs.navigation.dynamic.features.fragment
// DI
implementation libs.com.google.dagger.hilt.android
annotationProcessor libs.com.google.dagger.hilt.compiler
// shared
implementation project(':shared:ui')
implementation project(':utils')
implementation project(':data')
implementation project(':model')
}
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity
android:name=".ViewerMainActivity"
android:exported="false" />
</application>
</manifest>
@@ -0,0 +1,88 @@
package one.nem.lacerta.component.viewer;
import android.graphics.Bitmap;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
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 java.util.ArrayList;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.data.Document;
import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.model.document.page.Page;
import one.nem.lacerta.utils.LacertaLogger;
/**
* A simple {@link Fragment} subclass.
* Use the {@link ComponentViewerTopFragment#newInstance} factory method to
* create an instance of this fragment.
*/
@AndroidEntryPoint
public class ComponentViewerTopFragment extends Fragment {
@Inject
Document document;
@Inject
LacertaLogger logger;
private static final String TAG = "ComponentViewerTopFragment";
private String documentId;
public ComponentViewerTopFragment() {
// Required empty public constructor
}
public static ComponentViewerTopFragment newInstance(String documentId) {
ComponentViewerTopFragment fragment = new ComponentViewerTopFragment();
Bundle args = new Bundle();
args.putString("documentId", documentId);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
documentId = getArguments().getString("documentId");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_component_viewer_top, container, false);
RecyclerView recyclerView = view.findViewById(R.id.body_recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
ViewerBodyAdapter viewerBodyAdapter = new ViewerBodyAdapter(fileName -> {
Toast.makeText(getContext(), fileName, Toast.LENGTH_SHORT).show();
});
recyclerView.setAdapter(viewerBodyAdapter);
document.getDocument(documentId).thenAccept(documentDetail -> {
ArrayList<Page> pages = documentDetail.getPages();
logger.debug(TAG, "pages.size(): " + pages.size());
viewerBodyAdapter.setPages(pages);
getActivity().runOnUiThread(() -> {
viewerBodyAdapter.notifyItemRangeChanged(0, pages.size());
});
});
return view;
}
}
@@ -0,0 +1,5 @@
package one.nem.lacerta.component.viewer;
public interface ItemClickListener {
void onItemClick(String fileName); // DEBUG
}
@@ -0,0 +1,66 @@
package one.nem.lacerta.component.viewer;
import android.graphics.Bitmap;
import android.media.Image;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import one.nem.lacerta.model.document.page.Page;
public class ViewerBodyAdapter extends RecyclerView.Adapter<ViewerBodyAdapter.ViewHolder>{
ArrayList<Page> pages;
ItemClickListener listener;
public ViewerBodyAdapter(ArrayList<Page> pages, ItemClickListener listener){
this.pages = pages;
this.listener = listener;
}
public ViewerBodyAdapter(ItemClickListener listener){
this.pages = new ArrayList<>();
this.listener = listener;
}
public void setPages(ArrayList<Page> pages){
this.pages = pages;
}
@NonNull
@Override
public ViewerBodyAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = View.inflate(parent.getContext(), R.layout.viewer_body_list_item, null);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewerBodyAdapter.ViewHolder holder, int position) {
Bitmap bitmap = pages.get(position).getBitmap();
holder.image.setImageBitmap(bitmap);
holder.itemView.setOnClickListener(v -> {
});
}
@Override
public int getItemCount() {
return pages.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
ImageView image;
public ViewHolder(@NonNull View itemView) {
super(itemView);
image = itemView.findViewById(R.id.imageView);
}
}
}
@@ -0,0 +1,65 @@
package one.nem.lacerta.component.viewer;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.FragmentManager;
import androidx.navigation.NavController;
import androidx.navigation.fragment.NavHostFragment;
import androidx.navigation.ui.NavigationUI;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.utils.LacertaLogger;
@AndroidEntryPoint
public class ViewerMainActivity extends AppCompatActivity {
@Inject
LacertaLogger logger;
@Inject
public ViewerMainActivity() {
}
// Variables
private static final String TAG = "ViewerMainActivity";
String documentId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_viewer_main);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
Intent intent = getIntent();
try {
documentId = intent.getStringExtra("documentId");
}
catch (Exception e) {
logger.error(TAG, "Failed to get documentId from intent");
logger.error(TAG, "Searchable Error code: " + "f64c21a2-391f-4c40-92f6-183da459de21");
Toast.makeText(this, "Failed to get documentId from intent", Toast.LENGTH_LONG).show();
finish();
}
getSupportFragmentManager().beginTransaction()
.replace(R.id.nav_host_fragment, ComponentViewerTopFragment.newInstance(documentId))
.commitNow();
}
}
@@ -0,0 +1,20 @@
package one.nem.lacerta.component.viewer.model;
import android.graphics.Bitmap;
public class ViewerBodyListItem {
Bitmap image;
public ViewerBodyListItem(Bitmap image) {
this.image = image;
}
public Bitmap getImage() {
return image;
}
public void setImage(Bitmap image) {
this.image = image;
}
}
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ViewerMainActivity">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="one.nem.lacerta.component.viewer.ComponentViewerTopFragment"
android:layout_width="0dp"
android:layout_height="0dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,51 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorSurface">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
app:contentScrim="@color/colorSecondaryContainer"
android:background="@color/colorSurface"
android:layout_width="match_parent"
android:layout_height="160dp"
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
app:collapsedTitleGravity="start|center_vertical"
app:expandedTitleGravity="start|bottom"
app:expandedTitleMarginBottom="16dp"
app:expandedTitleMarginStart="16dp"
app:expandedTitleTextAppearance="@style/TextAppearance.MaterialComponents.Headline4"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:title="Title" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/body_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</FrameLayout>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="8dp"
android:adjustViewBounds="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/backgrounds/scenic" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/component_viewer_navigation"
app:startDestination="@id/componentViewerTopFragment">
<fragment
android:id="@+id/componentViewerTopFragment"
android:name="one.nem.lacerta.component.viewer.ComponentViewerTopFragment"
android:label="ComponentViewerTopFragment" />
</navigation>
@@ -0,0 +1,4 @@
<resources>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
@@ -2,6 +2,7 @@ package one.nem.lacerta.data;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.concurrent.CompletableFuture;
import one.nem.lacerta.model.document.DocumentMeta;
import one.nem.lacerta.model.document.DocumentDetail;
@@ -13,13 +14,13 @@ import one.nem.lacerta.model.document.tag.DocumentTag;
*/
public interface Document {
DocumentDetail createDocument(DocumentMeta meta);
CompletableFuture<DocumentDetail> createDocument(DocumentMeta meta);
DocumentDetail createDocument();
CompletableFuture<DocumentDetail> createDocument();
void deleteDocument(String documentId);
CompletableFuture<Void> deleteDocument(String documentId);
void updateDocument(DocumentMeta meta, DocumentDetail detail);
CompletableFuture<Void> updateDocument(DocumentDetail detail);
DocumentDetail getDocument(String documentId);
CompletableFuture<DocumentDetail> getDocument(String documentId);
}
@@ -1,5 +1,9 @@
package one.nem.lacerta.data;
import java.util.ArrayList;
import java.util.concurrent.CompletableFuture;
import one.nem.lacerta.model.ListItem;
import one.nem.lacerta.model.ListItemType;
import one.nem.lacerta.model.LibraryItemPage;
@@ -8,15 +12,13 @@ import one.nem.lacerta.model.document.DocumentDetail;
public interface LacertaLibrary {
// Get History
LibraryItemPage getRecentDocument(int limit);
LibraryItemPage getRecentDocument(int limit, int offset);
CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit);
CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit, int offset);
// Get Library page
LibraryItemPage getLibraryPage(int limit);
LibraryItemPage getLibraryPage(int limit, int offset);
LibraryItemPage getLibraryPage(String pageId, int limit);
LibraryItemPage getLibraryPage(String pageId, int limit, int offset);
CompletableFuture<LibraryItemPage> getLibraryPage(int limit);
CompletableFuture<LibraryItemPage> getLibraryPage(int limit, int offset);
CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit);
CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit, int offset);
// GetDocument
DocumentDetail getDocumentDetailById(String id); // TODO-rca: Documentに統合する
}
@@ -1,8 +1,10 @@
package one.nem.lacerta.data.impl;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
// Hilt
import javax.inject.Inject;
@@ -16,14 +18,22 @@ import one.nem.lacerta.model.document.DocumentMeta;
import one.nem.lacerta.model.document.DocumentDetail;
// Lacerta/source
import one.nem.lacerta.model.document.internal.XmlMetaModel;
import one.nem.lacerta.model.document.internal.XmlMetaPageModel;
import one.nem.lacerta.model.document.page.Page;
import one.nem.lacerta.source.database.LacertaDatabase;
import one.nem.lacerta.source.database.entity.DocumentEntity;
// Lacerta/utils
import one.nem.lacerta.source.file.FileManager;
import one.nem.lacerta.source.file.factory.FileManagerFactory;
import one.nem.lacerta.utils.LacertaLogger;
// Lacerta/vcs
import one.nem.lacerta.utils.XmlMetaParser;
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
import one.nem.lacerta.vcs.LacertaVcs;
import one.nem.lacerta.vcs.factory.LacertaVcsFactory;
public class DocumentImpl implements Document {
@@ -37,45 +47,56 @@ public class DocumentImpl implements Document {
LacertaDatabase database;
@Inject
LacertaVcs vcs;
LacertaVcsFactory vcsFactory;
@Inject
FileManagerFactory fileManagerFactory;
@Inject
DeviceInfoUtils deviceInfoUtils;
@Inject
XmlMetaParser xmlMetaParser;
@Inject
public DocumentImpl() {
// Init
logger.debug(TAG, "called");
// logger.debug(TAG, "called");
}
@Override
public DocumentDetail createDocument(DocumentMeta meta) {
DocumentDetail detail = new DocumentDetail();
detail.setMeta(meta);
detail.setPages(new ArrayList<>());
public CompletableFuture<DocumentDetail> createDocument(DocumentMeta meta) {
return CompletableFuture.supplyAsync(() -> {
DocumentDetail detail = new DocumentDetail();
detail.setMeta(meta);
detail.setPages(new ArrayList<>());
// Create DocumentEntity
DocumentEntity documentEntity = new DocumentEntity();
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.publicPath = meta.getPath().getStringPath();
documentEntity.tagIds = meta.getTagIds();
// TODO-rca: UIスレッドから追い出す
database.documentDao().insert(documentEntity);
// Create DocumentEntity
DocumentEntity documentEntity = new DocumentEntity();
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.publicPath = meta.getPath().getStringPath();
documentEntity.tagIds = meta.getTagIds();
// Vcs
LacertaVcs vcs = vcsFactory.create(meta.getId());
vcs.createDocument(meta.getId());
database.documentDao().insert(documentEntity);
// XmlMeta
updateXmlMeta(detail).join();
// Vcs
vcs.createDocument(meta.getId());
return detail;
return detail;
});
}
@Override
public DocumentDetail createDocument() {
public CompletableFuture<DocumentDetail> createDocument() {
DocumentMeta meta = new DocumentMeta();
meta.setId(UUID.randomUUID().toString());
meta.setTitle("New Document");
@@ -89,17 +110,112 @@ public class DocumentImpl implements Document {
}
@Override
public void deleteDocument(String documentId) {
public CompletableFuture<Void> deleteDocument(String documentId) {
return CompletableFuture.supplyAsync(() -> {
return null;
});
}
@Override
public void updateDocument(DocumentMeta meta, DocumentDetail detail) {
public CompletableFuture<Void> updateDocument(DocumentDetail detail) {
return CompletableFuture.supplyAsync(() -> {
updateXmlMeta(detail).join();
return null;
});
}
@Override
public DocumentDetail getDocument(String documentId) {
return null;
public CompletableFuture<DocumentDetail> getDocument(String documentId) {
return CompletableFuture.supplyAsync(() -> {
DocumentEntity documentEntity = database.documentDao().findById(documentId);
if (documentEntity == null) {
throw new IllegalArgumentException("documentId is not found");
}
DocumentMeta meta = new DocumentMeta();
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.setPath(new PublicPath().resolve(documentEntity.publicPath));
meta.setTags(new ArrayList<>()); // TODO-rca: タグを取得する
DocumentDetail detail = new DocumentDetail();
getPagesByXmlMeta(documentId).thenCompose(xmlMetaPageModels -> getPagesByXmlMetaPageModel(documentId, xmlMetaPageModels)).thenAccept(pages -> {
logger.debug(TAG, "pages: " + pages.size());
detail.setMeta(meta);
detail.setPages(pages);
}).join();
return detail;
});
}
private CompletableFuture<ArrayList<XmlMetaPageModel>> getPagesByXmlMeta(String documentId) {
return CompletableFuture.supplyAsync(() -> {
FileManager fileManager = fileManagerFactory.create(deviceInfoUtils.getExternalStorageDirectory());
try {
ArrayList<XmlMetaPageModel> xmlMetaPageModels = xmlMetaParser.deserialize(fileManager.resolve(documentId).loadXml("meta.xml")).getPages();
// Debug
logger.debug(TAG, "xmlMetaPageModels: " + xmlMetaPageModels.size());
for (XmlMetaPageModel xmlMetaPageModel : xmlMetaPageModels) {
logger.debug(TAG, "\txmlMetaPageModel: " + xmlMetaPageModel.getFilename());
}
return xmlMetaPageModels;
} catch (IOException e) {
logger.error(TAG, "DocumentMeta parse error");
logger.trace(TAG, e.getMessage());
logger.e_code("db18c04a-1625-4871-9e4e-918d805568ac");
}
return null;
});
}
private CompletableFuture<ArrayList<Page>> getPagesByXmlMetaPageModel(String documentId, ArrayList<XmlMetaPageModel> xmlMetaPageModels) {
return CompletableFuture.supplyAsync(() -> {
ArrayList<Page> pages = new ArrayList<>();
FileManager fileManager;
try {
fileManager = fileManagerFactory.create(deviceInfoUtils.getExternalStorageDirectory()).resolve(documentId);
} catch (IOException e) {
logger.error(TAG, "FileManager resolve error");
logger.trace(TAG, e.getMessage());
logger.e_code("2235e8ee-4177-46f8-af6b-084381b202e6");
return null;
}
for (XmlMetaPageModel xmlMetaPageModel : xmlMetaPageModels) {
try {
pages.add(new Page(xmlMetaPageModel.getFilename(), fileManager.resolve("raw").loadBitmap(xmlMetaPageModel.getFilename())));
} catch (IOException e) {
logger.error(TAG, "Bitmap decode error");
logger.trace(TAG, e.getMessage());
logger.e_code("3bba8c8f-90fb-4a24-a726-7ea201929f8b");
return null;
}
}
return pages;
});
}
private CompletableFuture<Void> updateXmlMeta(DocumentDetail documentDetail) {
return CompletableFuture.supplyAsync(() -> {
// TODO-rca: リビジョンIDを検証する, 挿入する
FileManager fileManager = fileManagerFactory.create(deviceInfoUtils.getExternalStorageDirectory());
ArrayList<XmlMetaPageModel> xmlMetaPageModels = new ArrayList<>();
for (Page page : documentDetail.getPages()) {
xmlMetaPageModels.add(new XmlMetaPageModel(page.getFileName()));
}
try {
fileManager.createDirectoryIfNotExist(documentDetail.getMeta().getId()).resolve(documentDetail.getMeta().getId())
.createFileIfNotExist("meta.xml").resolve("meta.xml").saveXml(xmlMetaParser.serialize(new XmlMetaModel("revisionId_PLACEHOLDER", xmlMetaPageModels)));
} catch (IOException e) {
logger.error(TAG, "DocumentMeta serialize error");
logger.trace(TAG, e.getMessage());
logger.e_code("e3b4d0c9-5b7e-4b7e-9e9a-5b8b8b8b8b8b");
}
return null;
});
}
}
@@ -1,42 +1,146 @@
package one.nem.lacerta.data.impl;
import java.text.DateFormat;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import one.nem.lacerta.data.LacertaLibrary;
import one.nem.lacerta.model.LibraryItemPage;
import one.nem.lacerta.model.ListItem;
import one.nem.lacerta.model.ListItemType;
import one.nem.lacerta.model.document.DocumentDetail;
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.utils.LacertaLogger;
public class LacertaLibraryImpl implements LacertaLibrary {
@Override
public LibraryItemPage getRecentDocument(int limit) {
return null;
LacertaLogger logger;
LacertaDatabase database;
@Inject
public LacertaLibraryImpl(LacertaLogger logger, LacertaDatabase database) {
this.logger = logger;
this.database = database;
}
@Override
public LibraryItemPage getRecentDocument(int limit, int offset) {
return null;
public CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit) {
return CompletableFuture.supplyAsync(() -> {
// 5秒フリーズさせる
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
List<DocumentEntity> documentEntities = database.documentDao().getRecentDocument(limit);
ArrayList<ListItem> listItems = new ArrayList<>();
for (DocumentEntity documentEntity : documentEntities) {
ListItem listItem = new ListItem();
listItem.setItemType(ListItemType.ITEM_TYPE_DOCUMENT);
listItem.setTitle(documentEntity.title);
listItem.setDescription(DateFormat.getDateInstance().format(documentEntity.updatedAt));
listItem.setItemId(documentEntity.id);
listItems.add(listItem);
}
return listItems;
});
}
@Override
public LibraryItemPage getLibraryPage(int limit) {
return null;
public CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit, int offset) {
return null; // TODO-rca: Implement
}
// Internal
private CompletableFuture<List<FolderEntity>> getFolderEntitiesByPublicPath(String publicPath) {
return CompletableFuture.supplyAsync(() -> {
return database.folderDao().findByPublicPathWithLimit(publicPath, 10); // TODO-rca: ハードコーディングやめる
});
}
private CompletableFuture<List<DocumentEntity>> getDocumentEntitiesByPublicPath(String publicPath) {
return CompletableFuture.supplyAsync(() -> {
return database.documentDao().findByPublicPathWithLimit(publicPath, 10); // TODO-rca: ハードコーディングやめる
});
}
@Override
public LibraryItemPage getLibraryPage(int limit, int offset) {
return null;
public CompletableFuture<LibraryItemPage> getLibraryPage(int limit) {
return CompletableFuture.supplyAsync(() -> {
// 5秒フリーズさせる
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
LibraryItemPage libraryItemPage = new LibraryItemPage();
List<FolderEntity> folderEntities = getFolderEntitiesByPublicPath("/").join();
logger.debug("LacertaLibraryImpl", "folderEntities.size(): " + folderEntities.size());
List<DocumentEntity> documentEntities = getDocumentEntitiesByPublicPath("/").join();
logger.debug("LacertaLibraryImpl", "documentEntities.size(): " + documentEntities.size());
ArrayList<ListItem> listItems = new ArrayList<>();
for (FolderEntity folderEntity : folderEntities) {
logger.debug("LacertaLibraryImpl", "folderEntity.name: " + folderEntity.name);
ListItem listItem = new ListItem();
listItem.setItemType(ListItemType.ITEM_TYPE_FOLDER);
listItem.setTitle(folderEntity.name);
listItem.setDescription("フォルダ"); // TODO-rca: ハードコーディングやめる
listItem.setItemId(folderEntity.id);
listItems.add(listItem);
}
for (DocumentEntity documentEntity : documentEntities) {
logger.debug("LacertaLibraryImpl", "documentEntity.title: " + documentEntity.title);
ListItem listItem = new ListItem();
listItem.setItemType(ListItemType.ITEM_TYPE_DOCUMENT);
listItem.setTitle(documentEntity.title);
// listItem.setDescription(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm").format(documentEntity.updatedAt.toInstant()));
listItem.setItemId(documentEntity.id);
listItems.add(listItem);
}
libraryItemPage.setPageTitle("/");
libraryItemPage.setPageId("root");
libraryItemPage.setListItems(listItems);
logger.debug("LacertaLibraryImpl", "libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size());
return libraryItemPage;
});
}
@Override
public LibraryItemPage getLibraryPage(String pageId, int limit) {
return null;
public CompletableFuture<LibraryItemPage> getLibraryPage(int limit, int offset) {
return CompletableFuture.supplyAsync(() -> {
return null;
});
}
@Override
public LibraryItemPage getLibraryPage(String pageId, int limit, int offset) {
return null;
public CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit) {
return CompletableFuture.supplyAsync(() -> {
return null;
});
}
@Override
public DocumentDetail getDocumentDetailById(String id) {
return null;
public CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit, int offset) {
return CompletableFuture.supplyAsync(() -> {
return null;
});
}
}
@@ -1,219 +1,219 @@
package one.nem.lacerta.data.impl;
import one.nem.lacerta.data.LacertaLibrary;
import one.nem.lacerta.model.LibraryItemPage;
import one.nem.lacerta.model.ListItem;
import one.nem.lacerta.model.ListItemType;
import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.model.document.DocumentMeta;
import one.nem.lacerta.model.document.path.DocumentPath;
import one.nem.lacerta.utils.LacertaLogger;
import com.github.javafaker.DateAndTime;
import com.github.javafaker.Faker;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Objects;
import java.util.UUID;
import javax.inject.Inject;
/**
* LacertaLibraryのスタブ実装
*/
public class LacertaLibraryStubImpl implements LacertaLibrary {
LacertaLogger logger;
Faker faker;
@Inject
public LacertaLibraryStubImpl(LacertaLogger logger) {
faker = new Faker(); // Init Faker
this.logger = logger;
logger.debug("LibraryStub", "Initialized");
}
// Internal Methods
// Generate Stub Data
private LibraryItemPage generateStubLibraryItemPage(int limit, String pageId) {
logger.debug("LibraryStub", "generateStubLibraryItemPage");
ArrayList<ListItem> listItems = new ArrayList<>();
int itemTotal = faker.number().numberBetween(1, limit); // 実際に返却するアイテム数を決定
int folderTotal;
// フォルダ数の抽選
if (itemTotal > 4) {
folderTotal = faker.number().numberBetween(1, itemTotal - 2);
}
else {
if (itemTotal > 2) {
folderTotal = 1;
}
else { // ドキュメント数がゼロにならないように
folderTotal = 0;
}
}
int documentTotal = itemTotal - folderTotal; // ドキュメント数を決定
logger.debug("LibraryStub", "itemTotal: " + itemTotal);
logger.debug("LibraryStub", "folderTotal: " + folderTotal);
logger.debug("LibraryStub", "documentTotal: " + documentTotal);
// フォルダを生成
for (int i = 0; i < folderTotal; i++) {
listItems.add(generateStubListItem(ListItemType.ITEM_TYPE_FOLDER));
}
// ドキュメントを生成
for (int i = 0; i < documentTotal; i++) {
listItems.add(generateStubListItem(ListItemType.ITEM_TYPE_DOCUMENT));
}
LibraryItemPage libraryItemPage = new LibraryItemPage();
libraryItemPage.setListItems(listItems);
if (pageId == null) {
libraryItemPage.setPageId(UUID.randomUUID().toString());
} else {
libraryItemPage.setPageId(pageId);
}
libraryItemPage.setPageTitle("FakePage" + faker.number().digits(3));
return libraryItemPage;
}
private ListItem generateStubListItem(ListItemType itemType) {
if (itemType == ListItemType.ITEM_TYPE_FOLDER) {
ListItem listItem = new ListItem();
listItem.setTitle("FakeFolder" + faker.number().digits(3));
listItem.setDescription("Updated at " + DateFormat.getDateTimeInstance().format(faker.date().birthday()));
listItem.setItemType(ListItemType.ITEM_TYPE_FOLDER);
listItem.setItemId(UUID.randomUUID().toString());
return listItem;
} else if (itemType == ListItemType.ITEM_TYPE_DOCUMENT) {
ListItem listItem = new ListItem();
listItem.setTitle("FakeDocument" + faker.book().title());
listItem.setDescription("Updated at " + DateFormat.getDateTimeInstance().format(faker.date().birthday()));
listItem.setItemType(ListItemType.ITEM_TYPE_DOCUMENT);
listItem.setItemId(UUID.randomUUID().toString());
return listItem;
} else {
return null;
}
}
private LibraryItemPage getRecentDocumentPage(int limit) {
int itemTotal = faker.number().numberBetween(1, limit);
ArrayList<ListItem> listItems = new ArrayList<>();
for (int i = 0; i < itemTotal; i++) {
listItems.add(generateStubListItem(ListItemType.ITEM_TYPE_DOCUMENT));
}
// DescriptionからDateを抽出して新しい順にソート
listItems.sort((a, b) -> {
String aDate = a.getDescription().substring(11);
String bDate = b.getDescription().substring(11);
return bDate.compareTo(aDate);
});
LibraryItemPage libraryItemPage = new LibraryItemPage();
libraryItemPage.setListItems(listItems);
libraryItemPage.setPageId(UUID.randomUUID().toString());
libraryItemPage.setPageTitle("RecentDocument");
return libraryItemPage;
}
private DocumentDetail generateStubDocumentDetail(String id) throws IllegalArgumentException {
if (Objects.isNull(id)) {
throw new IllegalArgumentException("id is null");
}
DocumentMeta documentMeta = new DocumentMeta();
documentMeta.setId(id);
documentMeta.setTitle("FakeDocument" + faker.book().title());
documentMeta.setCreatedAt(faker.date().birthday());
documentMeta.setUpdatedAt(faker.date().birthday()); // TODO-rca: 更新日のほうが古くなることがあるのでなんとかする?
ArrayList<String> tagIds = new ArrayList<>();
DocumentDetail documentDetail = new DocumentDetail();
documentDetail.setMeta(documentMeta);
// documentDetail.setPath(null); // TODO-rca: なんとかする
// documentDetail.setAuthor(faker.name().fullName());
// documentDetail.setRepository(null); // TODO-rca: なんとかする
return documentDetail;
}
/**
* 履歴ページを取得する
* @param limit 取得するアイテム数
* @return ページオブジェクト
*/
@Override
public LibraryItemPage getRecentDocument(int limit) {
return getRecentDocumentPage(limit);
}
/**
* 履歴ページを取得する
* @param limit 取得するアイテム数
* @param offset 取得するアイテムのオフセット
* @return ページオブジェクト
*/
@Override
public LibraryItemPage getRecentDocument(int limit, int offset) {
return getRecentDocumentPage(limit);
}
/**
* ライブラリページを取得する
* @param limit 取得するアイテム数
* @return ページオブジェクト
*/
@Override
public LibraryItemPage getLibraryPage(int limit) {
return generateStubLibraryItemPage(limit, null);
}
/**
* ライブラリページを取得する
* @param limit 取得するアイテム数
* @param offset 取得するアイテムのオフセット
* @return ページオブジェクト
*/
@Override
public LibraryItemPage getLibraryPage(int limit, int offset) {
return generateStubLibraryItemPage(limit, null);
}
/**
* ライブラリページを取得する
* @param pageId ページID
* @param limit 取得するアイテム数
* @return ページオブジェクト
*/
@Override
public LibraryItemPage getLibraryPage(String pageId, int limit) {
return generateStubLibraryItemPage(limit, pageId);
}
/**
* ライブラリページを取得する
* @param pageId ページID
* @param limit 取得するアイテム数
* @param offset 取得するアイテムのオフセット
* @return ページオブジェクト
*/
@Override
public LibraryItemPage getLibraryPage(String pageId, int limit, int offset) {
return generateStubLibraryItemPage(limit, pageId);
}
/**
* ドキュメント詳細を取得する
* @param id ドキュメントID
* @return ドキュメント詳細オブジェクト
*/
@Override
public DocumentDetail getDocumentDetailById(String id) throws IllegalArgumentException {
return generateStubDocumentDetail(id);
}
}
//package one.nem.lacerta.data.impl;
//
//import one.nem.lacerta.data.LacertaLibrary;
//import one.nem.lacerta.model.LibraryItemPage;
//import one.nem.lacerta.model.ListItem;
//import one.nem.lacerta.model.ListItemType;
//import one.nem.lacerta.model.document.DocumentDetail;
//
//import one.nem.lacerta.model.document.DocumentMeta;
//import one.nem.lacerta.model.document.path.DocumentPath;
//import one.nem.lacerta.utils.LacertaLogger;
//
//import com.github.javafaker.DateAndTime;
//import com.github.javafaker.Faker;
//
//import java.text.DateFormat;
//import java.util.ArrayList;
//import java.util.Objects;
//import java.util.UUID;
//
//import javax.inject.Inject;
//
///**
// * LacertaLibraryのスタブ実装
// */
//public class LacertaLibraryStubImpl implements LacertaLibrary {
//
// LacertaLogger logger;
//
// Faker faker;
//
// @Inject
// public LacertaLibraryStubImpl(LacertaLogger logger) {
// faker = new Faker(); // Init Faker
// this.logger = logger;
// logger.debug("LibraryStub", "Initialized");
// }
//
// // Internal Methods
//
// // Generate Stub Data
// private LibraryItemPage generateStubLibraryItemPage(int limit, String pageId) {
// logger.debug("LibraryStub", "generateStubLibraryItemPage");
// ArrayList<ListItem> listItems = new ArrayList<>();
// int itemTotal = faker.number().numberBetween(1, limit); // 実際に返却するアイテム数を決定
// int folderTotal;
// // フォルダ数の抽選
// if (itemTotal > 4) {
// folderTotal = faker.number().numberBetween(1, itemTotal - 2);
// }
// else {
// if (itemTotal > 2) {
// folderTotal = 1;
// }
// else { // ドキュメント数がゼロにならないように
// folderTotal = 0;
// }
// }
// int documentTotal = itemTotal - folderTotal; // ドキュメント数を決定
// logger.debug("LibraryStub", "itemTotal: " + itemTotal);
// logger.debug("LibraryStub", "folderTotal: " + folderTotal);
// logger.debug("LibraryStub", "documentTotal: " + documentTotal);
//
// // フォルダを生成
// for (int i = 0; i < folderTotal; i++) {
// listItems.add(generateStubListItem(ListItemType.ITEM_TYPE_FOLDER));
// }
// // ドキュメントを生成
// for (int i = 0; i < documentTotal; i++) {
// listItems.add(generateStubListItem(ListItemType.ITEM_TYPE_DOCUMENT));
// }
//
// LibraryItemPage libraryItemPage = new LibraryItemPage();
// libraryItemPage.setListItems(listItems);
// if (pageId == null) {
// libraryItemPage.setPageId(UUID.randomUUID().toString());
// } else {
// libraryItemPage.setPageId(pageId);
// }
// libraryItemPage.setPageTitle("FakePage" + faker.number().digits(3));
//
// return libraryItemPage;
// }
//
// private ListItem generateStubListItem(ListItemType itemType) {
// if (itemType == ListItemType.ITEM_TYPE_FOLDER) {
// ListItem listItem = new ListItem();
// listItem.setTitle("FakeFolder" + faker.number().digits(3));
// listItem.setDescription("Updated at " + DateFormat.getDateTimeInstance().format(faker.date().birthday()));
// listItem.setItemType(ListItemType.ITEM_TYPE_FOLDER);
// listItem.setItemId(UUID.randomUUID().toString());
// return listItem;
// } else if (itemType == ListItemType.ITEM_TYPE_DOCUMENT) {
// ListItem listItem = new ListItem();
// listItem.setTitle("FakeDocument" + faker.book().title());
// listItem.setDescription("Updated at " + DateFormat.getDateTimeInstance().format(faker.date().birthday()));
// listItem.setItemType(ListItemType.ITEM_TYPE_DOCUMENT);
// listItem.setItemId(UUID.randomUUID().toString());
// return listItem;
// } else {
// return null;
// }
// }
//
// private LibraryItemPage getRecentDocumentPage(int limit) {
// int itemTotal = faker.number().numberBetween(1, limit);
// ArrayList<ListItem> listItems = new ArrayList<>();
// for (int i = 0; i < itemTotal; i++) {
// listItems.add(generateStubListItem(ListItemType.ITEM_TYPE_DOCUMENT));
// }
// // DescriptionからDateを抽出して新しい順にソート
// listItems.sort((a, b) -> {
// String aDate = a.getDescription().substring(11);
// String bDate = b.getDescription().substring(11);
// return bDate.compareTo(aDate);
// });
// LibraryItemPage libraryItemPage = new LibraryItemPage();
// libraryItemPage.setListItems(listItems);
// libraryItemPage.setPageId(UUID.randomUUID().toString());
// libraryItemPage.setPageTitle("RecentDocument");
// return libraryItemPage;
// }
//
// private DocumentDetail generateStubDocumentDetail(String id) throws IllegalArgumentException {
//
// if (Objects.isNull(id)) {
// throw new IllegalArgumentException("id is null");
// }
//
// DocumentMeta documentMeta = new DocumentMeta();
// documentMeta.setId(id);
// documentMeta.setTitle("FakeDocument" + faker.book().title());
// documentMeta.setCreatedAt(faker.date().birthday());
// documentMeta.setUpdatedAt(faker.date().birthday()); // TODO-rca: 更新日のほうが古くなることがあるのでなんとかする?
// ArrayList<String> tagIds = new ArrayList<>();
//
// DocumentDetail documentDetail = new DocumentDetail();
// documentDetail.setMeta(documentMeta);
//// documentDetail.setPath(null); // TODO-rca: なんとかする
//// documentDetail.setAuthor(faker.name().fullName());
//// documentDetail.setRepository(null); // TODO-rca: なんとかする
// return documentDetail;
// }
//
// /**
// * 履歴ページを取得する
// * @param limit 取得するアイテム数
// * @return ページオブジェクト
// */
// @Override
// public ArrayList<ListItem> getRecentDocument(int limit) {
// return getRecentDocumentPage(limit).getListItems();
// }
//
// /**
// * 履歴ページを取得する
// * @param limit 取得するアイテム数
// * @param offset 取得するアイテムのオフセット
// * @return ページオブジェクト
// */
// @Override
// public ArrayList<ListItem> getRecentDocument(int limit, int offset) {
// return getRecentDocumentPage(limit).getListItems();
// }
//
// /**
// * ライブラリページを取得する
// * @param limit 取得するアイテム数
// * @return ページオブジェクト
// */
// @Override
// public LibraryItemPage getLibraryPage(int limit) {
// return generateStubLibraryItemPage(limit, null);
// }
//
// /**
// * ライブラリページを取得する
// * @param limit 取得するアイテム数
// * @param offset 取得するアイテムのオフセット
// * @return ページオブジェクト
// */
// @Override
// public LibraryItemPage getLibraryPage(int limit, int offset) {
// return generateStubLibraryItemPage(limit, null);
// }
//
// /**
// * ライブラリページを取得する
// * @param pageId ページID
// * @param limit 取得するアイテム数
// * @return ページオブジェクト
// */
// @Override
// public LibraryItemPage getLibraryPage(String pageId, int limit) {
// return generateStubLibraryItemPage(limit, pageId);
// }
//
// /**
// * ライブラリページを取得する
// * @param pageId ページID
// * @param limit 取得するアイテム数
// * @param offset 取得するアイテムのオフセット
// * @return ページオブジェクト
// */
// @Override
// public LibraryItemPage getLibraryPage(String pageId, int limit, int offset) {
// return generateStubLibraryItemPage(limit, pageId);
// }
//
// /**
// * ドキュメント詳細を取得する
// * @param id ドキュメントID
// * @return ドキュメント詳細オブジェクト
// */
// @Override
// public DocumentDetail getDocumentDetailById(String id) throws IllegalArgumentException {
// return generateStubDocumentDetail(id);
// }
//}
@@ -30,9 +30,10 @@ public class LacertaSearchStubImpl implements LacertaSearch {
*/
@Override
public ArrayList<ListItem> autoSearch(String query, int limit) {
logger.debug("SearchStub", "autoSearch");
logger.debug("SearchStub", "query: " + query);
return library.getLibraryPage(limit).getListItems();
// logger.debug("SearchStub", "autoSearch");
// logger.debug("SearchStub", "query: " + query);
// return library.getLibraryPage(limit).getListItems();
return null;
}
/**
@@ -44,8 +45,9 @@ public class LacertaSearchStubImpl implements LacertaSearch {
*/
@Override
public ArrayList<ListItem> autoSearch(String query, int limit, int offset) {
logger.debug("SearchStub", "autoSearch");
logger.debug("SearchStub", "query: " + query);
return library.getLibraryPage(limit, offset).getListItems();
// logger.debug("SearchStub", "autoSearch");
// logger.debug("SearchStub", "query: " + query);
// return library.getLibraryPage(limit, offset).getListItems();
return null;
}
}
@@ -7,7 +7,7 @@ import dagger.hilt.android.components.FragmentComponent;
import dagger.hilt.migration.DisableInstallInCheck;
import one.nem.lacerta.data.LacertaLibrary;
import one.nem.lacerta.data.impl.LacertaLibraryStubImpl;
import one.nem.lacerta.data.impl.LacertaLibraryImpl;
import one.nem.lacerta.utils.LacertaLogger;
@Module
@@ -16,6 +16,6 @@ import one.nem.lacerta.utils.LacertaLogger;
abstract public class LacertaLibraryModule {
@Binds
public abstract LacertaLibrary bindLacertaLibrary(LacertaLibraryStubImpl impl);
public abstract LacertaLibrary bindLacertaLibrary(LacertaLibraryImpl impl);
}
+1 -1
View File
@@ -4,7 +4,7 @@ plugins {
android {
namespace 'one.nem.lacerta.feature.common'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
@@ -57,13 +57,14 @@ public class DebugMenuLibraryItemListPageFragment extends Fragment {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_debug_menu_library_item_list_page, container, false);
LibraryItemPage libraryItemPage = lacertaLibrary.getRecentDocument(10);
for (ListItem listItem : libraryItemPage.getListItems()) {
// ArrayList<ListItem> listItems = lacertaLibrary.getRecentDocument(10);
ArrayList<ListItem> listItems = new ArrayList<>();
for (ListItem listItem : listItems) {
System.out.println(listItem.getTitle());
}
RecyclerView recyclerView = view.findViewById(R.id.item_recycler_view);
recyclerView.setAdapter(new ItemAdapter(libraryItemPage.getListItems()));
recyclerView.setAdapter(new ItemAdapter(listItems));
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
@@ -11,6 +11,7 @@
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginEnd="8dp"
android:text="Placeholder Title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -19,8 +20,11 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="14sp"
android:text="Placeholder Description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/debug_menu_item_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
+20 -1
View File
@@ -1,10 +1,11 @@
plugins {
id 'com.google.dagger.hilt.android'
id 'com.android.library'
}
android {
namespace 'one.nem.lacerta.feature.home'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
@@ -29,6 +30,8 @@ dependencies {
implementation libs.androidx.appcompat
implementation libs.com.google.android.material
implementation project(path: ':feature:debug')
implementation project(path: ':utils')
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
@@ -38,6 +41,22 @@ dependencies {
implementation libs.navigation.ui
implementation libs.navigation.dynamic.features.fragment
// DI
implementation libs.com.google.dagger.hilt.android
annotationProcessor libs.com.google.dagger.hilt.compiler
// shared
implementation project(':shared:ui')
// DI
implementation project(':data')
//model
implementation project(':model')
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation project(':component:common')
implementation project(':component:viewer')
}
@@ -22,5 +22,7 @@ public class ExampleInstrumentedTest {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("one.nem.lacerta.feature.home.test", appContext.getPackageName());
}
}
@@ -0,0 +1,5 @@
package one.nem.lacerta.feature.home;
public interface DocumentSelectListener {
void onDocumentSelect(String documentId);
}
@@ -1,64 +1,114 @@
package one.nem.lacerta.feature.home;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.component.viewer.ViewerMainActivity;
import one.nem.lacerta.data.Document;
import one.nem.lacerta.data.LacertaLibrary;
import one.nem.lacerta.model.ListItem;
import one.nem.lacerta.model.document.DocumentMeta;
/**
* A simple {@link Fragment} subclass.
* Use the {@link HomeTopFragment#newInstance} factory method to
* create an instance of this fragment.
*/
@AndroidEntryPoint
public class HomeTopFragment 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;
@Inject
LacertaLibrary lacertaLibrary;
public HomeTopFragment() {
// 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 HomeTopFragment.
*/
// TODO: Rename and change types and number of parameters
public static HomeTopFragment newInstance(String param1, String param2) {
public static HomeTopFragment newInstance() {
HomeTopFragment fragment = new HomeTopFragment();
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) {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_home_top, container, false);
View view = inflater.inflate(R.layout.fragment_home_top, container, false);
setHasOptionsMenu(true);
return view;
}
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
RecyclerView recyclerView = view.findViewById(R.id.home_item_recycler_view);
ListItemAdapter listItemAdapter = new ListItemAdapter(documentId -> {
Log.d("HomeTopFragment", "onViewCreated: " + documentId);
Intent intent = new Intent(getContext(), ViewerMainActivity.class);
intent.putExtra("documentId", documentId);
startActivity(intent);
});
recyclerView.setAdapter(listItemAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
lacertaLibrary.getRecentDocument(10).thenAccept(listItems -> {
listItemAdapter.setListItems(listItems);
getActivity().runOnUiThread(() -> {
listItemAdapter.notifyItemRangeInserted(0, listItems.size());
});
});
}
@Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
inflater.inflate(R.menu.drawer_menu, menu);
super.onCreateOptionsMenu(menu, inflater);
}
}
@@ -0,0 +1,73 @@
package one.nem.lacerta.feature.home;
import android.content.Intent;
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;
import java.util.ArrayList;
import one.nem.lacerta.component.viewer.ViewerMainActivity;
import one.nem.lacerta.model.ListItem;
public class ListItemAdapter extends RecyclerView.Adapter<ListItemAdapter.ListItemViewHolder>{
ArrayList<ListItem> listItems;
DocumentSelectListener listener;
public ListItemAdapter(DocumentSelectListener listener){
this.listItems = new ArrayList<>();
this.listener = listener;
}
public void setListItems(ArrayList<ListItem> listItems) {
this.listItems = listItems;
}
@NonNull
@Override
public ListItemAdapter.ListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(one.nem.lacerta.shared.ui.R.layout.common_list_item, parent, false);
return new ListItemViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ListItemAdapter.ListItemViewHolder holder, int position) {
ListItem listItem = listItems.get(position);
holder.icon.setImageResource(listItem.getItemType().getIconId());
holder.icon.setColorFilter(one.nem.lacerta.shared.ui.R.color.colorOnSurface);
holder.title.setText(listItem.getTitle());
holder.description.setText(listItem.getDescription());
holder.itemView.setOnClickListener( v -> {
Intent intent = new Intent(v.getContext(), ViewerMainActivity.class);
intent.putExtra("documentId", listItem.getItemId());
v.getContext().startActivity(intent);
});
}
@Override
public int getItemCount() {
return listItems.size();
}
public static class ListItemViewHolder extends RecyclerView.ViewHolder{
ImageView icon;
TextView title;
TextView description;
public ListItemViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_icon);
title = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_title);
description = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_description);
}
}
}
@@ -0,0 +1,70 @@
package one.nem.lacerta.feature.home;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import one.nem.lacerta.model.ListItem;
import one.nem.lacerta.model.document.DocumentMeta;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyAdapterViewHolder> {
ArrayList<ListItem> listItems;
public MyAdapter(ArrayList<ListItem> listItems) {
this.listItems = listItems;
}
@NonNull
@Override
public MyAdapterViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_home_document, parent, false);
return new MyAdapterViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull MyAdapterViewHolder holder, int position) {
holder.title.setText(listItems.get(position).getTitle());
holder.description.setText(listItems.get(position).getDescription());
}
@Override
public int getItemCount() {
return listItems.size();
}
public class MyAdapterViewHolder extends RecyclerView.ViewHolder {
TextView title;
TextView description;
public MyAdapterViewHolder(@NonNull View itemView) {
super(itemView);
title = itemView.findViewById(R.id.debug_menu_item_title);
description = itemView.findViewById(R.id.debug_menu_item_description);
}
}
}
@@ -1,14 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeTopFragment">
android:layout_height="match_parent">
<!-- TODO: Update blank fragment layout -->
<TextView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_item_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
android:layout_height="match_parent" />
</FrameLayout>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<TextView
android:id="@+id/debug_menu_item_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginEnd="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/debug_menu_item_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/debug_menu_item_title" />
<TextView
android:id="@+id/debug_menu_item_updated_at_home"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="14sp"
android:text="Updated at: aaaaaaaaaa"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/item_placeholder"
android:icon="@drawable/developer_mode_24px"
android:title="@string/placeholder" />
</menu>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="my_recycler_view" type="id" />
<item name="TITLE" type="id" />
<item name="textView" type="id" />
</resources>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
@@ -1,4 +1,5 @@
<resources>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="textview">TextView</string>
</resources>
+3 -1
View File
@@ -5,7 +5,7 @@ plugins {
android {
namespace 'one.nem.lacerta.feature.library'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
@@ -51,5 +51,7 @@ dependencies {
implementation project(':data')
implementation project(':utils')
}
@@ -0,0 +1,5 @@
package one.nem.lacerta.feature.library;
public interface DocumentSelectListener {
void onDocumentSelect(String documentId);
}
@@ -1,38 +0,0 @@
package one.nem.lacerta.feature.library;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
// LibraryArchiveFragment.java
//画面変移用のコード
//Fragmentへのデータの受け渡し機能
public class LibraryArchiveFragment extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_library_top);
// ここに入力された内容を表示する機能
TextView textView = findViewById(R.id.document_list);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// 文字をタップしたときの処理
// 移動先のアクティビティを指定
Intent intent = new Intent(LibraryArchiveFragment.this, LibraryDocFragment.class);
// データを付加する
intent.putExtra("key_name", "value_data");
startActivity(intent);
}
});
}
}
@@ -3,11 +3,16 @@ package one.nem.lacerta.feature.library;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
@@ -15,6 +20,9 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import java.util.ArrayList;
import java.util.List;
@@ -22,8 +30,12 @@ import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.data.Document;
import one.nem.lacerta.data.LacertaLibrary;
import one.nem.lacerta.model.document.DocumentMeta;
import one.nem.lacerta.model.document.tag.DocumentTag;
import one.nem.lacerta.utils.LacertaLogger;
/**
* A simple {@link Fragment} subclass.
@@ -33,36 +45,18 @@ import one.nem.lacerta.model.document.tag.DocumentTag;
@AndroidEntryPoint
public class LibraryTopFragment extends Fragment {
// @Inject
// Document document;
@Inject
LacertaLibrary lacertaLibrary;
// 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;
@Inject
LacertaLogger logger;
public LibraryTopFragment() {
// 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 LibraryTopFragment.
*/
// TODO: Rename and change types and number of parameters
public static LibraryTopFragment newInstance(String param1, String param2) {
public static LibraryTopFragment newInstance() {
LibraryTopFragment fragment = new LibraryTopFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@@ -70,10 +64,6 @@ public class LibraryTopFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@@ -82,23 +72,35 @@ public class LibraryTopFragment extends Fragment {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_library_top, container, false);
// Use view.findViewById instead of findViewById
RecyclerView documentRecyclerView = view.findViewById(R.id.document_list);
setHasOptionsMenu(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
documentRecyclerView.setLayoutManager(layoutManager);
//データを取得
// List<DocumentMeta> metas = document.getAllDocumentMetas(100);
// Toast.makeText(getContext(), "Documents: " + Integer.toString(metas.size()), Toast.LENGTH_LONG).show();
// Create and set the adapter
// DocumentAdapter adapter = new DocumentAdapter(metas);
// documentRecyclerView.setAdapter(adapter);
// Use a LinearLayoutManager to specify the layout
return view;
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
RecyclerView recyclerView = view.findViewById(R.id.library_item_recycler_view);
ListItemAdapter listItemAdapter = new ListItemAdapter(documentId -> {
Toast.makeText(getContext(), documentId, Toast.LENGTH_SHORT).show();
});
recyclerView.setAdapter(listItemAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> {
logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size());
listItemAdapter.setLibraryItemPage(libraryItemPage);
getActivity().runOnUiThread(() -> {
listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1);
});
});
}
@Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
inflater.inflate(R.menu.dir_menu, menu);
super.onCreateOptionsMenu(menu, inflater);
}
}
@@ -0,0 +1,74 @@
package one.nem.lacerta.feature.library;
import android.content.Intent;
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;
import java.util.ArrayList;
import one.nem.lacerta.model.LibraryItemPage;
import one.nem.lacerta.model.ListItem;
public class ListItemAdapter extends RecyclerView.Adapter<ListItemAdapter.ListItemViewHolder>{
LibraryItemPage libraryItemPage;
DocumentSelectListener listener;
public ListItemAdapter(DocumentSelectListener listener) {
this.listener = listener;
}
public void setLibraryItemPage(LibraryItemPage libraryItemPage) {
this.libraryItemPage = libraryItemPage;
}
@NonNull
@Override
public ListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(one.nem.lacerta.shared.ui.R.layout.common_list_item, parent, false);
return new ListItemViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ListItemViewHolder holder, int position) {
ListItem listItem = libraryItemPage.getListItems().get(position);
holder.icon.setImageResource(listItem.getItemType().getIconId());
holder.icon.setColorFilter(one.nem.lacerta.shared.ui.R.color.colorOnSurface);
holder.title.setText(listItem.getTitle());
holder.description.setText(listItem.getDescription());
holder.itemView.setOnClickListener( v -> {
// Intent intent = new Intent(v.getContext(), ViewerMainActivity.class);
// intent.putExtra("documentId", listItem.getItemId());
// v.getContext().startActivity(intent);
});
}
@Override
public int getItemCount() {
return this.libraryItemPage == null ? 0
: this.libraryItemPage.getListItems() == null ? 0 : this.libraryItemPage.getListItems().size();
}
public static class ListItemViewHolder extends RecyclerView.ViewHolder{
ImageView icon;
TextView title;
TextView description;
public ListItemViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_icon);
title = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_title);
description = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_description);
}
}
}
@@ -1,32 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/Theme.Lacerta"
tools:context=".LibraryTopFragment">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryContainer"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="Library"
app:titleTextColor="@color/colorOnPrimaryContainer" />
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/document_list"
android:id="@+id/library_item_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tool_bar" />
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_item_create_new_folder"
android:icon="@drawable/developer_mode_24px"
android:title="@string/app_name"
app:showAsAction="ifRoom"/> <!-- TODO-rca: change this -->
</menu>
+1 -1
View File
@@ -4,7 +4,7 @@ plugins {
android {
namespace 'one.nem.lacerta.feature.scan'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
+14 -6
View File
@@ -4,7 +4,7 @@ plugins {
android {
namespace 'one.nem.lacerta.feature.search'
compileSdk 33
compileSdk 34
defaultConfig {
minSdk 26
@@ -27,9 +27,17 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation libs.androidx.appcompat
implementation libs.com.google.android.material
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
// Navigation
implementation libs.navigation.fragment
implementation libs.navigation.ui
implementation libs.navigation.dynamic.features.fragment
// shared
implementation project(':shared:ui')
}
@@ -0,0 +1,142 @@
package one.nem.lacerta.feature.search;
import android.app.LauncherActivity;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SearchView;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
* Use the {@link SearchTopFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SearchTopFragment extends Fragment {
private static final String TAG = SearchTopFragment.class.getSimpleName();
private final SearchTopFragment self = this;
private SearchView searchView;
private String searchWord;
// 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 SearchTopFragment() {
// 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 SearchTopFragment.
*/
// TODO: Rename and change types and number of parameters
public static SearchTopFragment newInstance(String param1, String param2) {
SearchTopFragment fragment = new SearchTopFragment();
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_search_top, container, false);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
this.searchView.setIconifiedByDefault(true);
this.searchView.setSubmitButtonEnabled(false);
if (!this.searchWord.equals("")) {
this.searchView.setQuery(this.searchWord, false);
} else {
String queryHint = self.getResources().getString(R.string.hello_blank_fragment);
this.searchView.setQueryHint(queryHint);
}
this.searchView.setOnQueryTextListener(self.onQueryTextListener);
}
private final SearchView.OnQueryTextListener onQueryTextListener = new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return self.setSearchWord(searchWord);
}
@Override
public boolean onQueryTextChange(String query) {
return false;
}
};
private boolean setSearchWord(String query) {
if (searchWord != null && !searchWord.equals("")) {
this.searchWord = searchWord;
}
this.searchView.setIconified(false);
this.searchView.onActionViewCollapsed();
this.searchView.clearFocus();
return false;
}
}
interface LacertaSearch {
ArrayList<LauncherActivity.ListItem> autoSearch(String query, int limit);
ArrayList<LauncherActivity.ListItem> autoSearch(String query, int limit, int offset);
}
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".SearchTopFragment">
<!-- TODO: Update blank fragment layout -->
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/Search_tool_bar"
android:layout_width="match_parent"
android:layout_height="69dp"
android:background="#E4E8EA"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="" />
<SearchView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/feature_search_navigation"
app:startDestination="@id/searchTopFragment">
<fragment
android:id="@+id/searchTopFragment"
android:name="one.nem.lacerta.feature.search.SearchTopFragment"
android:label="fragment_search_top"
tools:layout="@layout/fragment_search_top" />
</navigation>
@@ -0,0 +1,4 @@
<resources>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
+1
View File
@@ -0,0 +1 @@
/build
+48
View File
@@ -0,0 +1,48 @@
plugins {
alias(libs.plugins.com.android.library)
}
android {
namespace 'one.nem.lacerta.setting'
compileSdk 34
defaultConfig {
minSdk 26
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation libs.androidx.appcompat
implementation libs.com.google.android.material
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
// Navigation
implementation libs.navigation.fragment
implementation libs.navigation.ui
implementation libs.navigation.dynamic.features.fragment
// DI
implementation libs.com.google.dagger.hilt.android
annotationProcessor libs.com.google.dagger.hilt.compiler
// shared
implementation project(':shared:ui')
}
View File
Whitespace-only changes.
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,26 @@
package one.nem.lacerta.setting;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("one.nem.lacerta.setting.test", appContext.getPackageName());
}
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
@@ -0,0 +1,63 @@
package one.nem.lacerta.setting;
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.navigation.Navigation;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import one.nem.lacerta.setting.model.SettingListItem;
public class ListItemAdapter extends RecyclerView.Adapter<ListItemAdapter.ListItemViewHolder>{
ArrayList<SettingListItem> listItems;
public ListItemAdapter(ArrayList<SettingListItem> listItems){
this.listItems = listItems;
}
@NonNull
@Override
public ListItemAdapter.ListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(one.nem.lacerta.shared.ui.R.layout.common_list_item, parent, false);
return new ListItemViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ListItemAdapter.ListItemViewHolder holder, int position) {
SettingListItem listItem = listItems.get(position);
holder.icon.setImageDrawable(listItem.getIcon());
holder.icon.setColorFilter(one.nem.lacerta.shared.ui.R.color.colorOnSurface);
holder.title.setText(listItem.getTitle());
holder.description.setText(listItem.getDescription());
holder.itemView.setOnClickListener( v -> {
Navigation.findNavController(v).navigate(listItem.getDestination());
});
}
@Override
public int getItemCount() {
return listItems.size();
}
public static class ListItemViewHolder extends RecyclerView.ViewHolder{
ImageView icon;
TextView title;
TextView description;
public ListItemViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_icon);
title = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_title);
description = itemView.findViewById(one.nem.lacerta.shared.ui.R.id.item_description);
}
}
}
@@ -0,0 +1,43 @@
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 SettingAboutPageFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SettingAboutPageFragment extends Fragment {
public SettingAboutPageFragment() {
// Required empty public constructor
}
public static SettingAboutPageFragment newInstance() {
SettingAboutPageFragment fragment = new SettingAboutPageFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_setting_about_page, container, false);
return view;
}
}
@@ -0,0 +1,40 @@
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 SettingDataPageFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SettingDataPageFragment extends Fragment {
public SettingDataPageFragment() {
// Required empty public constructor
}
public static SettingDataPageFragment newInstance() {
SettingDataPageFragment fragment = new SettingDataPageFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_setting_data_page, container, false);
}
}
@@ -0,0 +1,40 @@
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 SettingDisplayPageFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SettingDisplayPageFragment extends Fragment {
public SettingDisplayPageFragment() {
// Required empty public constructor
}
public static SettingDisplayPageFragment newInstance() {
SettingDisplayPageFragment fragment = new SettingDisplayPageFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_setting_display_page, container, false);
}
}
@@ -0,0 +1,41 @@
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 SettingScanPageFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SettingScanPageFragment extends Fragment {
public SettingScanPageFragment() {
// Required empty public constructor
}
public static SettingScanPageFragment newInstance() {
SettingScanPageFragment fragment = new SettingScanPageFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_setting_scan_page, container, false);
}
}
@@ -0,0 +1,92 @@
package one.nem.lacerta.setting;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import one.nem.lacerta.setting.model.SettingListItem;
/**
* A simple {@link Fragment} subclass.
* Use the {@link SettingTopFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SettingTopFragment extends Fragment {
public SettingTopFragment() {
// Required empty public constructor
}
public static SettingTopFragment newInstance() {
SettingTopFragment fragment = new SettingTopFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_setting_top, container, false);
// Setting items
ArrayList<SettingListItem> settingListItems = new ArrayList<>();
settingListItems.add(
new SettingListItem(
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_display_title),
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_display_description),
ContextCompat.getDrawable(getContext(), one.nem.lacerta.shared.ui.R.drawable.palette_24px),
R.id.action_settingTopFragment_to_settingDisplayPageFragment
)
);
settingListItems.add(
new SettingListItem(
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_data_title),
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_data_description),
ContextCompat.getDrawable(getContext(), one.nem.lacerta.shared.ui.R.drawable.settings_backup_restore_24px),
R.id.action_settingTopFragment_to_settingDataPageFragment
)
);
settingListItems.add(
new SettingListItem(
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_scan_title),
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_scan_description),
ContextCompat.getDrawable(getContext(), one.nem.lacerta.shared.ui.R.drawable.document_scanner_24px),
R.id.action_settingTopFragment_to_settingScanPageFragment
)
);
settingListItems.add(
new SettingListItem(
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_about_title),
getResources().getString(one.nem.lacerta.shared.ui.R.string.setting_top_about_description),
ContextCompat.getDrawable(getContext(), one.nem.lacerta.shared.ui.R.drawable.info_24px),
R.id.action_settingTopFragment_to_settingAboutPageFragment
)
);
// Init RecyclerView
RecyclerView recyclerView = view.findViewById(R.id.setting_item_recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(new ListItemAdapter(settingListItems));
return view;
}
}
@@ -0,0 +1,34 @@
package one.nem.lacerta.setting.model;
import android.graphics.drawable.Drawable;
public class SettingListItem {
String title;
String description;
Drawable icon;
int destination;
public SettingListItem(String title, String description, Drawable icon, int destination) {
this.title = title;
this.description = description;
this.icon = icon;
this.destination = destination;
}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
public Drawable getIcon() {
return icon;
}
public int getDestination() {
return destination;
}
}
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SettingAboutPageFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SettingDataPageFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SettingDisplayPageFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SettingScanPageFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
@@ -0,0 +1,11 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/setting_item_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/feature_setting_navigation"
app:startDestination="@id/settingTopFragment">
<fragment
android:id="@+id/settingTopFragment"
android:name="one.nem.lacerta.setting.SettingTopFragment"
android:label="SettingTopFragment" >
<action
android:id="@+id/action_settingTopFragment_to_settingAboutPageFragment"
app:destination="@id/settingAboutPageFragment"
app:enterAnim="@anim/slide_from_right"
app:exitAnim="@anim/slide_to_left"
app:popEnterAnim="@anim/slide_from_left"
app:popExitAnim="@anim/slide_to_right" />
<action
android:id="@+id/action_settingTopFragment_to_settingDisplayPageFragment"
app:destination="@id/settingDisplayPageFragment"
app:enterAnim="@anim/slide_from_right"
app:exitAnim="@anim/slide_to_left"
app:popEnterAnim="@anim/slide_from_left"
app:popExitAnim="@anim/slide_to_right" />
<action
android:id="@+id/action_settingTopFragment_to_settingDataPageFragment"
app:destination="@id/settingDataPageFragment"
app:enterAnim="@anim/slide_from_right"
app:exitAnim="@anim/slide_to_left"
app:popEnterAnim="@anim/slide_from_left"
app:popExitAnim="@anim/slide_to_right" />
<action
android:id="@+id/action_settingTopFragment_to_settingScanPageFragment"
app:destination="@id/settingScanPageFragment"
app:enterAnim="@anim/slide_from_right"
app:exitAnim="@anim/slide_to_left"
app:popEnterAnim="@anim/slide_from_left"
app:popExitAnim="@anim/slide_to_right" />
</fragment>
<fragment
android:id="@+id/settingAboutPageFragment"
android:name="one.nem.lacerta.setting.SettingAboutPageFragment"
android:label="fragment_setting_about_page"
tools:layout="@layout/fragment_setting_about_page" />
<fragment
android:id="@+id/settingDataPageFragment"
android:name="one.nem.lacerta.setting.SettingDataPageFragment"
android:label="fragment_setting_data_page"
tools:layout="@layout/fragment_setting_data_page" />
<fragment
android:id="@+id/settingDisplayPageFragment"
android:name="one.nem.lacerta.setting.SettingDisplayPageFragment"
android:label="fragment_setting_display_page"
tools:layout="@layout/fragment_setting_display_page" />
<fragment
android:id="@+id/settingScanPageFragment"
android:name="one.nem.lacerta.setting.SettingScanPageFragment"
android:label="fragment_setting_scan_page"
tools:layout="@layout/fragment_setting_scan_page" />
</navigation>
@@ -0,0 +1,4 @@
<resources>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
@@ -0,0 +1,17 @@
package one.nem.lacerta.setting;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
@@ -73,4 +73,6 @@ public class DocumentDetail {
this.pages = pages;
}
}
}
@@ -48,6 +48,17 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応
public DocumentMeta() {
}
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.path = new PublicPath().getRoot();
this.updatedAt = new Date();
this.createdAt = new Date();
}
public DocumentMeta(String title, List<DocumentTag> tags, String author, String defaultBranch) {
this.id = UUID.randomUUID().toString();
this.title = title;
@@ -0,0 +1,30 @@
package one.nem.lacerta.model.pref;
public enum FeatureSwitchOverride {
ENABLE_DEBUG_MENU("enableDebugMenu"),
ENABLE_SEARCH("enableSearch"),
SHOW_DISPLAY_MENU("showDisplayMenu"),
SHOW_DATA_MENU("showDataMenu"),
SHOW_SCAN_MENU("showScanMenu");
private final String key;
FeatureSwitchOverride(String key) {
this.key = key;
}
public String getKey() {
return key;
}
public static FeatureSwitchOverride fromKey(String key) {
for (FeatureSwitchOverride value : values()) {
if (value.getKey().equals(key)) {
return value;
}
}
return null;
}
}
@@ -7,13 +7,13 @@ import one.nem.lacerta.model.document.DocumentDetail;
public interface DocumentProcessor {
// ページ操作
void addNewPageToLast(Bitmap bitmap) throws Exception;
void addNewPagesToLast(Bitmap[] bitmaps) throws Exception;
void insertPageAtIndex(Bitmap bitmap, int index) throws Exception;
void removePageAtIndex(int index) throws Exception;
DocumentProcessor addNewPageToLast(Bitmap bitmap) throws Exception;
DocumentProcessor addNewPagesToLast(Bitmap[] bitmaps) throws Exception;
DocumentProcessor insertPageAtIndex(Bitmap bitmap, int index) throws Exception;
DocumentProcessor removePageAtIndex(int index) throws Exception;
// 更新
void updatePageAtIndex(Bitmap bitmap, int index);
DocumentProcessor updatePageAtIndex(Bitmap bitmap, int index);
// ページ取得
Bitmap getPageAtIndex(int index);
@@ -70,7 +70,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{
@Override
public void addNewPageToLast(Bitmap bitmap) throws Exception{
public DocumentProcessor addNewPageToLast(Bitmap bitmap) throws Exception{
logger.debug("addNewPageToLast", "called");
String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする
@@ -85,19 +85,23 @@ public class DocumentProcessorImpl implements DocumentProcessor{
logger.info("addNewPageToLast", "finished");
logger.info("addNewPageToLast", "filename: " + filename);
return this;
}
@Override
public void addNewPagesToLast(Bitmap[] bitmaps) throws Exception{
public DocumentProcessor addNewPagesToLast(Bitmap[] bitmaps) throws Exception{
logger.debug("addNewPagesToLast", "called");
for (Bitmap bitmap : bitmaps) {
addNewPageToLast(bitmap);
} // TODO-rca: 効率悪いので改善する
return this;
}
@Override
public void insertPageAtIndex(Bitmap bitmap, int index) throws Exception {
public DocumentProcessor insertPageAtIndex(Bitmap bitmap, int index) throws Exception {
logger.debug("addNewPageAfterIndex", "called");
String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする
@@ -109,16 +113,18 @@ public class DocumentProcessorImpl implements DocumentProcessor{
this.documentDetail.getPages().add(index, page);
lacertaVcs.insertPage(index, filename);
return this;
}
@Override
public void removePageAtIndex(int index) {
public DocumentProcessor removePageAtIndex(int index) {
return null;
}
@Override
public void updatePageAtIndex(Bitmap bitmap, int index) {
public DocumentProcessor updatePageAtIndex(Bitmap bitmap, int index) {
return null;
}
@Override
+1
View File
@@ -31,3 +31,4 @@ include ':model'
include ':processor'
include ':shared:ui'
include ':vcs'
include ':feature:setting'
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="-100%p" android:toXDelta="0"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
</set>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%p" android:toXDelta="0"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
</set>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="-100%p"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
</set>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="100%p"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
android:duration="@android:integer/config_mediumAnimTime" />
android:duration="120" />
</set>
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@color/colorOnBackground"
android:pathData="M90,230L90,50L270,50L270,110L150,110L150,230L90,230ZM810,230L810,110L690,110L690,50L870,50L870,230L810,230ZM90,910L90,730L150,730L150,850L270,850L270,910L90,910ZM690,910L690,850L810,850L810,730L870,730L870,910L690,910ZM270,717.69Q270,722.31 273.85,726.15Q277.69,730 282.31,730L677.69,730Q682.31,730 686.15,726.15Q690,722.31 690,717.69L690,242.31Q690,237.69 686.15,233.85Q682.31,230 677.69,230L282.31,230Q277.69,230 273.85,233.85Q270,237.69 270,242.31L270,717.69ZM282.31,790Q252,790 231,769Q210,748 210,717.69L210,242.31Q210,212 231,191Q252,170 282.31,170L677.69,170Q708,170 729,191Q750,212 750,242.31L750,717.69Q750,748 729,769Q708,790 677.69,790L282.31,790ZM370,390L590,390L590,330L370,330L370,390ZM370,510L590,510L590,450L370,450L370,510ZM370,630L590,630L590,570L370,570L370,630ZM270,717.69L270,242.31Q270,237.69 270,233.85Q270,230 270,230L270,230Q270,230 270,233.85Q270,237.69 270,242.31L270,717.69Q270,722.31 270,726.15Q270,730 270,730L270,730Q270,730 270,726.15Q270,722.31 270,717.69Z"/>
</vector>
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@color/colorOnBackground"
android:pathData="M450,670L510,670L510,440L450,440L450,670ZM480,371.54Q493.73,371.54 503.02,362.25Q512.31,352.96 512.31,339.23Q512.31,325.5 503.02,316.21Q493.73,306.92 480,306.92Q466.27,306.92 456.98,316.21Q447.69,325.5 447.69,339.23Q447.69,352.96 456.98,362.25Q466.27,371.54 480,371.54ZM480.07,860Q401.23,860 331.86,830.08Q262.49,800.16 211.18,748.87Q159.87,697.58 129.93,628.24Q100,558.9 100,480.07Q100,401.23 129.92,331.86Q159.84,262.49 211.13,211.18Q262.42,159.87 331.76,129.93Q401.1,100 479.93,100Q558.77,100 628.14,129.92Q697.51,159.84 748.82,211.13Q800.13,262.42 830.07,331.76Q860,401.1 860,479.93Q860,558.77 830.08,628.14Q800.16,697.51 748.87,748.82Q697.58,800.13 628.24,830.07Q558.9,860 480.07,860ZM480,800Q614,800 707,707Q800,614 800,480Q800,346 707,253Q614,160 480,160Q346,160 253,253Q160,346 160,480Q160,614 253,707Q346,800 480,800ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>
</vector>
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@color/colorOnBackground"
android:pathData="M479.23,860Q401.46,860 332.31,830.04Q263.15,800.08 211.54,748.46Q159.92,696.84 129.96,627.5Q100,558.15 100,480Q100,400.85 130.77,331.5Q161.54,262.16 214.35,210.85Q267.15,159.54 337.89,129.77Q408.62,100 488.77,100Q563.77,100 630.92,125.58Q698.08,151.16 748.88,196.39Q799.69,241.62 829.84,303.89Q860,366.15 860,438.92Q860,542.77 798.27,601.38Q736.54,660 640,660L567.54,660Q550.46,660 540.23,671.15Q530,682.31 530,697.54Q530,716.08 545,736.08Q560,756.08 560,782Q560,821.61 538.08,840.81Q516.15,860 479.23,860ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480ZM260,510Q281.38,510 295.69,495.69Q310,481.38 310,460Q310,438.62 295.69,424.31Q281.38,410 260,410Q238.62,410 224.31,424.31Q210,438.62 210,460Q210,481.38 224.31,495.69Q238.62,510 260,510ZM380,350Q401.38,350 415.69,335.69Q430,321.38 430,300Q430,278.62 415.69,264.31Q401.38,250 380,250Q358.62,250 344.31,264.31Q330,278.62 330,300Q330,321.38 344.31,335.69Q358.62,350 380,350ZM580,350Q601.38,350 615.69,335.69Q630,321.38 630,300Q630,278.62 615.69,264.31Q601.38,250 580,250Q558.62,250 544.31,264.31Q530,278.62 530,300Q530,321.38 544.31,335.69Q558.62,350 580,350ZM700,510Q721.38,510 735.69,495.69Q750,481.38 750,460Q750,438.62 735.69,424.31Q721.38,410 700,410Q678.62,410 664.31,424.31Q650,438.62 650,460Q650,481.38 664.31,495.69Q678.62,510 700,510ZM479.23,800Q489,800 494.5,795.19Q500,790.39 500,782Q500,768 485,750.54Q470,733.08 470,695.85Q470,653.08 499,626.54Q528,600 570,600L640,600Q710.62,600 755.31,558.61Q800,517.23 800,438.92Q800,317.54 706.92,238.77Q613.85,160 488.77,160Q351.61,160 255.81,253Q160,346 160,480Q160,613 253.5,706.5Q347,800 479.23,800Z"/>
</vector>
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@color/colorOnBackground"
android:pathData="M479.23,540Q454.69,540 436.96,522.27Q419.23,504.54 419.23,480Q419.23,455.46 436.96,437.73Q454.69,420 479.23,420Q503.77,420 521.5,437.73Q539.23,455.46 539.23,480Q539.23,504.54 521.5,522.27Q503.77,540 479.23,540ZM479.23,820Q348.69,820 252.46,734.27Q156.23,648.54 141.62,520L202.85,520Q218,623.61 296.27,691.81Q374.54,760 479.23,760Q596.23,760 677.73,678.5Q759.23,597 759.23,480Q759.23,363 677.73,281.5Q596.23,200 479.23,200Q413.69,200 356.39,229.11Q299.08,258.23 257.69,309.23L362.31,309.23L362.31,369.23L159.23,369.23L159.23,166.15L219.23,166.15L219.23,260.92Q267.92,203.46 335.85,171.73Q403.77,140 479.23,140Q550.03,140 611.86,166.77Q673.69,193.54 719.69,239.54Q765.69,285.54 792.46,347.36Q819.23,409.19 819.23,479.98Q819.23,550.77 792.46,612.61Q765.69,674.46 719.69,720.46Q673.69,766.46 611.86,793.23Q550.03,820 479.23,820Z"/>
</vector>
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="24dp"
android:paddingVertical="16dp">
<ImageView
android:id="@+id/item_icon"
android:layout_width="32dp"
android:layout_height="0dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/item_text_container"
app:srcCompat="@drawable/description_24px"
android:contentDescription="icon" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/item_text_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/item_icon"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/item_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginEnd="8dp"
android:text="Placeholder Title"
android:textColor="@color/colorOnSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/item_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="14sp"
android:text="Placeholder Description"
android:textColor="@color/colorOnSurfaceSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/item_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.Theme.Lacerta" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorOnPrimary">@color/colorOnPrimary</item>
<item name="colorSecondary">@color/colorSecondary</item>
<item name="colorOnSecondary">@color/colorOnSecondary</item>
<item name="colorSurface">@color/colorSurface</item>
<item name="colorOnSurface">@color/colorOnSurface</item>
<item name="colorSurfaceVariant">@color/colorSurfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/colorOnSurfaceVariant</item>
<item name="colorSurfaceInverse">@color/colorSurfaceInverse</item>
<item name="colorOnSurfaceInverse">@color/colorOnSurfaceInverse</item>
<item name="colorPrimaryInverse">@color/colorPrimaryInverse</item>
<item name="colorPrimaryContainer">@color/colorPrimaryContainer</item>
<item name="colorOnPrimaryContainer">@color/colorOnPrimaryContainer</item>
<item name="colorSecondaryContainer">@color/colorSecondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/colorOnSecondaryContainer</item>
<item name="colorTertiary">@color/colorTertiary</item>
<item name="colorOnTertiary">@color/colorOnTertiary</item>
<item name="colorTertiaryContainer">@color/colorTertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/colorOnTertiaryContainer</item>
<item name="colorError">@color/colorError</item>
<item name="colorOnError">@color/colorOnError</item>
<item name="colorErrorContainer">@color/colorErrorContainer</item>
<item name="colorOnErrorContainer">@color/colorOnErrorContainer</item>
<item name="colorOutline">@color/colorOutline</item>
<item name="colorOnBackground">@color/colorOnBackground</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="android:windowLightStatusBar">false</item>
</style>
</resources>
@@ -25,4 +25,8 @@
<color name="colorSurfaceVariant">@color/material_dynamic_neutral_variant90</color>
<color name="colorOnSurfaceVariant">@color/material_dynamic_neutral_variant30</color>
<color name="colorSurfaceInverse">@color/material_dynamic_neutral20</color>
<!-- indicator icon background -->
<color name="colorIndicator">@color/material_dynamic_secondary70</color>
<color name="colorOnSurfaceSecondary">@color/material_dynamic_neutral_variant30</color>
</resources>
@@ -25,4 +25,8 @@
<color name="colorSurfaceInverse">#313033</color>
<color name="colorOnSurfaceInverse">#F4EFF4</color>
<color name="colorPrimaryInverse">#D0BCFF</color>
<!-- indicator icon background -->
<color name="colorIndicator">#d2d4bc</color>
<color name="colorOnSurfaceSecondary">#49454F</color>
</resources>
@@ -24,4 +24,8 @@
<color name="colorSurfaceVariant">@color/material_dynamic_neutral_variant90</color>
<color name="colorOnSurfaceVariant">@color/material_dynamic_neutral_variant30</color>
<color name="colorSurfaceInverse">@color/material_dynamic_neutral20</color>
<!-- indicator icon background -->
<color name="colorIndicator">@color/material_dynamic_secondary80</color>
<color name="colorOnSurfaceSecondary">@color/material_dynamic_neutral_variant30</color>
</resources>
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff. Show more