From 2d44b20352c36ccad8efe0d2a06bd93172305bb7 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 9 Dec 2023 13:38:15 +0900 Subject: [PATCH] WIP --- .../main/java/one/nem/lacerta/MainActivity.java | 15 +++++++++++++++ app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/menu/bottom_nav_menu.xml | 9 +++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/menu/bottom_nav_menu.xml diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index 1e990f71..a37ab581 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -1,14 +1,29 @@ package one.nem.lacerta; import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentManager; +import androidx.navigation.NavController; +import androidx.navigation.fragment.NavHostFragment; +import androidx.navigation.ui.NavigationUI; import android.os.Bundle; +import com.google.android.material.bottomnavigation.BottomNavigationView; + public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + + // Debug + FragmentManager supportFragmentManager = getSupportFragmentManager(); + + NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment); + NavController navController = navHostFragment.getNavController(); + BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); + + NavigationUI.setupWithNavController(bottomNavigationView, navController); } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index c89e52b8..b57b8f9b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -15,7 +15,7 @@ app:layout_constraintStart_toStartOf="parent" /> + + + + + + \ No newline at end of file