From 5fc8a501ad01660e2136a03afe4bc04dc7100884 Mon Sep 17 00:00:00 2001 From: r-ca Date: Wed, 24 Jan 2024 17:03:50 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerMainActivity.java | 9 +-------- ...TopFragment.java => ViewerPrimaryFragment.java} | 14 +++++--------- .../src/main/res/layout/activity_viewer_main.xml | 2 +- .../res/navigation/component_viewer_navigation.xml | 6 +++--- 4 files changed, 10 insertions(+), 21 deletions(-) rename component/viewer/src/main/java/one/nem/lacerta/component/viewer/{ComponentViewerTopFragment.java => ViewerPrimaryFragment.java} (92%) 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 435e472c..218fe7b0 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 @@ -2,7 +2,6 @@ package one.nem.lacerta.component.viewer; import android.content.Intent; import android.os.Bundle; -import android.util.Log; import android.widget.Toast; import androidx.activity.EdgeToEdge; @@ -10,12 +9,6 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; -import androidx.fragment.app.FragmentManager; -import androidx.navigation.NavController; -import androidx.navigation.fragment.NavHostFragment; -import androidx.navigation.ui.NavigationUI; - -import com.google.android.material.bottomnavigation.BottomNavigationView; import javax.inject.Inject; @@ -62,7 +55,7 @@ public class ViewerMainActivity extends AppCompatActivity { // Navigation getSupportFragmentManager().beginTransaction() - .replace(R.id.nav_host_fragment, ComponentViewerTopFragment.newInstance(documentId, documentName)) + .replace(R.id.nav_host_fragment, ViewerPrimaryFragment.newInstance(documentId, documentName)) .commit(); } } \ No newline at end of file diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ComponentViewerTopFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerPrimaryFragment.java similarity index 92% rename from component/viewer/src/main/java/one/nem/lacerta/component/viewer/ComponentViewerTopFragment.java rename to component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerPrimaryFragment.java index 6e456d16..b7cda2a5 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ComponentViewerTopFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerPrimaryFragment.java @@ -1,12 +1,10 @@ package one.nem.lacerta.component.viewer; import android.app.AlertDialog; -import android.graphics.Bitmap; import android.os.Bundle; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import androidx.navigation.Navigation; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -16,24 +14,22 @@ import android.view.ViewGroup; import android.widget.Toast; import java.util.ArrayList; -import java.util.concurrent.CompletableFuture; import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; import one.nem.lacerta.data.Document; -import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.page.Page; import one.nem.lacerta.utils.FeatureSwitch; import one.nem.lacerta.utils.LacertaLogger; /** * A simple {@link Fragment} subclass. - * Use the {@link ComponentViewerTopFragment#newInstance} factory method to + * Use the {@link ViewerPrimaryFragment#newInstance} factory method to * create an instance of this fragment. */ @AndroidEntryPoint -public class ComponentViewerTopFragment extends Fragment { +public class ViewerPrimaryFragment extends Fragment { @Inject Document document; @@ -46,12 +42,12 @@ public class ComponentViewerTopFragment extends Fragment { private String documentId; private String documentName; - public ComponentViewerTopFragment() { + public ViewerPrimaryFragment() { // Required empty public constructor } - public static ComponentViewerTopFragment newInstance(String documentId, String documentName) { - ComponentViewerTopFragment fragment = new ComponentViewerTopFragment(); + public static ViewerPrimaryFragment newInstance(String documentId, String documentName) { + ViewerPrimaryFragment fragment = new ViewerPrimaryFragment(); Bundle args = new Bundle(); args.putString("documentId", documentId); args.putString("documentName", documentName); diff --git a/component/viewer/src/main/res/layout/activity_viewer_main.xml b/component/viewer/src/main/res/layout/activity_viewer_main.xml index 73290603..89617f07 100644 --- a/component/viewer/src/main/res/layout/activity_viewer_main.xml +++ b/component/viewer/src/main/res/layout/activity_viewer_main.xml @@ -9,7 +9,7 @@ + app:startDestination="@id/viewerPrimaryFragment">