编程语言
首页 > 编程语言> > 关于Android系统源码中RecyclerView的一些疑惑

关于Android系统源码中RecyclerView的一些疑惑

作者:互联网

  平时gradle中使用RecyclerView都是implementation “com.android.support:recyclerview-v7:xxx”,相应的包名也是android.support.v7.widget.RecyclerView。如果是在系统源码中编译的的话,通过LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview或者LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview,在mk文件中引入RecyclerView。
  Android P源码时Android.bp代替了部分Android.mk,AndroidX代替了部分Android-Support,在Android M时,RecyclerView的源码路径为:/frameworks/support/v7/recyclerview/src/android/support/v7/widget,
m_RecyclerView而在Android P时为/frameworks/support/v7/recyclerview/src/main/java/androidx/recyclerview/widget,可以看出这时包名已经变成androidx了,但是自己开发的应用mk中引入的还是android-support-v7-recyclerview,是不是直觉出现问题呢?
p_RecyclerView
  在 Android P源码out目录中发现生成的RcylcerView JAR仍然是support,
这就更纳闷了,想起编译生成JAR于是grep -nr “LOCAL_MODULE := android-support-v7-recyclerview”,但是没有发现有用信息。认为可能存在多个v7目录,于是搜索了v7,果然发现端倪,于是找到了上层目录中的Android.bp文件,发现android-support-v7-recyclerview JAR的生成,但是这个具体对应的哪个RecyclerView待后续研究

android_library {
    name: "android-support-v7-recyclerview",
    sdk_version: "current",
    manifest: "manifests/android-support-v7-recyclerview/AndroidManifest.xml",
    static_libs: [
        "android-support-v7-recyclerview-nodeps",
        "android-support-annotations",
        "android-support-compat",
        "android-support-core-ui",
    ],
    java_version: "1.7",

标签:recyclerview,support,源码,v7,Android,RecyclerView,android
来源: https://blog.csdn.net/wangadping/article/details/115205669