firebaseui

How to implement Firebase Recycler Adapter in newer version of Android 3.1 and higher?

大兔子大兔子 提交于 2019-11-28 01:27:08
问题 Basically, what I am trying to do is use a FirebaseRecyclerAdapter and populate the RecyclerView with my custom designed CardView . The code for newer versions has been changed and therefore, I tried implementing it but didn't work. This is the code I use to write a year ago, which worked fine and populated my RecyclerView : FirebaseRecyclerAdapter<DataClass,DataViewHolder> FBRA= new FirebaseRecyclerAdapter<DataClass, DataViewHolder>( DataClass, R.layout.myCardView, DataViewHolder.class,

How to use Firebase List adapter

我怕爱的太早我们不能终老 提交于 2019-11-28 00:38:31
问题 I'm trying to follow with this tutorial: https://www.youtube.com/watch?v=2J6spwAVP0M but implementing it on my complex app just didn't work so I tried from scratch.. I created this simple MainActivity: public class MainActivity extends AppCompatActivity{ Firebase mRef; com.firebase.ui.FirebaseListAdapter<String> myAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRef = new Firebase("https://

Using Firebase Storage image with Glide

五迷三道 提交于 2019-11-27 23:52:41
There are tons of duplicated answers I had tried almost all of them but I am still not able to use Firebase storage image with Glide. First of all I am using docs FirebaseStorage storage = FirebaseStorage.getInstance(); StorageReference storageRef = storage.getReference(); StorageReference pathReference = storageRef.child("sorular/1.jpg"); // ImageView in your Activity ImageView imageView = rootView.findViewById(R.id.imageView); // Load the image using Glide Glide.with(this /* context */) .using(new FirebaseImageLoader()) // Cannot resolve method 'using .load(pathReference) .into(imageView);

FirebaseRecyclerAdapter with empty view

五迷三道 提交于 2019-11-27 10:10:38
问题 I know there are lot of ways to have an empty view for a RecyclerView. But my question is for FirebaseRecyclerView. My layout is: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/feed_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" /> <ProgressBar android:id="@+id/feed

How to set addSnapshotListener and remove in populateViewHolder in RecyclerView Item?

与世无争的帅哥 提交于 2019-11-27 09:38:02
I have implemented RecyclerView with FirebaseUI-Android library . My RecyclerView realtime data change well once i use that FirebaseRecyclerAdapter In Collection that data document have field type as Boolean , Integer, Reference . I want use that Reference to get data in populateViewHolder with addSnapshotListener . Help me! Here is my code: FirebaseRecyclerAdapter<Conv, ConvViewHolder> firebaseConvAdapter = new FirebaseRecyclerAdapter<Conv, ConvViewHolder>( Conv.class, R.layout.users_single_layout, ConvViewHolder.class, conversationQuery ) { @Override protected void populateViewHolder(final

Efficiency of searching using whereArrayContains

旧城冷巷雨未停 提交于 2019-11-27 09:33:27
I am curious as to the efficiency of searching for documents in a collection using this code. As the number of documents in the collection grows and the number of items in the array grows will this search become very inefficient? Is there a better way of doing this or is there a schema change I can make to the database to better optimize this? Is there somewhere I can find the time complexity of these functions for the firestore documentation maybe? Query query = db.collection("groups").whereArrayContains("members", userid); ALTERNATIVE SOLUTION I originally wanted to try storing the group ids

How to get obj key from FirebaseListAdapter on Item Click. FirebaseUI

亡梦爱人 提交于 2019-11-27 08:44:16
When subclassing FirebaseListAdapter in FirebaseUI how can one get the obj key of the item clicked? FirebaseListAdapter has the following method which gets itemId, but returns long. But I require the object key which is in the default string format. public long getItemId(int i) { return (long)this.mSnapshots.getItem(i).getKey().hashCode(); } The FirebaseListAdapter assumes that you always know the index/position of the item you are interacting with. Given the Android context this makes sense, since collection views are index based. Once you know the position, you can call adapter.getRef

How reverse the data fetched with FirebaseUI-Android?

醉酒当歌 提交于 2019-11-27 08:14:43
问题 I try to use the FirebaseUI-Android lib to simply display a data set in a recycler-view. Data are store in Firebase in a list, thanks to push() method. When I get the data, I got the oldest data first, and my requirement is the youngest first. So I need a reverse order. Is there a way to do that with FirebaseUI itself? With Firebase Core, it seems the 2 only possible ways are (from Display posts in descending posted order) : getting all the data, and revert them at runtime (in Force), thanks

FirebaseRecyclerAdapter - populateViewHolder is not populating the data for first time it runs?

我们两清 提交于 2019-11-27 08:06:14
问题 FirebaseRecyclerAdapter - populateViewHolder is not populating the data for the first time it runs but when I closed the app and opened it, the data is binded in RecyclerView View Holder. I am not getting why data is not populating for first time, it is showing blank screen Here's my MainActivity mDatabase = FirebaseDatabase.getInstance().getReference(); // [END create_database_reference] mRecycler = (RecyclerView) findViewById(R.id.recycler_view); mRecycler.setHasFixedSize(true);

populateViewHolder not executing with FirebaseRecyclerAdapter (Android)

£可爱£侵袭症+ 提交于 2019-11-27 06:55:39
问题 I'm trying to use a FirebaseRecyclerAdapter to populate a RecyclerView in a fragment, with data from my Firebase database. My main problem is that the populateViewHolder method is never called, so I got nothing displaying in the RecyclerView . I followed the steps from the Firebase UI documentation : https://github.com/firebase/FirebaseUI-Android/blob/master/database/README.md The rules on my Firebase database : { "rules": { ".read": "true", ".write": "true" } } In my gradle , I've added this