From 314214f7343f1f9bf1ae4a0d326ff48c6c0ea064 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 28 Jan 2024 13:13:51 +0900 Subject: [PATCH] =?UTF-8?q?ViewerMainActivity=E3=81=8B=E3=82=89Container?= =?UTF-8?q?=E3=82=92=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=99=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 --- .../component/viewer/ViewerMainActivity.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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 0b9a3e59..0c73af39 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 @@ -30,6 +30,7 @@ public class ViewerMainActivity extends AppCompatActivity { private static final String TAG = "ViewerMainActivity"; String documentId; String documentName; + boolean hasCombined = false; @Override protected void onCreate(Bundle savedInstanceState) { @@ -49,6 +50,7 @@ public class ViewerMainActivity extends AppCompatActivity { try { documentId = intent.getStringExtra("documentId"); documentName = intent.getStringExtra("documentName"); + hasCombined = intent.getBooleanExtra("hasCombined", false); } catch (Exception e) { logger.error(TAG, "Failed to get documentId from intent"); @@ -58,9 +60,18 @@ public class ViewerMainActivity extends AppCompatActivity { } // Navigation - getSupportFragmentManager().beginTransaction() - .replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(documentId, documentName)) - .commit(); +// getSupportFragmentManager().beginTransaction() +// .replace(R.id.nav_host_fragment, ViewerListFragment.newInstance(documentId, documentName)) +// .commit(); + if (hasCombined) { + getSupportFragmentManager().beginTransaction() + .replace(R.id.nav_host_fragment, ViewerContainerFragment.newInstance(documentId, documentName, hasCombined)) + .commit(); + } else { + getSupportFragmentManager().beginTransaction() + .replace(R.id.nav_host_fragment, ViewerContainerFragment.newInstance(documentId, documentName)) + .commit(); + } } } \ No newline at end of file