首页 > 解决方案 > 如何在我的项目中使用 FirestorePagingAdapter 和选项?

问题描述

我正在尝试开始,FirestorePagingAdapter 并且FirestorePagingOptions 像这里一样仔细阅读了文档

https://github.com/firebase/FirebaseUI-Android/tree/master/firestore

并一步一步应用

1- implementation 'android.arch.paging:runtime:1.x.x'

2-Query baseQuery = mItemsCollection.orderBy("value", Query.Direction.ASCENDING);

但是当我尝试添加FirestorePagingOptions它时,它会出现在红线代码中,这意味着它没有很好地导入或实现,并且我没有使用任何 android 架构模型。经过大量搜索,我发现没有什么清楚的那么什么是正确的开始方式FirestorePagingAdapter ?我应该从什么开始?这是我的实现

  implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.google.firebase:firebase-core:16.0.3'
    //google sign inj
    implementation 'com.google.android.gms:play-services-auth:15.0.0'
    implementation 'com.google.firebase:firebase-firestore:15.0.0'
    implementation 'com.google.firebase:firebase-auth:15.0.0'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.firebase:firebase-messaging:17.3.0'
    implementation 'com.google.firebase:firebase-storage:15.0.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.firebaseui:firebase-ui-firestore:3.3.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    //FIREBASE UI LIBRARY
    implementation 'android.arch.lifecycle:runtime:1.1.1'
    implementation 'android.arch.lifecycle:extensions:1.1.1'

    implementation 'android.arch.paging:runtime:1.0.1'
    implementation 'android.arch.core:runtime:1.1.1'
    implementation 'android.arch.core:common:1.1.1'
    implementation 'android.arch.lifecycle:common-java8:1.1.1'

标签: androidfirebasefirebaseui

解决方案


可能现在回答已经太晚了。当我遇到完全相同的问题时,我到达了这个页面。
添加implementation 'com.firebaseui:firebase-ui-firestore:4.3.2'到 gradle 依赖项解决了这个问题。


推荐阅读