From 56a49d4c7e2de59a094e147efccd35626d2563e4 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:17:53 +0900 Subject: [PATCH 1/7] =?UTF-8?q?Rev=E3=81=AE=E4=BD=9C=E6=88=90=E6=97=A5?= =?UTF-8?q?=E6=99=82=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/component/viewer/RevAdapter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java index bee4308d..eb5c634f 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java @@ -8,6 +8,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import java.text.SimpleDateFormat; import java.time.format.DateTimeFormatter; import java.util.ArrayList; @@ -40,13 +41,14 @@ public class RevAdapter extends RecyclerView.Adapter{ @Override public void onBindViewHolder(@NonNull RevAdapter.RevViewHolder holder, int position) { VcsRevModel revModel = revModels.get(position); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); holder.title.setText(revModel.getCommitMessage()); if (FeatureSwitch.Vcs.disableBranchDisplay) { // holder.detail.setText(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(revModel.getCreatedAt().toInstant())); - holder.detail.setText("DateTimePlaceholder"); + holder.detail.setText(simpleDateFormat.format(revModel.getCreatedAt())); } else { // holder.detail.setText(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(revModel.getCreatedAt().toInstant()) + " " + revModel.getBranchName()); - holder.detail.setText("DateTimePlaceholder" + " " + revModel.getBranchName()); + holder.detail.setText(simpleDateFormat.format(revModel.getCreatedAt())+ " " + revModel.getBranchName()); } holder.revId.setText("RevID: " + revModel.getId()); From 7ece8c7b69f6e5fccad61d68c38f1027f08c0861 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:21:13 +0900 Subject: [PATCH 2/7] Depend --- feature/library/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/library/build.gradle b/feature/library/build.gradle index fa18f9bc..6b102535 100644 --- a/feature/library/build.gradle +++ b/feature/library/build.gradle @@ -53,5 +53,7 @@ dependencies { implementation project(':utils') + implementation project(':component:viewer') + } \ No newline at end of file From 5288855075c91fb6df1d0d3cd167616304ea996d Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:21:19 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java b/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java index 14832a5c..5c808841 100644 --- a/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java +++ b/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java @@ -11,6 +11,7 @@ public class FeatureSwitch { } public static class Viewer { + // TODO-rca: 実装 public static boolean showOriginalImage = false; public static int maxImageSize = 1024; public static boolean showProgressBarWhenLoading = true; @@ -18,7 +19,7 @@ public class FeatureSwitch { public static class FeatureMaster { public static boolean enableSearch = false; - public static boolean enableDebugMenu = true; + public static boolean enableDebugMenu = false; } public static class Vcs { @@ -26,6 +27,7 @@ public class FeatureSwitch { } public static class Setting { + // TODO-rca: 実装 public static boolean showDisplayMenu = false; public static boolean showDataMenu = false; public static boolean showScanMenu = false; From 1692399b9ad210ae15599448e9b7f24dd7e14331 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:21:48 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=AA=E3=81=8B=E3=82=89=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E9=96=8B=E3=81=91=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/feature/library/LibraryPageFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 363121d5..d3aab1fb 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 @@ -1,6 +1,7 @@ package one.nem.lacerta.feature.library; import android.app.AlertDialog; +import android.content.Intent; import android.os.Bundle; import androidx.annotation.NonNull; @@ -35,6 +36,7 @@ import java.util.Objects; import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; +import one.nem.lacerta.component.viewer.ViewerMainActivity; import one.nem.lacerta.data.Document; import one.nem.lacerta.data.LacertaLibrary; import one.nem.lacerta.model.FragmentNavigation; @@ -179,7 +181,11 @@ public class LibraryPageFragment extends Fragment { @Override public void onDocumentSelected(String documentId, String documentName) { - Toast.makeText(getContext(), "Document selected! documentId: " + documentId + ", documentName: " + documentName, Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(getContext(), ViewerMainActivity.class); + logger.debug("LibraryTopFragment", "Document selected! documentId: " + documentId + ", documentName: " + documentName); + intent.putExtra("documentId", documentId); + intent.putExtra("documentName", documentName); + startActivity(intent); } }); From 1ce3af59e6dfc59a7d3af889276b193e358e8d4a Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:22:48 +0900 Subject: [PATCH 5/7] =?UTF-8?q?UI=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/feature/home/HomeTopFragment.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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 3d64657c..64c5434b 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 @@ -8,11 +8,14 @@ import android.view.View; import android.view.ViewGroup; import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.navigation.Navigation; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.google.android.material.appbar.AppBarLayout; + import javax.inject.Inject; import dagger.hilt.android.AndroidEntryPoint; @@ -56,6 +59,23 @@ public class HomeTopFragment extends Fragment { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_home_top, container, false); + // Set status bar color + AppBarLayout appBarLayout = view.findViewById(R.id.app_bar_layout); + appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { + @Override + public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { + if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) { + // Collapsed + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); + } else if (verticalOffset == 0) { + // Expanded + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); + } else { + // Somewhere in between + // Here you can add a color transition if you want + } + } + }); return view; } From fda8adae801b5f637a6f067ca545d7f272f004a0 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:23:21 +0900 Subject: [PATCH 6/7] =?UTF-8?q?UI=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/setting/SettingTopFragment.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java index 14b1bd06..7b0b237d 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java @@ -10,6 +10,8 @@ import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.google.android.material.appbar.AppBarLayout; + import java.util.ArrayList; import one.nem.lacerta.setting.model.SettingListItem; @@ -86,6 +88,23 @@ public class SettingTopFragment extends Fragment { recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setAdapter(new ListItemAdapter(settingListItems)); + // Set status bar color + AppBarLayout appBarLayout = view.findViewById(R.id.app_bar_layout); + appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { + @Override + public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { + if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) { + // Collapsed + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); + } else if (verticalOffset == 0) { + // Expanded + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); + } else { + // Somewhere in between + // Here you can add a color transition if you want + } + } + }); return view; } } \ No newline at end of file From 6e4904967be16a1664450eab7ca511839f220e81 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:24:11 +0900 Subject: [PATCH 7/7] =?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 --- .../lacerta/feature/home/HomeTopFragment.java | 20 +++++++------------ .../feature/library/LibraryPageFragment.java | 20 +++++++------------ .../lacerta/setting/SettingTopFragment.java | 20 +++++++------------ 3 files changed, 21 insertions(+), 39 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 64c5434b..e27bcfbd 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 @@ -61,19 +61,13 @@ public class HomeTopFragment extends Fragment { // Set status bar color AppBarLayout appBarLayout = view.findViewById(R.id.app_bar_layout); - appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { - @Override - public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { - if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) { - // Collapsed - getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); - } else if (verticalOffset == 0) { - // Expanded - getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); - } else { - // Somewhere in between - // Here you can add a color transition if you want - } + appBarLayout.addOnOffsetChangedListener((appBarLayout1, verticalOffset) -> { + if (Math.abs(verticalOffset) == appBarLayout1.getTotalScrollRange()) { + // Collapsed + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); + } else if (verticalOffset == 0) { + // Expanded + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); } }); return view; 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 d3aab1fb..fd9d3e89 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 @@ -119,19 +119,13 @@ public class LibraryPageFragment extends Fragment { // Set status bar color AppBarLayout appBarLayout = view.findViewById(R.id.app_bar_layout); - appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { - @Override - public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { - if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) { - // Collapsed - getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); - } else if (verticalOffset == 0) { - // Expanded - getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); - } else { - // Somewhere in between - // Here you can add a color transition if you want - } + appBarLayout.addOnOffsetChangedListener((appBarLayout1, verticalOffset) -> { + if (Math.abs(verticalOffset) == appBarLayout1.getTotalScrollRange()) { + // Collapsed + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); + } else if (verticalOffset == 0) { + // Expanded + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); } }); return view; diff --git a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java index 7b0b237d..6c789b17 100644 --- a/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java +++ b/feature/setting/src/main/java/one/nem/lacerta/setting/SettingTopFragment.java @@ -90,19 +90,13 @@ public class SettingTopFragment extends Fragment { // Set status bar color AppBarLayout appBarLayout = view.findViewById(R.id.app_bar_layout); - appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { - @Override - public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { - if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) { - // Collapsed - getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); - } else if (verticalOffset == 0) { - // Expanded - getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); - } else { - // Somewhere in between - // Here you can add a color transition if you want - } + appBarLayout.addOnOffsetChangedListener((appBarLayout1, verticalOffset) -> { + if (Math.abs(verticalOffset) == appBarLayout1.getTotalScrollRange()) { + // Collapsed + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); + } else if (verticalOffset == 0) { + // Expanded + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), one.nem.lacerta.shared.ui.R.color.colorSurface)); } }); return view;