Skip to content

FirebaseArray in FirebaseListAdapter is not accessible from subclasses #206

Closed
@davideno

Description

@davideno

Situation

You have a mobile app with Firebase as backend
you would like to view all the items in firebase location as cards in UI
you would like to remove some items just from the UI
(imagine a UI like Tinder app where a user can remove a card from UI and see the other cards in the list, where cards are items in Firebase db but they are not deleted when removed from UI)

Problem with FirebaseListAdapter

I use the FirebaseListAdapter as explained in the tutorial and I can easily retrieve the items from firebase and display them in the UI.
I don't know how to remove items from UI without removing it from Firebase too. The code below remove items from the Adapter but also from firebase.

Firebase itemRef = adapter.getRef(position);
itemRef.removeValue();

I think the only way to remove items from the adpater without removing the firebase reference is to have access to the FirebaseArray used in the FirebaseListAdapter.

Proposed solution ?
Have the FirebaseArray protected so that when implementing our CustomAdapter we can have access to the FirebaseArray and remove items from it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions