Search in sources :

Example 1 with BrixxEventModel

use of com.manan.dev.ec2018app.Models.BrixxEventModel in project EC2018App by Manan-YMCA.

the class StandUpFragment method attachDatabaseListener.

private void attachDatabaseListener() {
    if (mChildEventListener == null) {
        mChildEventListener = new ChildEventListener() {

            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                if (dataSnapshot.getKey().equals("hassrath")) {
                    BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                    // Toast.makeText(mContext,dataSnapshot.getValue().toString(),Toast.LENGTH_SHORT).show();
                    updateUI(w);
                }
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String s) {
                try {
                    if (dataSnapshot.getKey().equals("hassrath")) {
                        BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                        updateUI(w);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String s) {
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
            }
        };
        mDatabaseReference.addChildEventListener(mChildEventListener);
    }
}
Also used : BrixxEventModel(com.manan.dev.ec2018app.Models.BrixxEventModel) DatabaseError(com.google.firebase.database.DatabaseError) DataSnapshot(com.google.firebase.database.DataSnapshot) ChildEventListener(com.google.firebase.database.ChildEventListener)

Example 2 with BrixxEventModel

use of com.manan.dev.ec2018app.Models.BrixxEventModel in project EC2018App by Manan-YMCA.

the class MrCulFragment method attachDatabaseListener.

private void attachDatabaseListener() {
    if (mChildEventListener == null) {
        mChildEventListener = new ChildEventListener() {

            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                if (dataSnapshot.getKey().equals("mrmsculmyca")) {
                    BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                    updateUI(w);
                }
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String s) {
                try {
                    if (dataSnapshot.getKey().equals("mrmsculmyca")) {
                        BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                        updateUI(w);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String s) {
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
            }
        };
        mDatabaseReference.addChildEventListener(mChildEventListener);
    }
}
Also used : BrixxEventModel(com.manan.dev.ec2018app.Models.BrixxEventModel) DatabaseError(com.google.firebase.database.DatabaseError) DataSnapshot(com.google.firebase.database.DataSnapshot) ChildEventListener(com.google.firebase.database.ChildEventListener)

Example 3 with BrixxEventModel

use of com.manan.dev.ec2018app.Models.BrixxEventModel in project EC2018App by Manan-YMCA.

the class RangritiFragment method attachDatabaseListener.

private void attachDatabaseListener() {
    if (mChildEventListener == null) {
        mChildEventListener = new ChildEventListener() {

            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                if (dataSnapshot.getKey().equals("rangriti")) {
                    BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                    updateUI(w);
                }
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String s) {
                try {
                    if (dataSnapshot.getKey().equals("rangriti")) {
                        BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                        updateUI(w);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String s) {
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
            }
        };
        mDatabaseReference.addChildEventListener(mChildEventListener);
    }
}
Also used : BrixxEventModel(com.manan.dev.ec2018app.Models.BrixxEventModel) DatabaseError(com.google.firebase.database.DatabaseError) DataSnapshot(com.google.firebase.database.DataSnapshot) ChildEventListener(com.google.firebase.database.ChildEventListener)

Example 4 with BrixxEventModel

use of com.manan.dev.ec2018app.Models.BrixxEventModel in project EC2018App by Manan-YMCA.

the class StarNightFragment method attachDatabaseListener.

private void attachDatabaseListener() {
    if (mChildEventListener == null) {
        mChildEventListener = new ChildEventListener() {

            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                if (dataSnapshot.getKey().equals("starnight")) {
                    BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                    updateUI(w);
                }
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String s) {
                try {
                    if (dataSnapshot.getKey().equals("starnight")) {
                        BrixxEventModel w = dataSnapshot.getValue(BrixxEventModel.class);
                        updateUI(w);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String s) {
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
            }
        };
        mDatabaseReference.addChildEventListener(mChildEventListener);
    }
}
Also used : BrixxEventModel(com.manan.dev.ec2018app.Models.BrixxEventModel) DatabaseError(com.google.firebase.database.DatabaseError) DataSnapshot(com.google.firebase.database.DataSnapshot) ChildEventListener(com.google.firebase.database.ChildEventListener)

Aggregations

ChildEventListener (com.google.firebase.database.ChildEventListener)4 DataSnapshot (com.google.firebase.database.DataSnapshot)4 DatabaseError (com.google.firebase.database.DatabaseError)4 BrixxEventModel (com.manan.dev.ec2018app.Models.BrixxEventModel)4