diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index d1cd2dea4..604c8c273 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -19,6 +19,7 @@ import io.legado.app.help.AppConfig import io.legado.app.help.BookHelp import io.legado.app.help.storage.Backup import io.legado.app.lib.theme.ATH +import io.legado.app.lib.theme.elevation import io.legado.app.service.BaseReadAloudService import io.legado.app.ui.main.bookshelf.BookshelfFragment import io.legado.app.ui.main.explore.ExploreFragment @@ -47,6 +48,8 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), view_pager_main.offscreenPageLimit = 3 view_pager_main.adapter = TabFragmentPageAdapter(supportFragmentManager) view_pager_main.addOnPageChangeListener(this) + bottom_navigation_view.elevation = + if (AppConfig.elevation < 0) elevation else AppConfig.elevation.toFloat() bottom_navigation_view.setOnNavigationItemSelectedListener(this) bottom_navigation_view.setOnNavigationItemReselectedListener(this) bottom_navigation_view.menu.findItem(R.id.menu_rss).isVisible = AppConfig.isShowRSS diff --git a/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt b/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt index 4bef4c53d..7cba90778 100644 --- a/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt @@ -9,9 +9,9 @@ import androidx.annotation.MenuRes import androidx.annotation.StringRes import androidx.appcompat.widget.PopupMenu import io.legado.app.R +import io.legado.app.help.AppConfig import io.legado.app.lib.theme.* import io.legado.app.utils.ColorUtils -import io.legado.app.utils.dp import io.legado.app.utils.visible import kotlinx.android.synthetic.main.view_select_action_bar.view.* import org.jetbrains.anko.sdk27.listeners.onClick @@ -22,7 +22,8 @@ class SelectActionBar(context: Context, attrs: AttributeSet?) : FrameLayout(cont init { setBackgroundColor(context.bottomBackground) - elevation = 10.dp.toFloat() + elevation = + if (AppConfig.elevation < 0) context.elevation else AppConfig.elevation.toFloat() View.inflate(context, R.layout.view_select_action_bar, this) val textIsDark = ColorUtils.isColorLight(context.bottomBackground) val primaryTextColor = context.getPrimaryTextColor(textIsDark) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index abd62d1d7..107f32f54 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -4,21 +4,20 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + - - \ No newline at end of file