From 525b636bb54055e1d3e336f268ac73b1ee557b99 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 8 Jul 2022 16:42:55 +0200 Subject: [PATCH 1/2] navigation bar color --- .../java/com/github/libretube/activities/MainActivity.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/com/github/libretube/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/activities/MainActivity.kt index 891cff62a..6a3810a6c 100644 --- a/app/src/main/java/com/github/libretube/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/MainActivity.kt @@ -38,6 +38,8 @@ import com.github.libretube.util.LocaleHelper import com.github.libretube.util.RetrofitInstance import com.github.libretube.util.ThemeHelper import com.google.android.material.color.DynamicColors +import com.google.android.material.color.MaterialColors +import com.google.android.material.elevation.SurfaceColors class MainActivity : AppCompatActivity() { val TAG = "MainActivity" @@ -98,6 +100,12 @@ class MainActivity : AppCompatActivity() { navController = findNavController(R.id.fragment) binding.bottomNav.setupWithNavController(navController) + + // gets the surface color for a elevation of 20dp + val color = SurfaceColors.getColorForElevation(this, 10F) + + // sets the navigation bar color to the previously calculated color + window.navigationBarColor = color // hide the trending page if enabled val hideTrendingPage = PreferenceHelper.getBoolean(this, "hide_trending_page", false) From dbea7652ee82443df9987177e71f05775d54031f Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 8 Jul 2022 16:43:32 +0200 Subject: [PATCH 2/2] . --- .../main/java/com/github/libretube/activities/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/activities/MainActivity.kt index 6a3810a6c..92f720ba5 100644 --- a/app/src/main/java/com/github/libretube/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/activities/MainActivity.kt @@ -101,7 +101,7 @@ class MainActivity : AppCompatActivity() { navController = findNavController(R.id.fragment) binding.bottomNav.setupWithNavController(navController) - // gets the surface color for a elevation of 20dp + // gets the surface color of the bottom navigation view val color = SurfaceColors.getColorForElevation(this, 10F) // sets the navigation bar color to the previously calculated color