bilibili / MagicaSakura

MagicaSakura 是 Android 多主题框架。~ is an Android multi theme library which supporting both daily colorful theme and night theme.
http://app.bilibili.com
Apache License 2.0
3.55k stars 468 forks source link

请问我如果使用google原生的BottomNavigationView来当做底部的导航,可以让导航栏选中切换成当前的主题色吗? #51

Closed SkyHots closed 6 years ago

SkyHots commented 6 years ago

下面是我的布局代码,也就是谷歌原生的底部导航


<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/window_background"
    tools:context=".ui.main.MainActivity">

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/navigation"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_alignParentBottom="true"
        android:background="?android:attr/windowBackground"
        app:elevation="5dp"
        app:itemTextColor="@color/color_navigation_view"
        app:itemIconTint="@color/color_navigation_view"
        app:menu="@menu/navigation"/>

    <android.support.v4.view.ViewPager
        android:visibility="visible"
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/navigation"
        android:overScrollMode="never">
    </android.support.v4.view.ViewPager>

</RelativeLayout>
SkyHots commented 6 years ago

I got it,thank you.