mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
commit
84d77ec7da
@ -38,6 +38,8 @@ import com.github.libretube.util.LocaleHelper
|
|||||||
import com.github.libretube.util.RetrofitInstance
|
import com.github.libretube.util.RetrofitInstance
|
||||||
import com.github.libretube.util.ThemeHelper
|
import com.github.libretube.util.ThemeHelper
|
||||||
import com.google.android.material.color.DynamicColors
|
import com.google.android.material.color.DynamicColors
|
||||||
|
import com.google.android.material.color.MaterialColors
|
||||||
|
import com.google.android.material.elevation.SurfaceColors
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
val TAG = "MainActivity"
|
val TAG = "MainActivity"
|
||||||
@ -99,6 +101,12 @@ class MainActivity : AppCompatActivity() {
|
|||||||
navController = findNavController(R.id.fragment)
|
navController = findNavController(R.id.fragment)
|
||||||
binding.bottomNav.setupWithNavController(navController)
|
binding.bottomNav.setupWithNavController(navController)
|
||||||
|
|
||||||
|
// 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
|
||||||
|
window.navigationBarColor = color
|
||||||
|
|
||||||
// hide the trending page if enabled
|
// hide the trending page if enabled
|
||||||
val hideTrendingPage = PreferenceHelper.getBoolean(this, "hide_trending_page", false)
|
val hideTrendingPage = PreferenceHelper.getBoolean(this, "hide_trending_page", false)
|
||||||
if (hideTrendingPage) binding.bottomNav.menu.findItem(R.id.homeFragment).isVisible =
|
if (hideTrendingPage) binding.bottomNav.menu.findItem(R.id.homeFragment).isVisible =
|
||||||
|
Loading…
Reference in New Issue
Block a user