-
Notifications
You must be signed in to change notification settings - Fork 1.9k
This change allows easy detection of the list being empty *and* respo… #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
83cbc3c
41cafd6
71b81f6
21d5d44
deb25cb
33253cb
f715502
e2cc00c
a2cafb9
e35c7d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ public abstract class FirebaseRecyclerAdapter<T, VH extends RecyclerView.ViewHol | |
|
||
mSnapshots.setOnChangedListener(new FirebaseArray.OnChangedListener() { | ||
@Override | ||
public void onChanged(EventType type, int index, int oldIndex) { | ||
public void onChildChanged(EventType type, int index, int oldIndex) { | ||
switch (type) { | ||
case ADDED: | ||
notifyItemInserted(index); | ||
|
@@ -114,9 +114,25 @@ public void onChanged(EventType type, int index, int oldIndex) { | |
public void onCancelled(DatabaseError databaseError) { | ||
FirebaseRecyclerAdapter.this.onCancelled(databaseError); | ||
} | ||
|
||
@Override | ||
public void onDataChanged() { | ||
FirebaseRecyclerAdapter.this.onDataChanged(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't we want to unify these names and pick either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I wasn't sure. In the context of We could consider renaming There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should go for the second option (with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, might as well change the signature now while it's still private and get the name you actually want. |
||
} | ||
}); | ||
} | ||
|
||
/* This method will be triggered each time updates from the database have been completely processed. | ||
* So the first time this method is called, the initial data has been loaded - including the case | ||
* when no data at all is available. Each next time the method is called, a complete update (potentially | ||
* consisting of updates to multiple child items) has been completed. | ||
* <p> | ||
* You would typically override this method to hide a loading indicator (after the initial load) or | ||
* to complete a batch update to a UI element. | ||
*/ | ||
protected void onDataChanged() { | ||
} | ||
|
||
/** | ||
* @param modelClass Firebase will marshall the data at a location into | ||
* an instance of a class that you provide | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@puf looks like the merge didn't work (
mChatRef
got split into a nonexistentmRef
for some reason).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I split into two refs and apparently forgot to initialize one when resolving the conflict. It was my first time using the web conflict resolution editor and I must've borked something. I'll fix it tomorrow back at my desktop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool! I haven't been able to try that out yet. Github just needs to add checks to make sure your code compiles 😄 (oh, and why not add Intellij while we're at it and just write all of your code for you! 😄)