From 3c079ffc23a118ce843672cb60f998bb460047ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 18:04:49 +0900 Subject: [PATCH 01/30] =?UTF-8?q?SubtitleCollapsingToolbarLayout=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/fragment_component_viewer_top.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/component/viewer/src/main/res/layout/fragment_component_viewer_top.xml b/component/viewer/src/main/res/layout/fragment_component_viewer_top.xml index 6c8791de..9d83ea68 100644 --- a/component/viewer/src/main/res/layout/fragment_component_viewer_top.xml +++ b/component/viewer/src/main/res/layout/fragment_component_viewer_top.xml @@ -13,7 +13,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - + Date: Fri, 26 Jan 2024 18:16:00 +0900 Subject: [PATCH 02/30] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E3=83=91=E3=82=B9=E3=82=92=E3=82=B5=E3=83=96=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=88=E3=83=AB=E3=81=A8=E3=81=97=E3=81=A6=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerListFragment.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 7a35379a..51e94931 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -22,6 +22,8 @@ import dagger.hilt.android.AndroidEntryPoint; import one.nem.lacerta.component.common.LacertaSelectDirDialog; import one.nem.lacerta.component.common.LacertaSelectDirDialogListener; import one.nem.lacerta.data.Document; +import one.nem.lacerta.data.LacertaLibrary; +import one.nem.lacerta.model.ListItemType; import one.nem.lacerta.model.document.page.Page; import one.nem.lacerta.utils.FeatureSwitch; import one.nem.lacerta.utils.LacertaLogger; @@ -39,6 +41,9 @@ public class ViewerListFragment extends Fragment { @Inject Document document; + @Inject + LacertaLibrary lacertaLibrary; + @Inject LacertaLogger logger; @@ -92,7 +97,7 @@ public class ViewerListFragment extends Fragment { // Toolbar Toolbar toolbar = view.findViewById(R.id.toolbar); - toolbarSetup(toolbar, true, this.documentName == null ? "Document" : this.documentName); + toolbarSetup(toolbar, true, this.documentName == null ? "Document" : this.documentName, null); RecyclerView recyclerView = view.findViewById(R.id.body_recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); @@ -112,6 +117,8 @@ public class ViewerListFragment extends Fragment { viewerBodyAdapter.notifyItemRangeChanged(0, pages.size()); if (FeatureSwitch.Viewer.showProgressBarWhenLoading) view.findViewById(R.id.loading_progress_bar).setVisibility(View.GONE); }); + }).thenCompose(aVoid -> lacertaLibrary.getPublicPath(documentId, ListItemType.ITEM_TYPE_DOCUMENT)).thenAccept(publicPath -> { + updateToolbarSubtitle(toolbar, "/" + publicPath.parent().getStringPath()); }); } else { logger.debug(TAG, "revisionId: " + revisionId); @@ -127,12 +134,24 @@ public class ViewerListFragment extends Fragment { if (FeatureSwitch.Viewer.showProgressBarWhenLoading) view.findViewById(R.id.loading_progress_bar).setVisibility(View.GONE); }); }); + }).thenCompose(aVoid -> lacertaLibrary.getPublicPath(documentId, ListItemType.ITEM_TYPE_DOCUMENT)).thenAccept(publicPath -> { + updateToolbarSubtitle(toolbar, "/" + publicPath.parent().getStringPath()); // TODO-rca: リビジョンの場合はリビジョン名を表示する? }); } return view; } + /** + * Toolbarのサブタイトルを更新 + * @param subtitle サブタイトル + */ + private void updateToolbarSubtitle(Toolbar toolbar, String subtitle) { + getActivity().runOnUiThread(() -> { + toolbar.setSubtitle(subtitle); + }); + } + /** * ToolbarをInitする * @@ -140,7 +159,7 @@ public class ViewerListFragment extends Fragment { * @param showBackButton 戻るボタンを表示するか * @param title タイトル */ - private void toolbarSetup(Toolbar toolbar, boolean showBackButton, String title) { + private void toolbarSetup(Toolbar toolbar, boolean showBackButton, String title, String Subtitle) { getActivity().runOnUiThread(() -> { if (showBackButton) { toolbar.setNavigationIcon(one.nem.lacerta.shared.ui.R.drawable.arrow_back_24px); @@ -152,6 +171,7 @@ public class ViewerListFragment extends Fragment { toolbar.setNavigationIcon(null); } toolbar.setTitle(title); + if (Subtitle != null) toolbar.setSubtitle(Subtitle); toolbar.inflateMenu(R.menu.viewer_menu); toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.action_open_vcs_rev_list) { From c2f62a5a849ae8f2cc02c026f5fdba12bc806894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 18:16:24 +0900 Subject: [PATCH 03/30] =?UTF-8?q?=E4=BE=9D=E5=AD=98=E9=96=A2=E4=BF=82?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/library/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/library/build.gradle b/feature/library/build.gradle index 6b102535..6a661620 100644 --- a/feature/library/build.gradle +++ b/feature/library/build.gradle @@ -55,5 +55,6 @@ dependencies { implementation project(':component:viewer') - + // TODO-rca: バージョンカタログに切り出す + implementation "com.hendraanggrian.material:collapsingtoolbarlayout-subtitle:1.5.0" } \ No newline at end of file From e96d213c33e44b173eff4db1cdd63d088a13a32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 18:33:02 +0900 Subject: [PATCH 04/30] =?UTF-8?q?=E3=83=91=E3=82=B9=E3=82=92=E3=82=B5?= =?UTF-8?q?=E3=83=96=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=81=AB=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/library/LibraryPageFragment.java | 27 ++++++++++++++++--- .../main/res/layout/fragment_library_top.xml | 4 +-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java index df1ad96b..0bf1c21a 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java @@ -23,6 +23,7 @@ import dagger.hilt.android.AndroidEntryPoint; import one.nem.lacerta.component.viewer.ViewerMainActivity; import one.nem.lacerta.data.LacertaLibrary; import one.nem.lacerta.model.LibraryItemPage; +import one.nem.lacerta.model.ListItemType; import one.nem.lacerta.utils.FeatureSwitch; import one.nem.lacerta.utils.LacertaLogger; @@ -43,6 +44,7 @@ public class LibraryPageFragment extends Fragment { String folderId; String title; String parentId; + Toolbar toolbar; @Inject @@ -128,12 +130,19 @@ public class LibraryPageFragment extends Fragment { logger.debug("LibraryTopFragment", "getArguments() is null(maybe root)"); this.libraryItemPage = new LibraryItemPage(); } + this.toolbar = view.findViewById(R.id.library_toolbar); // Toolbar Setup - toolbarSetup(view.findViewById(R.id.library_toolbar), this.folderId != null, this.title != null ? this.title : "ライブラリ"); + toolbarSetup(this.toolbar, this.folderId != null, this.title != null ? this.title : "ライブラリ"); + if(this.folderId == null) { + updateToolbarSubtitle(this.toolbar, null); //負荷軽減のため+邪魔なので(folderIdがnullの場合は、ルートフォルダを表示しているので) + } else { + lacertaLibrary.getPublicPath(this.folderId, ListItemType.ITEM_TYPE_FOLDER).thenAccept(publicPath -> { + updateToolbarSubtitle(this.toolbar, "/" + publicPath.parent().getStringPath()); + }); + } // RecyclerView Setup - RecyclerView recyclerView = view.findViewById(R.id.library_item_recycler_view); this.listItemAdapter = new ListItemAdapter(new DocumentSelectListener() { @Override @@ -168,6 +177,7 @@ public class LibraryPageFragment extends Fragment { recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); // Get library page and update RecyclerView items + lacertaLibrary.getLibraryPage(this.folderId, 10).thenAccept(libraryItemPage -> { this.libraryItemPage = libraryItemPage; @@ -216,6 +226,7 @@ public class LibraryPageFragment extends Fragment { lacertaLibrary.createFolder(pageId, input.getText().toString()).thenAccept(folderId -> { // Refresh updateItem(pageId); + }); }); builder.setNegativeButton("キャンセル", (dialog, which) -> { @@ -226,7 +237,7 @@ public class LibraryPageFragment extends Fragment { } /** - * RecyclerViewのアイテムを更新する + * RecyclerViewのアイテムとUIを更新する */ private void updateItem(String pageId) { lacertaLibrary.getLibraryPage(pageId, 10).thenAccept(libraryItemPage -> { @@ -242,6 +253,16 @@ public class LibraryPageFragment extends Fragment { }); } + /** + * Toolbarのサブタイトルを更新 + * @param subtitle サブタイトル + */ + private void updateToolbarSubtitle(Toolbar toolbar, String subtitle) { + getActivity().runOnUiThread(() -> { + toolbar.setSubtitle(subtitle); + }); + } + /** * ToolbarをInitする * diff --git a/feature/library/src/main/res/layout/fragment_library_top.xml b/feature/library/src/main/res/layout/fragment_library_top.xml index f9d53d56..29f1bcbf 100644 --- a/feature/library/src/main/res/layout/fragment_library_top.xml +++ b/feature/library/src/main/res/layout/fragment_library_top.xml @@ -13,7 +13,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - + From 9d750b52443c805b77c794a11d0ccac495747246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 18:33:44 +0900 Subject: [PATCH 05/30] =?UTF-8?q?=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/library/LibraryPageFragment.java | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java index 0bf1c21a..5e0e5b2f 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java @@ -178,33 +178,7 @@ public class LibraryPageFragment extends Fragment { // Get library page and update RecyclerView items - lacertaLibrary.getLibraryPage(this.folderId, 10).thenAccept(libraryItemPage -> { - this.libraryItemPage = libraryItemPage; - - if (this.parentId == null) { - this.parentId = libraryItemPage.getParentId(); - } - if (this.title == null) { - this.title = libraryItemPage.getPageTitle(); - // Toolbar init again - toolbarSetup(view.findViewById(R.id.library_toolbar), this.folderId != null, this.title != null ? this.title : "ライブラリ"); - } - - logger.debug("LibraryTopFragment", "Item selected! Total item page: " + this.libraryItemPage.getListItems().size()); - if (!FeatureSwitch.RecyclerView.useSimpleNotifyMethod) { - getActivity().runOnUiThread(() -> { // TODO-rca: 実行条件を考える? - listItemAdapter.notifyItemRangeRemoved(0, this.libraryItemPage.getListItems().size() - 1); - }); - } - listItemAdapter.setLibraryItemPage(this.libraryItemPage); - getActivity().runOnUiThread(() -> { - if (FeatureSwitch.RecyclerView.useSimpleNotifyMethod) { - listItemAdapter.notifyDataSetChanged(); - } else { - listItemAdapter.notifyItemRangeInserted(0, this.libraryItemPage.getListItems().size() - 1); - } - }); - }); + updateItem(this.folderId); } /** From 58e74dbb1628bc3ed5c2694ac7e81439b072d2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 18:38:02 +0900 Subject: [PATCH 06/30] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=82=A2=E3=83=8B?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92500ms?= =?UTF-8?q?=E4=BB=A5=E4=B8=8A=E3=81=8B=E3=81=8B=E3=81=A3=E3=81=9F=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AE=E3=81=BF=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/library/LibraryPageFragment.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java index 5e0e5b2f..2214882c 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java @@ -214,16 +214,22 @@ public class LibraryPageFragment extends Fragment { * RecyclerViewのアイテムとUIを更新する */ private void updateItem(String pageId) { + long startTime = System.currentTimeMillis(); lacertaLibrary.getLibraryPage(pageId, 10).thenAccept(libraryItemPage -> { + long endTime = System.currentTimeMillis(); this.libraryItemPage = libraryItemPage; logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); - getActivity().runOnUiThread(() -> { - listItemAdapter.notifyItemRangeRemoved(0, libraryItemPage.getListItems().size() - 1); - }); - listItemAdapter.setLibraryItemPage(libraryItemPage); - getActivity().runOnUiThread(() -> { - listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1); - }); + if (endTime - startTime > 500) { // 500ms以上かかった場合は表示アニメーションをする + getActivity().runOnUiThread(() -> { + listItemAdapter.setLibraryItemPage(libraryItemPage); + listItemAdapter.notifyItemRangeInserted(0, this.libraryItemPage.getListItems().size()); + }); + } else { + listItemAdapter.setLibraryItemPage(libraryItemPage); + getActivity().runOnUiThread(() -> { + listItemAdapter.notifyDataSetChanged(); + }); + } }); } From 8a2b4ed12df20bbdbf828260070f00d81ed79feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 18:41:05 +0900 Subject: [PATCH 07/30] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=82=A2=E3=83=8B?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92500ms?= =?UTF-8?q?=E4=BB=A5=E4=B8=8A=E3=81=8B=E3=81=8B=E3=81=A3=E3=81=9F=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AE=E3=81=BF=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/feature/home/HomeTopFragment.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java index e27bcfbd..3f010479 100644 --- a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java @@ -106,20 +106,22 @@ public class HomeTopFragment extends Fragment { } private void updateList() { + long startTime = System.currentTimeMillis(); lacertaLibrary.getRecentDocument(10).thenAccept(listItems -> { + long endTime = System.currentTimeMillis(); if (listItems == null) { return; } this.listItemAdapter.setListItems(listItems); - getActivity().runOnUiThread(() -> { - Log.d("HomeTopFragment", "onViewCreated: " + listItems.size()); - if (FeatureSwitch.RecyclerView.useSimpleNotifyMethod) { + if (endTime - startTime > 500) { // 500ms以上かかった場合は表示アニメーションをする + getActivity().runOnUiThread(() -> { + this.listItemAdapter.notifyItemRangeInserted(0, listItems.size()); + }); + } else { + getActivity().runOnUiThread(() -> { this.listItemAdapter.notifyDataSetChanged(); - } else { - // IndexOutOfBoundsExceptionを吐くことがあったので いったん - this.listItemAdapter.notifyItemRangeInserted(0, listItems.size() - 1); - } - }); + }); + } }); } From 834ee423536f4b3fec38b15d582426f94a766b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 18:41:09 +0900 Subject: [PATCH 08/30] =?UTF-8?q?=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF?= =?UTF-8?q?=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/feature/library/LibraryPageFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java index 2214882c..e23d2089 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java @@ -219,13 +219,12 @@ public class LibraryPageFragment extends Fragment { long endTime = System.currentTimeMillis(); this.libraryItemPage = libraryItemPage; logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); + listItemAdapter.setLibraryItemPage(libraryItemPage); if (endTime - startTime > 500) { // 500ms以上かかった場合は表示アニメーションをする getActivity().runOnUiThread(() -> { - listItemAdapter.setLibraryItemPage(libraryItemPage); listItemAdapter.notifyItemRangeInserted(0, this.libraryItemPage.getListItems().size()); }); } else { - listItemAdapter.setLibraryItemPage(libraryItemPage); getActivity().runOnUiThread(() -> { listItemAdapter.notifyDataSetChanged(); }); From 4df56774c311a4ac856b17da8040a7e95b7bf719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 19:38:14 +0900 Subject: [PATCH 09/30] =?UTF-8?q?=E3=82=BB=E3=83=AC=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=81=AE=E9=AB=98?= =?UTF-8?q?=E3=81=95=E3=82=92=E7=94=BB=E9=9D=A2=E3=81=AE40%=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/component/common/LacertaSelectDirDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java index 7d3d4b81..6ac7e938 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectDirDialog.java @@ -79,8 +79,8 @@ public class LacertaSelectDirDialog extends DialogFragment { LayoutInflater inflater = requireActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.lacerta_dialog_select_dir, null); - // 高さを画面の60%にする - int height = (int) (getResources().getDisplayMetrics().heightPixels * 0.6); + // 高さを画面の40%にする + int height = (int) (getResources().getDisplayMetrics().heightPixels * 0.4); view.setMinimumHeight(height); this.recyclerView = view.findViewById(R.id.select_dir_recycler_view); From 8df63b0ac689e233724c6eaec9f7a7c63bf28005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 19:39:43 +0900 Subject: [PATCH 10/30] =?UTF-8?q?=E3=82=A2=E3=83=8B=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/anim/nav_dynamic_enter_anim.xml | 25 +++++++++++++++++++ .../main/res/anim/nav_dynamic_exit_anim.xml | 24 ++++++++++++++++++ .../res/anim/nav_dynamic_pop_enter_anim.xml | 24 ++++++++++++++++++ .../res/anim/nav_dynamic_pop_exit_anim.xml | 25 +++++++++++++++++++ .../src/main/res/anim/nav_ios_enter_anim.xml | 8 ++++++ .../src/main/res/anim/nav_ios_exit_anim.xml | 15 +++++++++++ .../main/res/anim/nav_ios_pop_enter_anim.xml | 14 +++++++++++ .../main/res/anim/nav_ios_pop_exit_anim.xml | 8 ++++++ .../main/res/anim/nav_rotate_enter_anim.xml | 14 +++++++++++ .../main/res/anim/nav_rotate_exit_anim.xml | 14 +++++++++++ .../res/anim/nav_rotate_pop_enter_anim.xml | 14 +++++++++++ .../res/anim/nav_rotate_pop_exit_anim.xml | 14 +++++++++++ .../main/res/anim/nav_slide_enter_anim.xml | 12 +++++++++ .../src/main/res/anim/nav_slide_exit_anim.xml | 12 +++++++++ .../res/anim/nav_slide_pop_enter_anim.xml | 12 +++++++++ .../main/res/anim/nav_slide_pop_exit_anim.xml | 12 +++++++++ .../main/res/anim/nav_twitter_enter_anim.xml | 8 ++++++ .../main/res/anim/nav_twitter_exit_anim.xml | 18 +++++++++++++ .../res/anim/nav_twitter_pop_enter_anim.xml | 18 +++++++++++++ .../res/anim/nav_twitter_pop_exit_anim.xml | 8 ++++++ .../src/main/res/anim/nav_up_enter_anim.xml | 8 ++++++ .../ui/src/main/res/anim/nav_up_exit_anim.xml | 7 ++++++ .../main/res/anim/nav_up_pop_enter_anim.xml | 7 ++++++ .../main/res/anim/nav_up_pop_exit_anim.xml | 8 ++++++ .../src/main/res/anim/nav_zoom_enter_anim.xml | 16 ++++++++++++ .../src/main/res/anim/nav_zoom_exit_anim.xml | 12 +++++++++ .../main/res/anim/nav_zoom_pop_enter_anim.xml | 12 +++++++++ .../main/res/anim/nav_zoom_pop_exit_anim.xml | 16 ++++++++++++ 28 files changed, 385 insertions(+) create mode 100644 shared/ui/src/main/res/anim/nav_dynamic_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_dynamic_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_dynamic_pop_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_dynamic_pop_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_ios_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_ios_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_ios_pop_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_ios_pop_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_rotate_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_rotate_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_rotate_pop_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_rotate_pop_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_slide_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_slide_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_slide_pop_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_slide_pop_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_twitter_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_twitter_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_twitter_pop_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_twitter_pop_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_up_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_up_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_up_pop_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_up_pop_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_zoom_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_zoom_exit_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_zoom_pop_enter_anim.xml create mode 100644 shared/ui/src/main/res/anim/nav_zoom_pop_exit_anim.xml diff --git a/shared/ui/src/main/res/anim/nav_dynamic_enter_anim.xml b/shared/ui/src/main/res/anim/nav_dynamic_enter_anim.xml new file mode 100644 index 00000000..e74131cc --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_dynamic_enter_anim.xml @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_dynamic_exit_anim.xml b/shared/ui/src/main/res/anim/nav_dynamic_exit_anim.xml new file mode 100644 index 00000000..507b9e99 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_dynamic_exit_anim.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_dynamic_pop_enter_anim.xml b/shared/ui/src/main/res/anim/nav_dynamic_pop_enter_anim.xml new file mode 100644 index 00000000..ad403d7f --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_dynamic_pop_enter_anim.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_dynamic_pop_exit_anim.xml b/shared/ui/src/main/res/anim/nav_dynamic_pop_exit_anim.xml new file mode 100644 index 00000000..a056da6c --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_dynamic_pop_exit_anim.xml @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_ios_enter_anim.xml b/shared/ui/src/main/res/anim/nav_ios_enter_anim.xml new file mode 100644 index 00000000..d306bde5 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_ios_enter_anim.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_ios_exit_anim.xml b/shared/ui/src/main/res/anim/nav_ios_exit_anim.xml new file mode 100644 index 00000000..04bca2eb --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_ios_exit_anim.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_ios_pop_enter_anim.xml b/shared/ui/src/main/res/anim/nav_ios_pop_enter_anim.xml new file mode 100644 index 00000000..ae8e57d7 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_ios_pop_enter_anim.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_ios_pop_exit_anim.xml b/shared/ui/src/main/res/anim/nav_ios_pop_exit_anim.xml new file mode 100644 index 00000000..4459fd2d --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_ios_pop_exit_anim.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_rotate_enter_anim.xml b/shared/ui/src/main/res/anim/nav_rotate_enter_anim.xml new file mode 100644 index 00000000..b036d2b1 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_rotate_enter_anim.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_rotate_exit_anim.xml b/shared/ui/src/main/res/anim/nav_rotate_exit_anim.xml new file mode 100644 index 00000000..6e888fb2 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_rotate_exit_anim.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_rotate_pop_enter_anim.xml b/shared/ui/src/main/res/anim/nav_rotate_pop_enter_anim.xml new file mode 100644 index 00000000..0bd0db3b --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_rotate_pop_enter_anim.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_rotate_pop_exit_anim.xml b/shared/ui/src/main/res/anim/nav_rotate_pop_exit_anim.xml new file mode 100644 index 00000000..15d761c6 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_rotate_pop_exit_anim.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_slide_enter_anim.xml b/shared/ui/src/main/res/anim/nav_slide_enter_anim.xml new file mode 100644 index 00000000..dedef17b --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_slide_enter_anim.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_slide_exit_anim.xml b/shared/ui/src/main/res/anim/nav_slide_exit_anim.xml new file mode 100644 index 00000000..83d47c79 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_slide_exit_anim.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_slide_pop_enter_anim.xml b/shared/ui/src/main/res/anim/nav_slide_pop_enter_anim.xml new file mode 100644 index 00000000..4e3d476c --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_slide_pop_enter_anim.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_slide_pop_exit_anim.xml b/shared/ui/src/main/res/anim/nav_slide_pop_exit_anim.xml new file mode 100644 index 00000000..4013e294 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_slide_pop_exit_anim.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_twitter_enter_anim.xml b/shared/ui/src/main/res/anim/nav_twitter_enter_anim.xml new file mode 100644 index 00000000..d306bde5 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_twitter_enter_anim.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_twitter_exit_anim.xml b/shared/ui/src/main/res/anim/nav_twitter_exit_anim.xml new file mode 100644 index 00000000..0ca28555 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_twitter_exit_anim.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_twitter_pop_enter_anim.xml b/shared/ui/src/main/res/anim/nav_twitter_pop_enter_anim.xml new file mode 100644 index 00000000..af2f005a --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_twitter_pop_enter_anim.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_twitter_pop_exit_anim.xml b/shared/ui/src/main/res/anim/nav_twitter_pop_exit_anim.xml new file mode 100644 index 00000000..4459fd2d --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_twitter_pop_exit_anim.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_up_enter_anim.xml b/shared/ui/src/main/res/anim/nav_up_enter_anim.xml new file mode 100644 index 00000000..0f7ec42b --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_up_enter_anim.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_up_exit_anim.xml b/shared/ui/src/main/res/anim/nav_up_exit_anim.xml new file mode 100644 index 00000000..b851c737 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_up_exit_anim.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_up_pop_enter_anim.xml b/shared/ui/src/main/res/anim/nav_up_pop_enter_anim.xml new file mode 100644 index 00000000..b851c737 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_up_pop_enter_anim.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_up_pop_exit_anim.xml b/shared/ui/src/main/res/anim/nav_up_pop_exit_anim.xml new file mode 100644 index 00000000..0c962854 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_up_pop_exit_anim.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_zoom_enter_anim.xml b/shared/ui/src/main/res/anim/nav_zoom_enter_anim.xml new file mode 100644 index 00000000..7f038753 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_zoom_enter_anim.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_zoom_exit_anim.xml b/shared/ui/src/main/res/anim/nav_zoom_exit_anim.xml new file mode 100644 index 00000000..88ddc418 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_zoom_exit_anim.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_zoom_pop_enter_anim.xml b/shared/ui/src/main/res/anim/nav_zoom_pop_enter_anim.xml new file mode 100644 index 00000000..66c8593a --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_zoom_pop_enter_anim.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/anim/nav_zoom_pop_exit_anim.xml b/shared/ui/src/main/res/anim/nav_zoom_pop_exit_anim.xml new file mode 100644 index 00000000..ba3d2b03 --- /dev/null +++ b/shared/ui/src/main/res/anim/nav_zoom_pop_exit_anim.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file From 6679f8389ce29a064a9c446478879ecb9ac022c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 26 Jan 2024 20:17:47 +0900 Subject: [PATCH 11/30] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=AA=E7=94=BB=E9=9D=A2=E3=81=AE=E3=82=A2=E3=83=8B=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E6=98=8E=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/navigation/feature_library_navigation.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/library/src/main/res/navigation/feature_library_navigation.xml b/feature/library/src/main/res/navigation/feature_library_navigation.xml index 3a5dcd14..a914d07c 100644 --- a/feature/library/src/main/res/navigation/feature_library_navigation.xml +++ b/feature/library/src/main/res/navigation/feature_library_navigation.xml @@ -12,10 +12,10 @@ From 5096e8de234d8a5fcbaeafab1002c084517d616c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Sat, 27 Jan 2024 14:36:06 +0900 Subject: [PATCH 12/30] iroiro --- .../java/one/nem/lacerta/MainActivity.java | 18 +++++++++++++++++- .../component/viewer/ViewerMainActivity.java | 5 +++++ .../lacerta/feature/home/HomeTopFragment.java | 3 ++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index d7fac694..fc95070b 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -8,9 +8,11 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.navigation.NavController; +import androidx.navigation.NavOptions; import androidx.navigation.fragment.NavHostFragment; import androidx.navigation.ui.NavigationUI; +import android.app.ActivityOptions; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Color; @@ -60,6 +62,19 @@ public class MainActivity extends AppCompatActivity implements FragmentNavigatio assert navHostFragment != null; NavController navController = navHostFragment.getNavController(); NavigationUI.setupWithNavController(bottomNavigationView, navController); + + bottomNavigationView.setOnItemSelectedListener(item -> { + NavOptions navOptions = new NavOptions.Builder() + .setLaunchSingleTop(true) + .setEnterAnim(androidx.navigation.ui.R.anim.nav_default_enter_anim) + .setExitAnim(androidx.navigation.ui.R.anim.nav_default_exit_anim) + .setPopEnterAnim(androidx.navigation.ui.R.anim.nav_default_pop_enter_anim) + .setPopExitAnim(androidx.navigation.ui.R.anim.nav_default_pop_exit_anim) + .build(); + + navController.navigate(item.getItemId(), null, navOptions); + return true; + }); } catch (Exception e) { Log.e("Init", "Failed to init navigation"); @@ -83,7 +98,8 @@ public class MainActivity extends AppCompatActivity implements FragmentNavigatio findViewById(R.id.scanFab).setOnClickListener(v -> { Toast.makeText(this, "Scan", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(this.getApplicationContext(), ScannerManagerActivity.class); - startActivity(intent); +// startActivity(intent); + startActivity(intent, ActivityOptions.makeCustomAnimation(this, 0, 0).toBundle()); }); } diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerMainActivity.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerMainActivity.java index 6c079c11..0b9a3e59 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerMainActivity.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerMainActivity.java @@ -5,6 +5,7 @@ import android.os.Bundle; import android.widget.Toast; import androidx.activity.EdgeToEdge; +import androidx.activity.OnBackPressedCallback; import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; @@ -41,6 +42,9 @@ public class ViewerMainActivity extends AppCompatActivity { return insets; }); +// // Transition +// overridePendingTransition(one.nem.lacerta.shared.ui.R.anim.nav_up_enter_anim, one.nem.lacerta.shared.ui.R.anim.nav_up_exit_anim); + Intent intent = getIntent(); try { documentId = intent.getStringExtra("documentId"); @@ -58,4 +62,5 @@ public class ViewerMainActivity extends AppCompatActivity { .replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(documentId, documentName)) .commit(); } + } \ No newline at end of file diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java index 3f010479..8d757662 100644 --- a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java @@ -1,5 +1,6 @@ package one.nem.lacerta.feature.home; +import android.app.ActivityOptions; import android.content.Intent; import android.os.Bundle; import android.util.Log; @@ -89,7 +90,7 @@ public class HomeTopFragment extends Fragment { Log.d("HomeTopFragment", "onDocumentSelect: " + documentId + " " + documentName); intent.putExtra("documentId", documentId); intent.putExtra("documentName", documentName); - startActivity(intent); + startActivity(intent, ActivityOptions.makeCustomAnimation(getContext(), 0, 0).toBundle()); } }); recyclerView.setAdapter(listItemAdapter); From 733371ecbc73dc47a44851854d5955f0cbc56e6d Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 14:50:41 +0900 Subject: [PATCH 13/30] =?UTF-8?q?=E6=A4=9C=E8=A8=BC=E7=94=A8=E3=81=AB?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=97=E3=81=9F=E3=82=A2=E3=83=8B=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E3=82=82=E3=81=A8?= =?UTF-8?q?=E3=81=AB=E6=88=BB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/feature/home/HomeTopFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java index 8d757662..4ac6a93d 100644 --- a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java @@ -90,7 +90,7 @@ public class HomeTopFragment extends Fragment { Log.d("HomeTopFragment", "onDocumentSelect: " + documentId + " " + documentName); intent.putExtra("documentId", documentId); intent.putExtra("documentName", documentName); - startActivity(intent, ActivityOptions.makeCustomAnimation(getContext(), 0, 0).toBundle()); + startActivity(intent, ActivityOptions.makeCustomAnimation(getContext(), one.nem.lacerta.shared.ui.R.anim.nav_up_enter_anim, one.nem.lacerta.shared.ui.R.anim.nav_up_exit_anim).toBundle()); } }); recyclerView.setAdapter(listItemAdapter); From 75045c3fe3000906d2f7ae240db9abe807b5a7ec Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 15:00:38 +0900 Subject: [PATCH 14/30] =?UTF-8?q?=E6=A4=9C=E8=A8=BC=E7=94=A8=E3=81=AB?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=97=E3=81=9F=E3=82=A2=E3=83=8B=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E3=82=82=E3=81=A8?= =?UTF-8?q?=E3=81=AB=E6=88=BB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/one/nem/lacerta/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index fc95070b..885ef7ed 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -99,7 +99,7 @@ public class MainActivity extends AppCompatActivity implements FragmentNavigatio Toast.makeText(this, "Scan", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(this.getApplicationContext(), ScannerManagerActivity.class); // startActivity(intent); - startActivity(intent, ActivityOptions.makeCustomAnimation(this, 0, 0).toBundle()); + startActivity(intent, ActivityOptions.makeCustomAnimation(this, one.nem.lacerta.shared.ui.R.anim.nav_up_enter_anim, one.nem.lacerta.shared.ui.R.anim.nav_up_exit_anim).toBundle()); }); } From a34109441f50f07dddc09958452c151a3c140da2 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 15:04:09 +0900 Subject: [PATCH 15/30] =?UTF-8?q?Rev=E9=81=B8=E6=8A=9E=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=AE=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=83=AC?= =?UTF-8?q?=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/lacerta_dialog_select_rev.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 component/common/src/main/res/layout/lacerta_dialog_select_rev.xml diff --git a/component/common/src/main/res/layout/lacerta_dialog_select_rev.xml b/component/common/src/main/res/layout/lacerta_dialog_select_rev.xml new file mode 100644 index 00000000..59ea619b --- /dev/null +++ b/component/common/src/main/res/layout/lacerta_dialog_select_rev.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file From 7291ab243ee82f636bc4516795255bffdcbacb5b Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 15:08:32 +0900 Subject: [PATCH 16/30] =?UTF-8?q?=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=82=B9=E3=83=8A=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/common/LacertaSelectRevDialogListener.java | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java new file mode 100644 index 00000000..5d4bce26 --- /dev/null +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java @@ -0,0 +1,7 @@ +package one.nem.lacerta.component.common; + +public interface LacertaSelectRevDialogListener { + + void onPositiveButtonClick(String rev); + void onNegativeButtonClick(); +} From c48e5becac0ce0c4318d974821169480ff90b0e7 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 15:16:58 +0900 Subject: [PATCH 17/30] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E3=82=B3=E3=83=94=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/common_rev_list_item.xml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 component/common/src/main/res/layout/common_rev_list_item.xml diff --git a/component/common/src/main/res/layout/common_rev_list_item.xml b/component/common/src/main/res/layout/common_rev_list_item.xml new file mode 100644 index 00000000..bd938d79 --- /dev/null +++ b/component/common/src/main/res/layout/common_rev_list_item.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file From ffeb701b40c2d468fbea443f516f0f9f9c76a297 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 15:26:18 +0900 Subject: [PATCH 18/30] =?UTF-8?q?RevDialogAdapter=E5=AE=9F=E8=A3=85WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/SelectRevDialogItemAdapter.java | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java b/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java new file mode 100644 index 00000000..217bd929 --- /dev/null +++ b/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java @@ -0,0 +1,64 @@ +package one.nem.lacerta.component.common; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; + +import one.nem.lacerta.model.VcsRevModel; + +public class SelectRevDialogItemAdapter extends RecyclerView.Adapter{ + + ArrayList revList; + + LacertaSelectRevDialogListener listener; + + public SelectRevDialogItemAdapter(LacertaSelectRevDialogListener listener) { + this.listener = listener; + } + + public void setRevList(ArrayList revList) { + this.revList = revList; + } + + @NonNull + @Override + public SelectRevDialogItemAdapter.SelectRevDialogItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.common_rev_list_item, parent, false); + return new SelectRevDialogItemAdapter.SelectRevDialogItemViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull SelectRevDialogItemAdapter.SelectRevDialogItemViewHolder holder, int position) { + VcsRevModel rev = revList.get(position); + holder.title.setText(rev.getCommitMessage()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + holder.description.setText(simpleDateFormat.format(rev.getCreatedAt())); + holder.revId.setText("RevID: " + rev.getId()); + } + + @Override + public int getItemCount() { + return this.revList == null ? 0 : this.revList.size(); + } + + public class SelectRevDialogItemViewHolder extends RecyclerView.ViewHolder { + + TextView title; + TextView description; + TextView revId; + + public SelectRevDialogItemViewHolder(@NonNull View itemView) { + super(itemView); + title = itemView.findViewById(R.id.rev_item_title); + description = itemView.findViewById(R.id.rev_item_detail); + revId = itemView.findViewById(R.id.rev_item_id); + } + } +} From 3cfd54faf04491478b2ebdf84557d51e182c6f8b Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:01:03 +0900 Subject: [PATCH 19/30] =?UTF-8?q?RevDialog=E5=AE=9F=E8=A3=85WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/LacertaSelectRevDialog.java | 78 +++++++++++++++++++ ...acertaSelectRevDialogInternalListener.java | 6 ++ .../LacertaSelectRevDialogListener.java | 5 +- .../common/SelectRevDialogItemAdapter.java | 4 +- .../component/viewer/ViewerListFragment.java | 10 ++- 5 files changed, 96 insertions(+), 7 deletions(-) create mode 100644 component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java create mode 100644 component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogInternalListener.java diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java new file mode 100644 index 00000000..2989e9b5 --- /dev/null +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java @@ -0,0 +1,78 @@ +package one.nem.lacerta.component.common; + +import android.app.Dialog; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Toast; + +import androidx.fragment.app.DialogFragment; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + +public class LacertaSelectRevDialog extends DialogFragment { + + String title; + String message; + String negativeButtonText; + + LacertaSelectRevDialogListener listener; + + public LacertaSelectRevDialog setTitle(String title) { + this.title = title; + return this; + } + + public LacertaSelectRevDialog setMessage(String message) { + this.message = message; + return this; + } + + public LacertaSelectRevDialog setNegativeButtonText(String negativeButtonText) { + this.negativeButtonText = negativeButtonText; + return this; + } + + public LacertaSelectRevDialog setListener(LacertaSelectRevDialogListener listener) { + this.listener = listener; + return this; + } + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + super.onCreateDialog(savedInstanceState); + + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); + LayoutInflater inflater = requireActivity().getLayoutInflater(); + View view = inflater.inflate(R.layout.lacerta_dialog_select_rev, null); + + int height = (int) (getResources().getDisplayMetrics().heightPixels * 0.4); + view.setMinimumHeight(height); + + RecyclerView recyclerView = view.findViewById(R.id.select_rev_recycler_view); + + SelectRevDialogItemAdapter adapter = new SelectRevDialogItemAdapter(revId -> { + if (listener != null) { + listener.onItemSelected(revId); + } + dismiss(); + }); + + recyclerView.setAdapter(adapter); + recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + + builder.setView(view); + builder.setTitle(title == null ? "Select Rev" : title); + builder.setMessage(message == null ? "Select Rev" : message); + builder.setNegativeButton(negativeButtonText, (dialog, which) -> { + if (listener != null) { + listener.onDialogCanceled(); + dismiss(); + } + }); + + return builder.create(); + } +} diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogInternalListener.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogInternalListener.java new file mode 100644 index 00000000..7988bd22 --- /dev/null +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogInternalListener.java @@ -0,0 +1,6 @@ +package one.nem.lacerta.component.common; + +public interface LacertaSelectRevDialogInternalListener { + + void onItemSelected(String revId); +} diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java index 5d4bce26..3a7f808d 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialogListener.java @@ -2,6 +2,7 @@ package one.nem.lacerta.component.common; public interface LacertaSelectRevDialogListener { - void onPositiveButtonClick(String rev); - void onNegativeButtonClick(); + void onItemSelected(String revId); + + void onDialogCanceled(); } diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java b/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java index 217bd929..47991374 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java @@ -17,9 +17,9 @@ public class SelectRevDialogItemAdapter extends RecyclerView.Adapter revList; - LacertaSelectRevDialogListener listener; + LacertaSelectRevDialogInternalListener listener; - public SelectRevDialogItemAdapter(LacertaSelectRevDialogListener listener) { + public SelectRevDialogItemAdapter(LacertaSelectRevDialogInternalListener listener) { this.listener = listener; } diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 51e94931..269e9193 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -21,6 +21,7 @@ import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; import one.nem.lacerta.component.common.LacertaSelectDirDialog; import one.nem.lacerta.component.common.LacertaSelectDirDialogListener; +import one.nem.lacerta.component.common.LacertaSelectRevDialog; import one.nem.lacerta.data.Document; import one.nem.lacerta.data.LacertaLibrary; import one.nem.lacerta.model.ListItemType; @@ -176,9 +177,12 @@ public class ViewerListFragment extends Fragment { toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.action_open_vcs_rev_list) { // Open vcs rev list - getParentFragmentManager().beginTransaction() - .replace(R.id.nav_host_fragment, ViewerVcsRevListFragment.newInstance(documentId, documentName)) - .commit(); +// getParentFragmentManager().beginTransaction() +// .replace(R.id.nav_host_fragment, ViewerVcsRevListFragment.newInstance(documentId, documentName)) +// .commit(); + + LacertaSelectRevDialog lacertaSelectRevDialog = new LacertaSelectRevDialog(); + lacertaSelectRevDialog.show(getParentFragmentManager(), "select_rev_dialog"); return true; } else if (item.getItemId() == R.id.action_rename) { From 87c913811b232422c78d8bd1077dba904efdf54f Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:03:33 +0900 Subject: [PATCH 20/30] =?UTF-8?q?=E4=BE=9D=E5=AD=98=E9=96=A2=E4=BF=82?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/common/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/component/common/build.gradle b/component/common/build.gradle index cf064b8f..d6dd1b67 100644 --- a/component/common/build.gradle +++ b/component/common/build.gradle @@ -42,4 +42,6 @@ dependencies { implementation project(':utils') implementation project(':model') implementation project(':data') + + implementation project(':vcs') } \ No newline at end of file From f812e6c38edd208371fb32be680f2a20bab3a6b0 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:09:26 +0900 Subject: [PATCH 21/30] =?UTF-8?q?=E5=AE=9F=E9=9A=9B=E3=81=ABRevision?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/LacertaSelectRevDialog.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java index 2989e9b5..2bc571a0 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java @@ -12,9 +12,26 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.dialog.MaterialAlertDialogBuilder; +import javax.inject.Inject; + +import dagger.hilt.android.AndroidEntryPoint; +import one.nem.lacerta.data.LacertaLibrary; +import one.nem.lacerta.utils.LacertaLogger; +import one.nem.lacerta.vcs.LacertaVcs; +import one.nem.lacerta.vcs.factory.LacertaVcsFactory; + + +@AndroidEntryPoint public class LacertaSelectRevDialog extends DialogFragment { + @Inject + LacertaVcsFactory lacertaVcsFactory; + + @Inject + LacertaLogger logger; + String title; + String documentId; String message; String negativeButtonText; @@ -25,6 +42,11 @@ public class LacertaSelectRevDialog extends DialogFragment { return this; } + public LacertaSelectRevDialog setDocumentId(String documentId) { + this.documentId = documentId; + return this; + } + public LacertaSelectRevDialog setMessage(String message) { this.message = message; return this; @@ -62,8 +84,21 @@ public class LacertaSelectRevDialog extends DialogFragment { recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - builder.setView(view); + + if (this.documentId == null) { + logger.error("SelectRevDialog", "documentId is null"); + logger.e_code("0296fb0c-07a3-4971-a280-bd1a61461bb7"); + Toast.makeText(getContext(), "Sorry, something went wrong", Toast.LENGTH_SHORT).show(); + dismiss(); + } + LacertaVcs lacertaVcs = lacertaVcsFactory.create(this.documentId); + lacertaVcs.getRevisionHistory().thenAccept(revList -> { + adapter.setRevList(revList); + adapter.notifyDataSetChanged(); // TODO-rca:時間に応じてアニメーションをつける + }); + + builder.setTitle(title == null ? "Select Rev" : title); builder.setMessage(message == null ? "Select Rev" : message); builder.setNegativeButton(negativeButtonText, (dialog, which) -> { From cf257a44ec81caebbc63b6abe18bbb4a66d104c4 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:13:01 +0900 Subject: [PATCH 22/30] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/src/main/res/layout/common_rev_list_item.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/component/common/src/main/res/layout/common_rev_list_item.xml b/component/common/src/main/res/layout/common_rev_list_item.xml index bd938d79..682c3133 100644 --- a/component/common/src/main/res/layout/common_rev_list_item.xml +++ b/component/common/src/main/res/layout/common_rev_list_item.xml @@ -16,7 +16,7 @@ Date: Sat, 27 Jan 2024 16:16:52 +0900 Subject: [PATCH 23/30] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=83=86=E3=83=A0?= =?UTF-8?q?=E3=81=AB=E3=82=BF=E3=83=83=E3=83=81=E3=83=AA=E3=82=B9=E3=83=8A?= =?UTF-8?q?=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/component/common/LacertaSelectRevDialog.java | 5 ++--- .../lacerta/component/common/SelectRevDialogItemAdapter.java | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java index 2bc571a0..208bfa28 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java @@ -78,11 +78,10 @@ public class LacertaSelectRevDialog extends DialogFragment { SelectRevDialogItemAdapter adapter = new SelectRevDialogItemAdapter(revId -> { if (listener != null) { listener.onItemSelected(revId); + dismiss(); } - dismiss(); }); - - recyclerView.setAdapter(adapter); + recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); builder.setView(view); diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java b/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java index 47991374..6b26d4fc 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/SelectRevDialogItemAdapter.java @@ -41,6 +41,8 @@ public class SelectRevDialogItemAdapter extends RecyclerView.Adapter listener.onItemSelected(rev.getId())); } @Override From 78d4345313daa370914ba9c9b850fb5b0f05b33a Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:17:09 +0900 Subject: [PATCH 24/30] =?UTF-8?q?=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E5=8F=97=E3=81=91=E5=8F=96=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerListFragment.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 269e9193..6f51a995 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -22,6 +22,7 @@ import dagger.hilt.android.AndroidEntryPoint; import one.nem.lacerta.component.common.LacertaSelectDirDialog; import one.nem.lacerta.component.common.LacertaSelectDirDialogListener; import one.nem.lacerta.component.common.LacertaSelectRevDialog; +import one.nem.lacerta.component.common.LacertaSelectRevDialogListener; import one.nem.lacerta.data.Document; import one.nem.lacerta.data.LacertaLibrary; import one.nem.lacerta.model.ListItemType; @@ -182,6 +183,20 @@ public class ViewerListFragment extends Fragment { // .commit(); LacertaSelectRevDialog lacertaSelectRevDialog = new LacertaSelectRevDialog(); + lacertaSelectRevDialog.setDocumentId(this.documentId); + lacertaSelectRevDialog.setListener(new LacertaSelectRevDialogListener() { + @Override + public void onItemSelected(String revId) { + // Do something + Toast.makeText(getContext(), "Selected revId: " + revId, Toast.LENGTH_SHORT).show(); + } + + @Override + public void onDialogCanceled() { + // Do something + Toast.makeText(getContext(), "Canceled", Toast.LENGTH_SHORT).show(); + } + }); lacertaSelectRevDialog.show(getParentFragmentManager(), "select_rev_dialog"); return true; } else if (item.getItemId() == R.id.action_rename) { From 7ef75bb375a659e50f6ea4769fbc0a2a190f75d1 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:17:52 +0900 Subject: [PATCH 25/30] =?UTF-8?q?negativeButtonText=E3=81=8C=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AE=E6=97=A2=E5=AE=9A=E5=80=A4=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/component/common/LacertaSelectRevDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java index 208bfa28..c3650eb3 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaSelectRevDialog.java @@ -100,7 +100,7 @@ public class LacertaSelectRevDialog extends DialogFragment { builder.setTitle(title == null ? "Select Rev" : title); builder.setMessage(message == null ? "Select Rev" : message); - builder.setNegativeButton(negativeButtonText, (dialog, which) -> { + builder.setNegativeButton(negativeButtonText == null ? "Cancel" : negativeButtonText, (dialog, which) -> { if (listener != null) { listener.onDialogCanceled(); dismiss(); From c7f55025358cead5b4290f70109493a77fc1351e Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:20:11 +0900 Subject: [PATCH 26/30] =?UTF-8?q?=E9=81=B8=E6=8A=9E=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9FRevision=E3=81=AB=E6=8E=A8=E7=A7=BB=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/component/viewer/ViewerListFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 6f51a995..b7499afe 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -189,6 +189,9 @@ public class ViewerListFragment extends Fragment { public void onItemSelected(String revId) { // Do something Toast.makeText(getContext(), "Selected revId: " + revId, Toast.LENGTH_SHORT).show(); + getParentFragmentManager().beginTransaction() + .replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(documentId, documentName, revisionId)) + .commit(); } @Override From 603a758ab66515d1a0e13a37a8b858739a6c05a8 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:21:41 +0900 Subject: [PATCH 27/30] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E5=89=8A=E9=99=A4,=20=E3=83=86?= =?UTF-8?q?=E3=82=AD=E3=82=B9=E3=83=88=E3=82=92=E6=98=8E=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/component/viewer/ViewerListFragment.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index b7499afe..1a822dc3 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -177,13 +177,8 @@ public class ViewerListFragment extends Fragment { toolbar.inflateMenu(R.menu.viewer_menu); toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.action_open_vcs_rev_list) { - // Open vcs rev list -// getParentFragmentManager().beginTransaction() -// .replace(R.id.nav_host_fragment, ViewerVcsRevListFragment.newInstance(documentId, documentName)) -// .commit(); - LacertaSelectRevDialog lacertaSelectRevDialog = new LacertaSelectRevDialog(); - lacertaSelectRevDialog.setDocumentId(this.documentId); + lacertaSelectRevDialog.setDocumentId(this.documentId).setTitle("リビジョンの選択").setMessage("リビジョンを選択してください。").setNegativeButtonText("キャンセル"); lacertaSelectRevDialog.setListener(new LacertaSelectRevDialogListener() { @Override public void onItemSelected(String revId) { From 9ba3c224c43de5ea04b0f76c00ad175d3aeff319 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:22:34 +0900 Subject: [PATCH 28/30] =?UTF-8?q?=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/component/viewer/ViewerListFragment.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 1a822dc3..328f9e41 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -182,8 +182,6 @@ public class ViewerListFragment extends Fragment { lacertaSelectRevDialog.setListener(new LacertaSelectRevDialogListener() { @Override public void onItemSelected(String revId) { - // Do something - Toast.makeText(getContext(), "Selected revId: " + revId, Toast.LENGTH_SHORT).show(); getParentFragmentManager().beginTransaction() .replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(documentId, documentName, revisionId)) .commit(); @@ -191,8 +189,7 @@ public class ViewerListFragment extends Fragment { @Override public void onDialogCanceled() { - // Do something - Toast.makeText(getContext(), "Canceled", Toast.LENGTH_SHORT).show(); + logger.debug(TAG, "Canceled"); } }); lacertaSelectRevDialog.show(getParentFragmentManager(), "select_rev_dialog"); @@ -242,7 +239,6 @@ public class ViewerListFragment extends Fragment { builder.show(); return true; } else if (item.getItemId() == R.id.action_move) { -// Toast.makeText(getContext(), "Work in progress", Toast.LENGTH_SHORT).show(); LacertaSelectDirDialog lacertaSelectDirDialog = new LacertaSelectDirDialog(); lacertaSelectDirDialog.setListener(new LacertaSelectDirDialogListener() { @Override From c05c80f3e75143a5eb0d22ae3e1267d6b008ede1 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:22:59 +0900 Subject: [PATCH 29/30] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/component/viewer/ViewerListFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 328f9e41..61186a59 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -164,7 +164,7 @@ public class ViewerListFragment extends Fragment { private void toolbarSetup(Toolbar toolbar, boolean showBackButton, String title, String Subtitle) { getActivity().runOnUiThread(() -> { if (showBackButton) { - toolbar.setNavigationIcon(one.nem.lacerta.shared.ui.R.drawable.arrow_back_24px); + toolbar.setNavigationIcon(one.nem.lacerta.shared.ui.R.drawable.close_24px); toolbar.setNavigationOnClickListener(v -> { // Stop Activity getActivity().finish(); From bda2b82ceafa5e3955563d4a77d4ca8bbfab512a Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 27 Jan 2024 16:23:35 +0900 Subject: [PATCH 30/30] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6=E3=83=97=E3=83=AD?= =?UTF-8?q?=E3=83=91=E3=83=86=E3=82=A3=E5=90=8D=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/component/viewer/ViewerListFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java index 61186a59..349bc99a 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerListFragment.java @@ -158,12 +158,12 @@ public class ViewerListFragment extends Fragment { * ToolbarをInitする * * @param toolbar Toolbar - * @param showBackButton 戻るボタンを表示するか + * @param showCloseButton 戻るボタンを表示するか * @param title タイトル */ - private void toolbarSetup(Toolbar toolbar, boolean showBackButton, String title, String Subtitle) { + private void toolbarSetup(Toolbar toolbar, boolean showCloseButton, String title, String Subtitle) { getActivity().runOnUiThread(() -> { - if (showBackButton) { + if (showCloseButton) { toolbar.setNavigationIcon(one.nem.lacerta.shared.ui.R.drawable.close_24px); toolbar.setNavigationOnClickListener(v -> { // Stop Activity