mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-07 19:47:36 +00:00
Compare commits
74
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da207fe251 | ||
|
|
e7ababe65a | ||
|
|
cbf56dd331 | ||
|
|
1a360057b6 | ||
|
|
bc8e68126b | ||
|
|
ccb4dc4bb6 | ||
|
|
2690eec511 | ||
|
|
8eee8843b7 | ||
|
|
e8f51d3717 | ||
|
|
c2aada949e | ||
|
|
9725c1a07c | ||
|
|
1090e1bf74 | ||
|
|
a9b76161b7 | ||
|
|
37af356c92 | ||
|
|
af4513212d | ||
|
|
3f58c623f3 | ||
|
|
a754198d75 | ||
|
|
8ee554d445 | ||
|
|
c346170a9d | ||
|
|
5bd84e730f | ||
|
|
9a56846e3a | ||
|
|
8cd49804ca | ||
|
|
993f34e1fe | ||
|
|
81ceaaf0d6 | ||
|
|
d77cedc68f | ||
|
|
283146a81f | ||
|
|
dc4879c900 | ||
|
|
2f6bd99572 | ||
|
|
527d3c309f | ||
|
|
f326771aaf | ||
|
|
d2ebed3934 | ||
|
|
3cd1f50f34 | ||
|
|
c663d78e11 | ||
|
|
bb36458c4d | ||
|
|
7107b03de9 | ||
|
|
db4da7812b | ||
|
|
a6ee0c12f4 | ||
|
|
f9f07972ac | ||
|
|
e8876cec73 | ||
|
|
01f0d74ab6 | ||
|
|
1036cbe5d9 | ||
|
|
b1886438e1 | ||
|
|
5bc54f6083 | ||
|
|
f937503840 | ||
|
|
9f41632b0f | ||
|
|
fb2ba1e6e5 | ||
|
|
3930ec6d9c | ||
|
|
ca61d2c055 | ||
|
|
451e8532d1 | ||
|
|
8314f850f6 | ||
|
|
78ad88206c | ||
|
|
5dcb27a2e9 | ||
|
|
f833465dc8 | ||
|
|
4ac03fd4f3 | ||
|
|
17b2392fea | ||
|
|
68f2ba3b59 | ||
|
|
91bbca54ff | ||
|
|
19dfa070fd | ||
|
|
b7f55ef0db | ||
|
|
1c91b52431 | ||
|
|
1b85845499 | ||
|
|
523008ff3f | ||
|
|
50c2b1dc4d | ||
|
|
ae8f7ef1f1 | ||
|
|
27766effc1 | ||
|
|
f7fe8b35b1 | ||
|
|
87c4738f37 | ||
|
|
96bfca0550 | ||
|
|
0140c0376b | ||
|
|
89a3a179bd | ||
|
|
ff905d9280 | ||
|
|
4b0ea02f16 | ||
|
|
ca37a97e2f | ||
|
|
217f096a38 |
No files matched your search
@@ -7,6 +7,44 @@ WIP
|
||||
## メモ
|
||||
- アイコン: Google Material Icons https://fonts.google.com/icons (Weight:300, Grade:0, Optical size: 24px)
|
||||
|
||||
## モジュール構成
|
||||
### モジュール一覧
|
||||
- `component` : コンポーネント
|
||||
- `common` : 共通コンポーネント
|
||||
- UIの中で共通で使う要素(メニューアイテムとか)
|
||||
- `scanner` : スキャナー
|
||||
- スキャナーの実装
|
||||
- `viewer` : ビューワー
|
||||
- ドキュメントビューワーの実装
|
||||
- `data` : データ
|
||||
- UIからデータを取得/保存するためのラッパーモジュール
|
||||
- `Document` : ドキュメント関係
|
||||
- WIP(JavaDocを参照してください, 余裕があったら追記します)
|
||||
- `feature` : 機能モジュール(ナビゲーションからみた機能で分割)
|
||||
- `common`: 共通機能
|
||||
- 設定画面とか、どこからでも呼ばれうる画面
|
||||
- `debug`: デバッグメニュー
|
||||
- `home`: ホーム画面
|
||||
- `library`: ライブラリ画面
|
||||
- `scan`: スキャン画面
|
||||
- `search`: 検索画面
|
||||
- `model` : モデル
|
||||
- データモデルをまとめたモジュール (WIP)
|
||||
- `document` : ドキュメント
|
||||
- `meta` : メタデータ
|
||||
- `processor` : プロセッサ
|
||||
- いくつかの処理をまとめたモジュール
|
||||
- `DocumentProcessor` : ドキュメント処理(ドキュメントにページを追加したり更新したり)
|
||||
- `shared` :
|
||||
- 共有リソース
|
||||
- `source` : ソース
|
||||
- (バックエンドが使うのでとりあえず後回し、フロントから直接操作することは絶対にありません)
|
||||
- `utils` : ユーティリティ
|
||||
- ちょっとしたユーティリティをまとめたモジュール
|
||||
- `LacertaLogger` : ロガー
|
||||
- `XmlMetaParser` : XMLメタデータパーサー(フロントから直接操作することは絶対にありません)
|
||||
|
||||
|
||||
## コーディング規則/推奨(WIP)
|
||||
### 規則
|
||||
- `// TODO`コメントには任意のsuffixを付ける
|
||||
|
||||
@@ -41,6 +41,9 @@ dependencies {
|
||||
// JGit
|
||||
implementation 'org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r'
|
||||
|
||||
// Java Faker
|
||||
implementation 'com.github.javafaker:javafaker:1.0.2'
|
||||
|
||||
// Room
|
||||
implementation libs.androidx.room.runtime
|
||||
annotationProcessor libs.androidx.room.compiler
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package one.nem.lacerta.data;
|
||||
|
||||
import one.nem.lacerta.model.ListItemType;
|
||||
|
||||
import one.nem.lacerta.model.LibraryItemPage;
|
||||
import one.nem.lacerta.model.document.DocumentDetail;
|
||||
|
||||
public interface LacertaLibrary {
|
||||
|
||||
// Get History
|
||||
LibraryItemPage getRecentDocument(int limit);
|
||||
LibraryItemPage 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);
|
||||
|
||||
// GetDocument
|
||||
DocumentDetail getDocumentDetailById(String id);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package one.nem.lacerta.data;
|
||||
|
||||
import one.nem.lacerta.model.ListItem;
|
||||
|
||||
public interface LacertaSearch {
|
||||
|
||||
ListItem autoSearch(String query, int limit);
|
||||
|
||||
ListItem autoSearch(String query, int limit, int offset);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package one.nem.lacerta.data.impl;
|
||||
|
||||
import one.nem.lacerta.data.LacertaLibrary;
|
||||
import one.nem.lacerta.model.LibraryItemPage;
|
||||
import one.nem.lacerta.model.document.DocumentDetail;
|
||||
|
||||
public class LacertaLibraryImpl implements LacertaLibrary {
|
||||
@Override
|
||||
public LibraryItemPage getRecentDocument(int limit) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryItemPage getRecentDocument(int limit, int offset) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryItemPage getLibraryPage(int limit) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryItemPage getLibraryPage(int limit, int offset) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryItemPage getLibraryPage(String pageId, int limit) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryItemPage getLibraryPage(String pageId, int limit, int offset) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentDetail getDocumentDetailById(String id) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package one.nem.lacerta.data.module;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.hilt.InstallIn;
|
||||
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.utils.LacertaLogger;
|
||||
|
||||
@Module
|
||||
// Fragmentにinstall
|
||||
@InstallIn(FragmentComponent.class)
|
||||
abstract public class LacertaLibraryModule {
|
||||
|
||||
@Binds
|
||||
public abstract LacertaLibrary bindLacertaLibrary(LacertaLibraryStubImpl impl);
|
||||
|
||||
}
|
||||
-110
@@ -1,110 +0,0 @@
|
||||
package one.nem.lacerta.feature.debug;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
import one.nem.lacerta.source.file.FileManager;
|
||||
import one.nem.lacerta.source.file.factory.FileManagerFactory;
|
||||
|
||||
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link DebugMenuFileManagerTesterFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
public class DebugMenuFileManagerTesterFragment extends Fragment {
|
||||
|
||||
public DebugMenuFileManagerTesterFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
@Inject
|
||||
FileManagerFactory fileManagerFactory;
|
||||
|
||||
@Inject
|
||||
DeviceInfoUtils deviceInfoUtils;
|
||||
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static DebugMenuFileManagerTesterFragment newInstance() {
|
||||
DebugMenuFileManagerTesterFragment fragment = new DebugMenuFileManagerTesterFragment();
|
||||
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_debug_menu_file_manager_tester, container, false);
|
||||
|
||||
view.findViewById(R.id.button_create_directory).setOnClickListener(v -> {
|
||||
EditText editText = view.findViewById(R.id.edit_text_dir_name);
|
||||
String dirName = editText.getText().toString();
|
||||
|
||||
// FileManager fileManager = fileManagerFactory.create(deviceInfoUtils.getExternalStorageDirectory());
|
||||
// fileManager.createDir(dirName);
|
||||
});
|
||||
|
||||
view.findViewById(R.id.button_save_item).setOnClickListener(v -> {
|
||||
// FileManager fileManager = fileManagerFactory.create(deviceInfoUtils.getExternalStorageDirectory());
|
||||
// fileManager.createDir("test");
|
||||
// fileManager.changeDir("test");
|
||||
// Bitmap bitmap = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
|
||||
// // Bitmapに描画処理を行う
|
||||
// Canvas canvas = new Canvas(bitmap);
|
||||
// // 大きな山の形状を作成
|
||||
// android.graphics.Path bigMountainPath = new android.graphics.Path();
|
||||
// bigMountainPath.moveTo(100, 800); // 左下の開始点
|
||||
// bigMountainPath.lineTo(500, 300); // 頂点
|
||||
// bigMountainPath.lineTo(900, 800); // 右下
|
||||
// bigMountainPath.close(); // パスを閉じる
|
||||
//
|
||||
// // 山の描画設定
|
||||
// Paint mountainPaint = new Paint();
|
||||
// mountainPaint.setColor(Color.GREEN);
|
||||
// mountainPaint.setStyle(Paint.Style.FILL);
|
||||
//
|
||||
// // 大きな山を描画
|
||||
// canvas.drawPath(bigMountainPath, mountainPaint);
|
||||
//
|
||||
// // 小さな山の形状を作成
|
||||
// android.graphics.Path smallMountainPath = new android.graphics.Path();
|
||||
// smallMountainPath.moveTo(400, 800); // 左下の開始点
|
||||
// smallMountainPath.lineTo(650, 400); // 頂点
|
||||
// smallMountainPath.lineTo(900, 800); // 右下
|
||||
// smallMountainPath.close(); // パスを閉じる
|
||||
//
|
||||
// Paint smallMountainPaint = new Paint();
|
||||
// smallMountainPaint.setColor(Color.parseColor("#006e54"));
|
||||
// smallMountainPaint.setStyle(Paint.Style.FILL);
|
||||
//
|
||||
// // 小さな山を描画
|
||||
// canvas.drawPath(smallMountainPath, smallMountainPaint);
|
||||
// fileManager.saveBitmapAtCurrent(bitmap, "test.png");
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package one.nem.lacerta.feature.debug;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.AnimatorRes;
|
||||
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.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
import one.nem.lacerta.data.LacertaLibrary;
|
||||
|
||||
import one.nem.lacerta.model.LibraryItemPage;
|
||||
import one.nem.lacerta.model.document.DocumentDetail;
|
||||
import one.nem.lacerta.model.ListItem;
|
||||
import one.nem.lacerta.model.ListItemType;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link DebugMenuLibraryItemListPageFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
public class DebugMenuLibraryItemListPageFragment extends Fragment {
|
||||
|
||||
@Inject
|
||||
LacertaLibrary lacertaLibrary;
|
||||
|
||||
public DebugMenuLibraryItemListPageFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static DebugMenuLibraryItemListPageFragment newInstance() {
|
||||
DebugMenuLibraryItemListPageFragment fragment = new DebugMenuLibraryItemListPageFragment();
|
||||
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_debug_menu_library_item_list_page, container, false);
|
||||
|
||||
LibraryItemPage libraryItemPage = lacertaLibrary.getRecentDocument(10);
|
||||
for (ListItem listItem : libraryItemPage.getListItems()) {
|
||||
System.out.println(listItem.getTitle());
|
||||
}
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.item_recycler_view);
|
||||
recyclerView.setAdapter(new ItemAdapter(libraryItemPage.getListItems()));
|
||||
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.ItemViewHolder> {
|
||||
private ArrayList<ListItem> listItems;
|
||||
|
||||
public ItemAdapter(ArrayList<ListItem> listItems) {
|
||||
this.listItems = listItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_debug_menu_document, parent, false);
|
||||
return new ItemViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ItemViewHolder holder, int position) {
|
||||
ListItem listItem = listItems.get(position);
|
||||
holder.document_list_item_title.setText(listItem.getTitle());
|
||||
holder.document_list_item_description.setText(listItem.getDescription());
|
||||
holder.document_list_item_updated_at.setText(listItem.getItemType().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listItems.size();
|
||||
}
|
||||
|
||||
public class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView document_list_item_title;
|
||||
TextView document_list_item_description;
|
||||
TextView document_list_item_updated_at;
|
||||
|
||||
|
||||
public ItemViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
document_list_item_title = itemView.findViewById(R.id.document_list_item_title);
|
||||
document_list_item_description = itemView.findViewById(R.id.document_list_item_description);
|
||||
document_list_item_updated_at = itemView.findViewById(R.id.document_list_item_updated_at);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
package one.nem.lacerta.feature.debug;
|
||||
|
||||
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 DebugMenuMetaDataFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class DebugMenuMetaDataFragment extends Fragment {
|
||||
public DebugMenuMetaDataFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static DebugMenuMetaDataFragment newInstance() {
|
||||
DebugMenuMetaDataFragment fragment = new DebugMenuMetaDataFragment();
|
||||
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_debug_menu_meta_data, container, false);
|
||||
}
|
||||
}
|
||||
@@ -48,10 +48,9 @@ public class DebugMenuTopFragment extends Fragment {
|
||||
recyclerView.setLayoutManager(new androidx.recyclerview.widget.LinearLayoutManager(getContext()));
|
||||
List<DebugMenuListItem> debugMenuListItems = new ArrayList<>();
|
||||
|
||||
debugMenuListItems.add(new DebugMenuListItem("Meta Data", "View meta data", R.id.action_debugMenuTopFragment_to_debugMenuMetaDataFragment, true));
|
||||
debugMenuListItems.add(new DebugMenuListItem("Document Tester", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment, true));
|
||||
debugMenuListItems.add(new DebugMenuListItem("Scanner", "placeholder", R.id.action_debugMenuTopFragment_to_scannerDataManagerStubFragment, true));
|
||||
debugMenuListItems.add(new DebugMenuListItem("File Manager", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuFileManagerTesterFragment, true));
|
||||
debugMenuListItems.add(new DebugMenuListItem("Document List", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuLibraryItemListPageFragment, true));
|
||||
|
||||
DebugMenuListItemAdapter adapter = new DebugMenuListItemAdapter(debugMenuListItems);
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?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"
|
||||
tools:context=".DebugMenuFileManagerTesterFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_text_dir_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_create_directory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Create dir" />
|
||||
<Button
|
||||
android:id="@+id/button_dir_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="List item in current" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_save_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Save Test Image" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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"
|
||||
tools:context=".DebugMenuLibraryItemListPageFragment">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/item_recycler_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?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=".DebugMenuMetaDataFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
@@ -10,9 +10,6 @@
|
||||
android:name="one.nem.lacerta.feature.debug.DebugMenuTopFragment"
|
||||
android:label="fragment_debug_menu_top"
|
||||
tools:layout="@layout/fragment_debug_menu_top" >
|
||||
<action
|
||||
android:id="@+id/action_debugMenuTopFragment_to_debugMenuMetaDataFragment"
|
||||
app:destination="@id/debugMenuMetaDataFragment" />
|
||||
<action
|
||||
android:id="@+id/action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment"
|
||||
app:destination="@id/debugMenuDocumentTesterTopFragment" />
|
||||
@@ -20,14 +17,9 @@
|
||||
android:id="@+id/action_debugMenuTopFragment_to_scannerDataManagerStubFragment"
|
||||
app:destination="@id/scannerDataManagerStubFragment" />
|
||||
<action
|
||||
android:id="@+id/action_debugMenuTopFragment_to_debugMenuFileManagerTesterFragment"
|
||||
app:destination="@id/debugMenuFileManagerTesterFragment" />
|
||||
android:id="@+id/action_debugMenuTopFragment_to_debugMenuLibraryItemListPageFragment"
|
||||
app:destination="@id/debugMenuLibraryItemListPageFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/debugMenuMetaDataFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugMenuMetaDataFragment"
|
||||
android:label="fragment_debug_menu_meta_data"
|
||||
tools:layout="@layout/fragment_debug_menu_meta_data" />
|
||||
<fragment
|
||||
android:id="@+id/debugMenuDocumentTesterTopFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugMenuDocumentTesterTopFragment"
|
||||
@@ -55,8 +47,8 @@
|
||||
android:name="one.nem.lacerta.component.scanner.ScannerDataManagerStubFragment"
|
||||
android:label="ScannerDataManagerStubFragment" />
|
||||
<fragment
|
||||
android:id="@+id/debugMenuFileManagerTesterFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugMenuFileManagerTesterFragment"
|
||||
android:label="fragment_debug_menu_file_manager_tester"
|
||||
tools:layout="@layout/fragment_debug_menu_file_manager_tester" />
|
||||
android:id="@+id/debugMenuLibraryItemListPageFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugMenuLibraryItemListPageFragment"
|
||||
android:label="fragment_debug_menu_library_item_list_page"
|
||||
tools:layout="@layout/fragment_debug_menu_library_item_list_page" />
|
||||
</navigation>
|
||||
@@ -36,4 +36,6 @@ dependencies {
|
||||
// JGit
|
||||
implementation 'org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r'
|
||||
|
||||
implementation project(":shared:ui")
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package one.nem.lacerta.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class LibraryItemPage {
|
||||
|
||||
String pageTitle;
|
||||
String pageId;
|
||||
ArrayList<ListItem> listItems;
|
||||
|
||||
// Constructor
|
||||
|
||||
public LibraryItemPage(String pageTitle, String pageId, ArrayList<ListItem> listItems) {
|
||||
this.pageTitle = pageTitle;
|
||||
this.pageId = pageId;
|
||||
this.listItems = listItems;
|
||||
}
|
||||
|
||||
public LibraryItemPage() {
|
||||
// Empty constructor
|
||||
}
|
||||
|
||||
// Getter
|
||||
|
||||
public String getPageTitle() {
|
||||
return pageTitle;
|
||||
}
|
||||
|
||||
public String getPageId() {
|
||||
return pageId;
|
||||
}
|
||||
|
||||
public ArrayList<ListItem> getListItems() {
|
||||
return listItems;
|
||||
}
|
||||
|
||||
// Setter
|
||||
|
||||
public void setPageTitle(String pageTitle) {
|
||||
this.pageTitle = pageTitle;
|
||||
}
|
||||
|
||||
public void setPageId(String pageId) {
|
||||
this.pageId = pageId;
|
||||
}
|
||||
|
||||
public void setListItems(ArrayList<ListItem> listItems) {
|
||||
this.listItems = listItems;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package one.nem.lacerta.model;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
public class ListItem {
|
||||
|
||||
// Properties
|
||||
|
||||
String title;
|
||||
String description;
|
||||
ListItemType itemType;
|
||||
String itemId;
|
||||
|
||||
// Constructor
|
||||
|
||||
public ListItem(String title, String description, ListItemType itemType, String itemId) {
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.itemType = itemType;
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public ListItem() {
|
||||
// Empty constructor
|
||||
}
|
||||
|
||||
// Getter
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public ListItemType getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
|
||||
public String getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
// Setter
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setItemType(ListItemType itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
|
||||
public void setItemId(String itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package one.nem.lacerta.model;
|
||||
|
||||
public enum ListItemType {
|
||||
|
||||
ITEM_TYPE_FOLDER(one.nem.lacerta.shared.ui.R.drawable.folder_24px),
|
||||
ITEM_TYPE_DOCUMENT(one.nem.lacerta.shared.ui.R.drawable.description_24px);
|
||||
|
||||
private int iconId;
|
||||
|
||||
ListItemType(int iconId) {
|
||||
this.iconId = iconId;
|
||||
}
|
||||
|
||||
public int getIconId() {
|
||||
return iconId;
|
||||
}
|
||||
}
|
||||
@@ -70,35 +70,4 @@ public class XmlMetaModel {
|
||||
this.pages = pages;
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
|
||||
public void addPage(XmlMetaPageModel page) {
|
||||
this.pages.add(page);
|
||||
}
|
||||
|
||||
public void addPageAfterIndex(int index, XmlMetaPageModel page) {
|
||||
this.pages.add(index, page);
|
||||
|
||||
//Update index
|
||||
this.updateIndex();
|
||||
}
|
||||
|
||||
public void removePage(XmlMetaPageModel page) {
|
||||
this.pages.remove(page);
|
||||
}
|
||||
|
||||
public void removePageAtIndex(int index) {
|
||||
this.pages.remove(index);
|
||||
|
||||
//Update index
|
||||
this.updateIndex();
|
||||
}
|
||||
|
||||
// Internal Methods
|
||||
private void updateIndex() { // TODO-rca: 効率悪そう
|
||||
for (int i = 0; i < this.pages.size(); i++) {
|
||||
this.pages.get(i).setIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package one.nem.lacerta.model.document.internal;
|
||||
|
||||
public class XmlMetaPageModel {
|
||||
|
||||
int index;
|
||||
String filename;
|
||||
|
||||
// Constructor
|
||||
@@ -10,27 +9,18 @@ public class XmlMetaPageModel {
|
||||
public XmlMetaPageModel() {
|
||||
}
|
||||
|
||||
public XmlMetaPageModel(int index, String filename) {
|
||||
this.index = index;
|
||||
public XmlMetaPageModel(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
// Getter
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
// Setter
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
@@ -102,11 +102,10 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||
|
||||
XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel();
|
||||
xmlMetaPageModel.setFilename(filename);
|
||||
xmlMetaPageModel.setIndex(xmlMetaModel.getPages().size() + 1);
|
||||
xmlMetaModel.getPages().add(xmlMetaPageModel);
|
||||
|
||||
logger.info("addNewPageToLast", "finished");
|
||||
logger.info("addNewPageToLast", "filename: " + filename + ", index: " + xmlMetaPageModel.getIndex());
|
||||
logger.info("addNewPageToLast", "filename: " + filename);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,19 +117,6 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||
} // TODO-rca: 効率悪いので改善する
|
||||
}
|
||||
|
||||
// Internal
|
||||
// Indexを振り直す
|
||||
private ArrayList<XmlMetaPageModel> reIndexPages(ArrayList<XmlMetaPageModel> pages) {
|
||||
logger.debug("reIndexPages", "called"); // TODO-rca: 効率化
|
||||
ArrayList<XmlMetaPageModel> newPages = new ArrayList<>();
|
||||
for (int i = 0; i < pages.size(); i++) {
|
||||
XmlMetaPageModel xmlMetaPageModel = pages.get(i);
|
||||
xmlMetaPageModel.setIndex(i + 1);
|
||||
newPages.add(xmlMetaPageModel);
|
||||
}
|
||||
return newPages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNewPageAfterIndex(Bitmap bitmap, int index) throws Exception {
|
||||
logger.debug("addNewPageAfterIndex", "called");
|
||||
@@ -140,9 +126,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||
|
||||
XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel();
|
||||
xmlMetaPageModel.setFilename(filename);
|
||||
xmlMetaPageModel.setIndex(index + 1);
|
||||
xmlMetaModel.getPages().add(index, xmlMetaPageModel);
|
||||
xmlMetaModel.setPages(reIndexPages(xmlMetaModel.getPages()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,9 +138,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||
|
||||
XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel();
|
||||
xmlMetaPageModel.setFilename(filename);
|
||||
xmlMetaPageModel.setIndex(index);
|
||||
xmlMetaModel.getPages().add(index - 1, xmlMetaPageModel);
|
||||
xmlMetaModel.setPages(reIndexPages(xmlMetaModel.getPages()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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="@android:color/white"
|
||||
android:pathData="M330,710L630,710L630,650L330,650L330,710ZM330,550L630,550L630,490L330,490L330,550ZM252.31,860Q222,860 201,839Q180,818 180,787.69L180,172.31Q180,142 201,121Q222,100 252.31,100L570,100L780,310L780,787.69Q780,818 759,839Q738,860 707.69,860L252.31,860ZM540,340L540,160L252.31,160Q247.69,160 243.85,163.85Q240,167.69 240,172.31L240,787.69Q240,792.31 243.85,796.15Q247.69,800 252.31,800L707.69,800Q712.31,800 716.15,796.15Q720,792.31 720,787.69L720,340L540,340ZM240,160L240,160L240,340L240,340L240,160L240,340L240,340L240,787.69Q240,792.31 240,796.15Q240,800 240,800L240,800Q240,800 240,796.15Q240,792.31 240,787.69L240,172.31Q240,167.69 240,163.85Q240,160 240,160Z"/>
|
||||
</vector>
|
||||
@@ -41,7 +41,6 @@ public class XmlMetaParserImpl implements XmlMetaParser{
|
||||
for(int i = 0; i < rootElement.getElementsByTagName("pages").getLength(); i++) {
|
||||
Element pageElement = (Element) rootElement.getElementsByTagName("page").item(i);
|
||||
XmlMetaPageModel page = new XmlMetaPageModel();
|
||||
page.setIndex(Integer.parseInt(pageElement.getElementsByTagName("index").item(0).getTextContent()));
|
||||
page.setFilename(pageElement.getElementsByTagName("filename").item(0).getTextContent());
|
||||
pages.add(page);
|
||||
}
|
||||
@@ -73,7 +72,6 @@ public class XmlMetaParserImpl implements XmlMetaParser{
|
||||
Element pagesElement = document.createElement("pages");
|
||||
for(XmlMetaPageModel page : meta.getPages()) {
|
||||
Element pageElement = document.createElement("page");
|
||||
appendElement(document, pageElement, "index", String.valueOf(page.getIndex()));
|
||||
appendElement(document, pageElement, "filename", page.getFilename());
|
||||
pagesElement.appendChild(pageElement);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user