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] 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