主要是参考了
https://github.com/dersoncheng/MultipleTheme 的方法,利用需要换肤的控件,改为自定义的控件,但是不知道为什么 NagavitionView 的 Item 的背景无法动态更换(重启后会变化)
反编译的 B 站的 APk(虽然只拿到 Res 文件夹),发现布局文件没有特别之处.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.NavigationView android:layout_gravity="start" android:id="@id/nav_view" android:background="?view_background" android:fitsSystemWindows="true" android:layout_width="fill_parent" android:layout_height="fill_parent" app:menu="@menu/drawer_items" app:headerLayout="@layout/bili_app_layout_main_navigation_header" style="@style/Widget.App.NavigationView" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" />
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://v2ex.ih06.com/t/232092
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.