From 30661e1a2bc5f590fa18053db36bc7216b692850 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:08:41 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AE=9F=E8=A3=85=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/MainActivity.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index f1fa4676..f415c390 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -1,7 +1,10 @@ package one.nem.lacerta; +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.FragmentManager; import androidx.navigation.NavController; import androidx.navigation.fragment.NavHostFragment; @@ -46,5 +49,17 @@ public class MainActivity extends AppCompatActivity { // Set navigation bar color getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurfaceVariant)); + + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + DrawerLayout drawer = findViewById(R.id.drawer_layout); + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( + this, 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 app name in the middle of the toolbar + getSupportActionBar().setTitle("App Name"); } }