From 9d2e5dd217ab4d6c4d776591c12c3d3a56f2f127 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, 19 Jan 2024 15:37:15 +0900 Subject: [PATCH 01/25] =?UTF-8?q?ConstraintLayout=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/home/src/main/res/layout/fragment_home_top.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index b5c724e4..e9544337 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file From 5d8b9f338d5ee88af787267505dd53e5d7a27b68 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, 19 Jan 2024 15:45:18 +0900 Subject: [PATCH 02/25] =?UTF-8?q?CollapsingToolBar=E5=AE=9F=E8=A3=85?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/feature/home/HomeTopFragment.java | 25 +++++++++++-- .../src/main/res/layout/fragment_home_top.xml | 37 +++++++++++-------- 2 files changed, 44 insertions(+), 18 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 0f39aa5c..be127ef1 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 @@ -6,10 +6,15 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.google.android.material.appbar.CollapsingToolbarLayout; + import java.util.ArrayList; import java.util.List; @@ -79,8 +84,7 @@ public class HomeTopFragment extends Fragment { } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_home_top, container, false); @@ -100,8 +104,23 @@ public class HomeTopFragment extends Fragment { return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + CollapsingToolbarLayout collapsingToolbarLayout = view.findViewById(R.id.collapsing_toolbar); + Toolbar toolbar = view.findViewById(R.id.toolbar); + + // Set the Toolbar + ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); + + // Set the title of the CollapsingToolbarLayout + collapsingToolbarLayout.setTitle("Title"); + } + - } String pageTitle; String pageId; ArrayList listItems; diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index e9544337..a70e122c 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,21 +1,28 @@ - - + android:layout_height="match_parent"> - - - - - + android:layout_height="wrap_content"> + - + - \ No newline at end of file + + + + + + + \ No newline at end of file From 4b5ce622fd5c1af1b3446972ef539e4fcd4f1d70 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, 19 Jan 2024 15:45:33 +0900 Subject: [PATCH 03/25] =?UTF-8?q?=E4=B8=80=E6=97=A6=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88(=E3=83=93?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=82=A8=E3=83=A9=E3=83=BC=E5=9B=9E=E9=81=BF?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/feature/home/HomeTopFragment.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 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 be127ef1..2dcc534a 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,17 +90,17 @@ public class HomeTopFragment extends Fragment { // List metas = document.getAllDocumentMetas(100); - ArrayList listItems = lacertaLibrary.getRecentDocument(100); - - Log.d("docs", Integer.toString(listItems.size())); - - RecyclerView recyclerView = view.findViewById(R.id.item_recycler_view); - - recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - - MyAdapter myAdapter = new MyAdapter(listItems); - - recyclerView.setAdapter(myAdapter); +// ArrayList listItems = lacertaLibrary.getRecentDocument(100); +// +// Log.d("docs", Integer.toString(listItems.size())); +// +// RecyclerView recyclerView = view.findViewById(R.id.item_recycler_view); +// +// recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); +// +// MyAdapter myAdapter = new MyAdapter(listItems); +// +// recyclerView.setAdapter(myAdapter); return view; From 7a2beececc4949631ebfadf434dfd3ff41ee3ab1 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, 19 Jan 2024 15:49:23 +0900 Subject: [PATCH 04/25] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E8=A8=82=E6=AD=A3=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/home/src/main/res/layout/fragment_home_top.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index a70e122c..dfc037e9 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -10,14 +10,20 @@ + app:layout_collapseMode="pin" + app:title="HOGE"/> From a325ace6f3312be62eb57203736e75226ea6ef26 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, 19 Jan 2024 15:51:03 +0900 Subject: [PATCH 05/25] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E8=A8=82=E6=AD=A3=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/fragment_home_top.xml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index dfc037e9..c6c8f0b0 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -29,6 +29,28 @@ - + + + + + + + + + \ No newline at end of file From b9973b845f58b630130519662de07cd568a18da6 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, 19 Jan 2024 16:00:37 +0900 Subject: [PATCH 06/25] WIP --- feature/home/src/main/res/layout/fragment_home_top.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index c6c8f0b0..bb7d68cd 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -10,12 +10,13 @@ Date: Fri, 19 Jan 2024 16:43:45 +0900 Subject: [PATCH 07/25] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E7=94=A8?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/ui/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/ui/src/main/res/values/strings.xml b/shared/ui/src/main/res/values/strings.xml index 98ef6664..a7abe338 100644 --- a/shared/ui/src/main/res/values/strings.xml +++ b/shared/ui/src/main/res/values/strings.xml @@ -15,4 +15,5 @@ + Placeholder(TODO: Replace) \ No newline at end of file From 81ba96a3d0bd950fc6ebc0e8be0058fae58ab428 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, 19 Jan 2024 16:51:20 +0900 Subject: [PATCH 08/25] WIP --- .../lacerta/feature/home/HomeTopFragment.java | 8 ++ .../src/main/res/layout/fragment_home_top.xml | 91 +++++++++++-------- .../home/src/main/res/menu/drawer_menu.xml | 8 ++ 3 files changed, 69 insertions(+), 38 deletions(-) create mode 100644 feature/home/src/main/res/menu/drawer_menu.xml 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 2dcc534a..0b1c39a5 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 @@ -7,8 +7,10 @@ import android.view.View; import android.view.ViewGroup; +import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; +import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -116,6 +118,12 @@ public class HomeTopFragment extends Fragment { // Set the Toolbar ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); + DrawerLayout drawer = view.findViewById(R.id.drawer_layout); + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( + getActivity(), drawer, toolbar, one.nem.lacerta.shared.ui.R.string.placeholder, one.nem.lacerta.shared.ui.R.string.placeholder); + drawer.addDrawerListener(toggle); + toggle.syncState(); + // Set the title of the CollapsingToolbarLayout collapsingToolbarLayout.setTitle("Title"); } diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index bb7d68cd..9f6268a3 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,57 +1,72 @@ - - + android:layout_height="match_parent"> - + android:layout_height="wrap_content"> - + android:layout_height="128dp" + android:fitsSystemWindows="true" + android:minHeight="?attr/actionBarSize" + app:collapsedTitleGravity="start|center_vertical" + app:expandedTitleGravity="start|bottom" + app:expandedTitleMarginBottom="16dp" + app:expandedTitleMarginStart="16dp" + app:expandedTitleTextAppearance="@style/TextAppearance.MaterialComponents.Headline4" + app:layout_scrollFlags="scroll|exitUntilCollapsed"> - + - + - + - + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + android:paddingStart="16dp" + android:paddingEnd="16dp"> - + - + - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/feature/home/src/main/res/menu/drawer_menu.xml b/feature/home/src/main/res/menu/drawer_menu.xml new file mode 100644 index 00000000..0cc72028 --- /dev/null +++ b/feature/home/src/main/res/menu/drawer_menu.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file From ef48223d465593974768b0d943228025d98fb23b 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, 19 Jan 2024 17:27:38 +0900 Subject: [PATCH 09/25] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_main.xml | 59 ++++++++++++------- app/src/main/res/menu/drawer_menu.xml | 7 +++ .../lacerta/feature/home/HomeTopFragment.java | 3 +- .../src/main/res/layout/fragment_home_top.xml | 14 +---- .../home/src/main/res/menu/drawer_menu.xml | 4 -- 5 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 app/src/main/res/menu/drawer_menu.xml diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 2117b2e1..b726cd3b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,32 +1,47 @@ - - + - + + + + + + + + + - \ No newline at end of file diff --git a/app/src/main/res/menu/drawer_menu.xml b/app/src/main/res/menu/drawer_menu.xml new file mode 100644 index 00000000..9041ecda --- /dev/null +++ b/app/src/main/res/menu/drawer_menu.xml @@ -0,0 +1,7 @@ + + + + \ 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 0b1c39a5..d093709c 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 @@ -118,7 +118,8 @@ public class HomeTopFragment extends Fragment { // Set the Toolbar ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); - DrawerLayout drawer = view.findViewById(R.id.drawer_layout); + // Activity側のDrawerLayoutを取得 + DrawerLayout drawer = getActivity().findViewById(R.id.); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( getActivity(), drawer, toolbar, one.nem.lacerta.shared.ui.R.string.placeholder, one.nem.lacerta.shared.ui.R.string.placeholder); drawer.addDrawerListener(toggle); diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index 9f6268a3..fb74430d 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,6 +1,5 @@ - @@ -30,7 +29,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" - app:title="HOGE"/> + app:title="HOGE" /> @@ -62,11 +61,4 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/feature/home/src/main/res/menu/drawer_menu.xml b/feature/home/src/main/res/menu/drawer_menu.xml index 0cc72028..fe187c0c 100644 --- a/feature/home/src/main/res/menu/drawer_menu.xml +++ b/feature/home/src/main/res/menu/drawer_menu.xml @@ -1,8 +1,4 @@ - \ No newline at end of file From cbc1d139afcd46370eda035e544152f3db3fc8bd 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, 19 Jan 2024 17:27:43 +0900 Subject: [PATCH 10/25] =?UTF-8?q?Revert=20"=E3=83=86=E3=82=B9=E3=83=88"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef48223d465593974768b0d943228025d98fb23b. --- app/src/main/res/layout/activity_main.xml | 59 +++++++------------ app/src/main/res/menu/drawer_menu.xml | 7 --- .../lacerta/feature/home/HomeTopFragment.java | 3 +- .../src/main/res/layout/fragment_home_top.xml | 14 ++++- .../home/src/main/res/menu/drawer_menu.xml | 4 ++ 5 files changed, 38 insertions(+), 49 deletions(-) delete mode 100644 app/src/main/res/menu/drawer_menu.xml diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b726cd3b..2117b2e1 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,47 +1,32 @@ - - + - - - - - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/menu/drawer_menu.xml b/app/src/main/res/menu/drawer_menu.xml deleted file mode 100644 index 9041ecda..00000000 --- a/app/src/main/res/menu/drawer_menu.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ 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 d093709c..0b1c39a5 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 @@ -118,8 +118,7 @@ public class HomeTopFragment extends Fragment { // Set the Toolbar ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); - // Activity側のDrawerLayoutを取得 - DrawerLayout drawer = getActivity().findViewById(R.id.); + DrawerLayout drawer = view.findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( getActivity(), drawer, toolbar, one.nem.lacerta.shared.ui.R.string.placeholder, one.nem.lacerta.shared.ui.R.string.placeholder); drawer.addDrawerListener(toggle); diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index fb74430d..9f6268a3 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,5 +1,6 @@ - @@ -29,7 +30,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" - app:title="HOGE" /> + app:title="HOGE"/> @@ -61,4 +62,11 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/feature/home/src/main/res/menu/drawer_menu.xml b/feature/home/src/main/res/menu/drawer_menu.xml index fe187c0c..0cc72028 100644 --- a/feature/home/src/main/res/menu/drawer_menu.xml +++ b/feature/home/src/main/res/menu/drawer_menu.xml @@ -1,4 +1,8 @@ + \ No newline at end of file From bcaa0e5c5c8ddb7610502dd721888fbeac6709ad 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, 19 Jan 2024 17:35:55 +0900 Subject: [PATCH 11/25] =?UTF-8?q?Revert=20"Revert=20"=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cbc1d139afcd46370eda035e544152f3db3fc8bd. --- app/src/main/res/layout/activity_main.xml | 59 ++++++++++++------- app/src/main/res/menu/drawer_menu.xml | 7 +++ .../lacerta/feature/home/HomeTopFragment.java | 3 +- .../src/main/res/layout/fragment_home_top.xml | 14 +---- .../home/src/main/res/menu/drawer_menu.xml | 4 -- 5 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 app/src/main/res/menu/drawer_menu.xml diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 2117b2e1..b726cd3b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,32 +1,47 @@ - - + - + + + + + + + + + - \ No newline at end of file diff --git a/app/src/main/res/menu/drawer_menu.xml b/app/src/main/res/menu/drawer_menu.xml new file mode 100644 index 00000000..9041ecda --- /dev/null +++ b/app/src/main/res/menu/drawer_menu.xml @@ -0,0 +1,7 @@ + + + + \ 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 0b1c39a5..d093709c 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 @@ -118,7 +118,8 @@ public class HomeTopFragment extends Fragment { // Set the Toolbar ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); - DrawerLayout drawer = view.findViewById(R.id.drawer_layout); + // Activity側のDrawerLayoutを取得 + DrawerLayout drawer = getActivity().findViewById(R.id.); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( getActivity(), drawer, toolbar, one.nem.lacerta.shared.ui.R.string.placeholder, one.nem.lacerta.shared.ui.R.string.placeholder); drawer.addDrawerListener(toggle); diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index 9f6268a3..fb74430d 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,6 +1,5 @@ - @@ -30,7 +29,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" - app:title="HOGE"/> + app:title="HOGE" /> @@ -62,11 +61,4 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/feature/home/src/main/res/menu/drawer_menu.xml b/feature/home/src/main/res/menu/drawer_menu.xml index 0cc72028..fe187c0c 100644 --- a/feature/home/src/main/res/menu/drawer_menu.xml +++ b/feature/home/src/main/res/menu/drawer_menu.xml @@ -1,8 +1,4 @@ - \ No newline at end of file From 0e1d4703e554316f7f4237f502317b5a3d0c40e3 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, 19 Jan 2024 17:42:55 +0900 Subject: [PATCH 12/25] =?UTF-8?q?Revert=20"Revert=20"Revert=20"=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88"""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bcaa0e5c5c8ddb7610502dd721888fbeac6709ad. --- app/src/main/res/layout/activity_main.xml | 59 +++++++------------ app/src/main/res/menu/drawer_menu.xml | 7 --- .../lacerta/feature/home/HomeTopFragment.java | 3 +- .../src/main/res/layout/fragment_home_top.xml | 14 ++++- .../home/src/main/res/menu/drawer_menu.xml | 4 ++ 5 files changed, 38 insertions(+), 49 deletions(-) delete mode 100644 app/src/main/res/menu/drawer_menu.xml diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b726cd3b..2117b2e1 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,47 +1,32 @@ - - + - - - - - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/menu/drawer_menu.xml b/app/src/main/res/menu/drawer_menu.xml deleted file mode 100644 index 9041ecda..00000000 --- a/app/src/main/res/menu/drawer_menu.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ 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 d093709c..0b1c39a5 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 @@ -118,8 +118,7 @@ public class HomeTopFragment extends Fragment { // Set the Toolbar ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); - // Activity側のDrawerLayoutを取得 - DrawerLayout drawer = getActivity().findViewById(R.id.); + DrawerLayout drawer = view.findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( getActivity(), drawer, toolbar, one.nem.lacerta.shared.ui.R.string.placeholder, one.nem.lacerta.shared.ui.R.string.placeholder); drawer.addDrawerListener(toggle); diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index fb74430d..9f6268a3 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,5 +1,6 @@ - @@ -29,7 +30,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" - app:title="HOGE" /> + app:title="HOGE"/> @@ -61,4 +62,11 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/feature/home/src/main/res/menu/drawer_menu.xml b/feature/home/src/main/res/menu/drawer_menu.xml index fe187c0c..0cc72028 100644 --- a/feature/home/src/main/res/menu/drawer_menu.xml +++ b/feature/home/src/main/res/menu/drawer_menu.xml @@ -1,4 +1,8 @@ + \ No newline at end of file From 339566b2431e688246219159053a4d4037817303 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, 19 Jan 2024 17:46:33 +0900 Subject: [PATCH 13/25] =?UTF-8?q?=E3=83=89=E3=83=AD=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=92=E5=BB=83=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/fragment_home_top.xml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index 9f6268a3..3de60417 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,6 +1,5 @@ - @@ -30,7 +29,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" - app:title="HOGE"/> + app:title="HOGE" /> @@ -62,11 +61,4 @@ - - - \ No newline at end of file + \ No newline at end of file From dc1cc429e9560b3dbcd70c008920b3ce31e3c3c7 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, 19 Jan 2024 17:47:57 +0900 Subject: [PATCH 14/25] =?UTF-8?q?=E3=83=89=E3=83=AD=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=92=E5=BB=83=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/feature/home/HomeTopFragment.java | 5 ----- feature/home/src/main/res/layout/fragment_home_top.xml | 2 +- 2 files changed, 1 insertion(+), 6 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 0b1c39a5..d8321bdc 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 @@ -118,11 +118,6 @@ public class HomeTopFragment extends Fragment { // Set the Toolbar ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); - DrawerLayout drawer = view.findViewById(R.id.drawer_layout); - ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( - getActivity(), drawer, toolbar, one.nem.lacerta.shared.ui.R.string.placeholder, one.nem.lacerta.shared.ui.R.string.placeholder); - drawer.addDrawerListener(toggle); - toggle.syncState(); // Set the title of the CollapsingToolbarLayout collapsingToolbarLayout.setTitle("Title"); diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index 3de60417..fb74430d 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,5 +1,5 @@ From 2e5559df887d35817810c3cc43e57cee1a82107a 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, 19 Jan 2024 18:00:45 +0900 Subject: [PATCH 15/25] WIP --- .../java/one/nem/lacerta/feature/home/HomeTopFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 d8321bdc..ff6c5ca5 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 @@ -3,6 +3,8 @@ package one.nem.lacerta.feature.home; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; import android.view.View; import android.view.ViewGroup; @@ -83,6 +85,7 @@ public class HomeTopFragment extends Fragment { } + } @Override @@ -118,12 +121,10 @@ public class HomeTopFragment extends Fragment { // Set the Toolbar ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); - // Set the title of the CollapsingToolbarLayout - collapsingToolbarLayout.setTitle("Title"); + collapsingToolbarLayout.setTitle("Lacerta"); } - String pageTitle; String pageId; ArrayList listItems; From 738d8a055c025c3a8d50ee2e10c1d1d8fb4caebc 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, 19 Jan 2024 18:15:45 +0900 Subject: [PATCH 16/25] =?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 5ffcc098..aff0b75a 100644 --- a/component/common/build.gradle +++ b/component/common/build.gradle @@ -32,4 +32,6 @@ dependencies { testImplementation libs.junit androidTestImplementation libs.androidx.test.ext.junit androidTestImplementation libs.androidx.test.espresso.core + + implementation project(':shared:ui') } \ No newline at end of file From a74eb821f8827eb91a815b18d4298a423de1eb07 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, 19 Jan 2024 18:19:42 +0900 Subject: [PATCH 17/25] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E4=BD=9C=E6=88=90=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/layout/common_library_list_item.xml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 component/common/src/main/res/layout/common_library_list_item.xml diff --git a/component/common/src/main/res/layout/common_library_list_item.xml b/component/common/src/main/res/layout/common_library_list_item.xml new file mode 100644 index 00000000..5be7db02 --- /dev/null +++ b/component/common/src/main/res/layout/common_library_list_item.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file From dcd5f1b6505da12970423246a84a90633422d5e2 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, 19 Jan 2024 18:19:51 +0900 Subject: [PATCH 18/25] =?UTF-8?q?Placeholder=E3=83=86=E3=82=AD=E3=82=B9?= =?UTF-8?q?=E3=83=88=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/debug/src/main/res/layout/list_item_debug_menu.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/debug/src/main/res/layout/list_item_debug_menu.xml b/feature/debug/src/main/res/layout/list_item_debug_menu.xml index 607fd4e6..eb345aef 100644 --- a/feature/debug/src/main/res/layout/list_item_debug_menu.xml +++ b/feature/debug/src/main/res/layout/list_item_debug_menu.xml @@ -11,6 +11,7 @@ android:layout_height="wrap_content" android:textSize="16sp" android:layout_marginEnd="8dp" + android:text="Placeholder Title" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -19,6 +20,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:textSize="14sp" + android:text="Placeholder Description" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/debug_menu_item_title" /> From 65d48d03fdba414ad3080c9bc51124bac10a9593 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, 19 Jan 2024 18:23:08 +0900 Subject: [PATCH 19/25] =?UTF-8?q?=E4=BE=9D=E5=AD=98=E9=96=A2=E4=BF=82?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/home/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/home/build.gradle b/feature/home/build.gradle index e3aa10e0..71b997d1 100644 --- a/feature/home/build.gradle +++ b/feature/home/build.gradle @@ -55,4 +55,6 @@ dependencies { implementation project(':model') implementation "androidx.recyclerview:recyclerview:1.3.2" + + implementation project(':component:common') } \ No newline at end of file From 209eab07554ae3ef9abdf9636e075bb03f606d8c 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, 19 Jan 2024 18:28:26 +0900 Subject: [PATCH 20/25] =?UTF-8?q?ListItemAdapter=E5=AE=9F=E8=A3=85=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/feature/home/ListItemAdapter.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java new file mode 100644 index 00000000..2a5547ea --- /dev/null +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java @@ -0,0 +1,59 @@ +package one.nem.lacerta.feature.home; + +import android.media.Image; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; + +import one.nem.lacerta.model.ListItem; + +public class ListItemAdapter extends RecyclerView.Adapter{ + + ArrayList listItems; + + public ListItemAdapter(ArrayList listItems){ + this.listItems = listItems; + } + + @NonNull + @Override + public ListItemAdapter.ListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(one.nem.lacerta.component.common.R.layout.common_library_list_item, parent, false); + return new ListItemViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ListItemAdapter.ListItemViewHolder holder, int position) { + ListItem listItem = listItems.get(position); + holder.icon.setImageResource(listItem.getItemType().getIconId()); + holder.icon.setColorFilter(one.nem.lacerta.shared.ui.R.color.colorOnBackground); + holder.title.setText(listItem.getTitle()); + holder.description.setText(listItem.getDescription()); + } + + @Override + public int getItemCount() { + return 0; + } + + public static class ListItemViewHolder extends RecyclerView.ViewHolder{ + + ImageView icon; + TextView title; + TextView description; + public ListItemViewHolder(@NonNull View itemView) { + super(itemView); + + icon = itemView.findViewById(one.nem.lacerta.component.common.R.id.item_icon); + title = itemView.findViewById(one.nem.lacerta.component.common.R.id.item_title); + description = itemView.findViewById(one.nem.lacerta.component.common.R.id.item_description); + } + } +} From 704c12880114b6f858e52f8988f7a7de2404c8c1 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, 19 Jan 2024 18:43:22 +0900 Subject: [PATCH 21/25] =?UTF-8?q?=E3=81=84=E3=82=8D=E3=81=84=E3=82=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/feature/home/HomeTopFragment.java | 22 +++++++--------- .../src/main/res/layout/fragment_home_top.xml | 26 +++---------------- 2 files changed, 14 insertions(+), 34 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 ff6c5ca5..e1d3657f 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 @@ -93,19 +93,17 @@ public class HomeTopFragment extends Fragment { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_home_top, container, false); -// List metas = document.getAllDocumentMetas(100); + ArrayList recentDocument = lacertaLibrary.getRecentDocument(10); -// ArrayList listItems = lacertaLibrary.getRecentDocument(100); -// -// Log.d("docs", Integer.toString(listItems.size())); -// -// RecyclerView recyclerView = view.findViewById(R.id.item_recycler_view); -// -// recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); -// -// MyAdapter myAdapter = new MyAdapter(listItems); -// -// recyclerView.setAdapter(myAdapter); + Log.d("docs", Integer.toString(recentDocument.size())); + + RecyclerView recyclerView = view.findViewById(R.id.home_item_recycler_view); + + recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + + ListItemAdapter listItemAdapter = new ListItemAdapter(recentDocument); + + recyclerView.setAdapter(listItemAdapter); return view; diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index fb74430d..cfc2b1f8 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -14,7 +14,7 @@ - - - - - - - - - + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> From 038c526652590582720880769676bc91b612379c 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, 19 Jan 2024 18:43:26 +0900 Subject: [PATCH 22/25] =?UTF-8?q?=E3=81=84=E3=82=8D=E3=81=84=E3=82=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/src/main/res/layout/common_library_list_item.xml | 3 ++- .../java/one/nem/lacerta/feature/home/ListItemAdapter.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/component/common/src/main/res/layout/common_library_list_item.xml b/component/common/src/main/res/layout/common_library_list_item.xml index 5be7db02..d2bc476b 100644 --- a/component/common/src/main/res/layout/common_library_list_item.xml +++ b/component/common/src/main/res/layout/common_library_list_item.xml @@ -14,7 +14,8 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/item_text_container" - app:srcCompat="@drawable/description_24px" /> + app:srcCompat="@drawable/description_24px" + android:contentDescription="icon" /> Date: Fri, 19 Jan 2024 18:46:06 +0900 Subject: [PATCH 23/25] =?UTF-8?q?=E8=89=B2=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/src/main/res/layout/common_library_list_item.xml | 2 ++ .../main/java/one/nem/lacerta/feature/home/ListItemAdapter.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/component/common/src/main/res/layout/common_library_list_item.xml b/component/common/src/main/res/layout/common_library_list_item.xml index d2bc476b..2a9850e5 100644 --- a/component/common/src/main/res/layout/common_library_list_item.xml +++ b/component/common/src/main/res/layout/common_library_list_item.xml @@ -32,6 +32,7 @@ android:textSize="16sp" android:layout_marginEnd="8dp" android:text="Placeholder Title" + android:textColor="@color/colorOnSurface" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -41,6 +42,7 @@ android:layout_height="wrap_content" android:textSize="14sp" android:text="Placeholder Description" + android:textColor="@color/colorOnSurface" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/item_title" /> diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java index 3f3302f6..03f4a8d7 100644 --- a/feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/ListItemAdapter.java @@ -33,7 +33,7 @@ public class ListItemAdapter extends RecyclerView.Adapter Date: Fri, 19 Jan 2024 20:09:26 +0900 Subject: [PATCH 24/25] =?UTF-8?q?=E3=81=AA=E3=82=93=E3=81=8B=E3=82=82?= =?UTF-8?q?=E3=81=86=E5=85=A8=E9=83=A8=E5=A4=89=E3=81=88=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/MainActivity.java | 5 ++++- app/src/main/res/layout/activity_main.xml | 5 +++++ .../lacerta/feature/home/HomeTopFragment.java | 20 +++++++++++++++++++ .../src/main/res/layout/fragment_home_top.xml | 6 +++++- .../src/main/res/values-night-v27/themes.xml | 1 + .../src/main/res/values-night-v31/colors.xml | 3 +++ .../main/res/values-notnight-v31/colors.xml | 3 +++ shared/ui/src/main/res/values-v27/themes.xml | 1 + shared/ui/src/main/res/values/colors.xml | 2 ++ shared/ui/src/main/res/values/global.xml | 6 ++++++ shared/ui/src/main/res/values/themes.xml | 2 -- 11 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 shared/ui/src/main/res/values/global.xml diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index f1fa4676..6dec2e80 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -45,6 +45,9 @@ public class MainActivity extends AppCompatActivity { } // Set navigation bar color - getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurfaceVariant)); + getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); + + // Set status bar color + getWindow().setStatusBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurface)); } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 2117b2e1..3305b5e2 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -24,6 +24,11 @@ android:id="@+id/bottom_nav" android:layout_width="0dp" android:layout_height="wrap_content" + android:background="@color/colorSecondaryContainer" + app:itemIconTint="@color/colorOnSecondaryContainer" + app:itemTextColor="@color/colorOnSecondaryContainer" + app:itemActiveIndicatorStyle="@style/Lacerta.Custom.Indicator" + app:labelVisibilityMode="selected" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" 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 e1d3657f..257916f1 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 @@ -12,11 +12,13 @@ import android.view.ViewGroup; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import java.util.ArrayList; @@ -121,6 +123,24 @@ public class HomeTopFragment extends Fragment { // Set the title of the CollapsingToolbarLayout collapsingToolbarLayout.setTitle("Lacerta"); + + 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(getActivity(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer)); + } else if (verticalOffset == 0) { + // Expanded + getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getActivity(), one.nem.lacerta.shared.ui.R.color.colorSurface)); + } else { + // Somewhere in between + // Here you can add a color transition if you want + } + } + }); + } String pageTitle; diff --git a/feature/home/src/main/res/layout/fragment_home_top.xml b/feature/home/src/main/res/layout/fragment_home_top.xml index cfc2b1f8..3fc0b723 100644 --- a/feature/home/src/main/res/layout/fragment_home_top.xml +++ b/feature/home/src/main/res/layout/fragment_home_top.xml @@ -1,18 +1,22 @@ + android:layout_height="match_parent" + android:background="@color/colorSurface"> @color/colorOnBackground false + false \ No newline at end of file diff --git a/shared/ui/src/main/res/values-night-v31/colors.xml b/shared/ui/src/main/res/values-night-v31/colors.xml index dfde2504..be984e38 100644 --- a/shared/ui/src/main/res/values-night-v31/colors.xml +++ b/shared/ui/src/main/res/values-night-v31/colors.xml @@ -25,4 +25,7 @@ @color/material_dynamic_neutral_variant90 @color/material_dynamic_neutral_variant30 @color/material_dynamic_neutral20 + + + @color/material_dynamic_secondary70 \ No newline at end of file diff --git a/shared/ui/src/main/res/values-notnight-v31/colors.xml b/shared/ui/src/main/res/values-notnight-v31/colors.xml index b09c84ac..cea43c34 100644 --- a/shared/ui/src/main/res/values-notnight-v31/colors.xml +++ b/shared/ui/src/main/res/values-notnight-v31/colors.xml @@ -24,4 +24,7 @@ @color/material_dynamic_neutral_variant90 @color/material_dynamic_neutral_variant30 @color/material_dynamic_neutral20 + + + @color/material_dynamic_secondary80 \ No newline at end of file diff --git a/shared/ui/src/main/res/values-v27/themes.xml b/shared/ui/src/main/res/values-v27/themes.xml index f7a979fc..da3c7be3 100644 --- a/shared/ui/src/main/res/values-v27/themes.xml +++ b/shared/ui/src/main/res/values-v27/themes.xml @@ -30,6 +30,7 @@ @color/colorOnBackground true + true \ No newline at end of file diff --git a/shared/ui/src/main/res/values/colors.xml b/shared/ui/src/main/res/values/colors.xml index 2f286f0e..a32e6b1e 100644 --- a/shared/ui/src/main/res/values/colors.xml +++ b/shared/ui/src/main/res/values/colors.xml @@ -25,4 +25,6 @@ #31312B #F3F1E8 #B8D321 + + #d2d4bc \ No newline at end of file diff --git a/shared/ui/src/main/res/values/global.xml b/shared/ui/src/main/res/values/global.xml new file mode 100644 index 00000000..49a2e771 --- /dev/null +++ b/shared/ui/src/main/res/values/global.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/shared/ui/src/main/res/values/themes.xml b/shared/ui/src/main/res/values/themes.xml index 68fccb6e..9c4f8521 100644 --- a/shared/ui/src/main/res/values/themes.xml +++ b/shared/ui/src/main/res/values/themes.xml @@ -28,8 +28,6 @@ @color/colorOutline @color/colorOnBackground - true -