DrawerLayout:不是 android.jar 的一部分?

DrawerLayout: Not part of android.jar?

通过使用 Android 支持库中的 DrawerLayout(通过使用 android.support.v4.widget.DrawerLayout),我们正在 Android 应用程序中实现导航抽屉功能。

但这是 ONLY 应用需要 android.support.v4 的东西。

未来是否存在一种方法或路线图,其中 DrawerLayout 成为 android.jar 的一部分(就像现在从支持库迁移到 android.jar 的 Fragment)?

这样开发人员就不需要添加一个库(android.support.v4)只是为了使用其中的 1 widget/class!

此外,目前有没有办法继续使用 DrawerLayout 而无需添加 android.support.v4
应用不需要使用其他导航模式,例如 Toolbar 或 ViewPager。

使用 large amount of functionality being unique to support-v4, most of the components in that library will remain there long term as it allows continual bug fixes and evolving of those components to meet the latest design and functionality specs without leaving broken versions in older versions of the framework. If you are using ProGuard(直接或通过 gradle minifyEnabled 行),您不使用的部分支持库将从您的应用程序中完全删除。

当然,您当然可以从库中提取 DrawerLayout 并将其嵌入到您的应用程序中:如果您认为有必要,source 随时可用。