Skip to content

Commit

Permalink
Residual commits
Browse files Browse the repository at this point in the history
  • Loading branch information
JapneetRajput committed May 1, 2022
1 parent e3d552d commit bee65fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions app/src/main/java/com/example/workflow/LeaveRequests.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ public void onCancelled(@NonNull DatabaseError error) {
adapterLeave = new AdapterLeave(this,list,listener);
db=FirebaseFirestore.getInstance();
recyclerView.setAdapter(adapterLeave);


}
private void EventChangeListener() {

Expand Down
34 changes: 17 additions & 17 deletions app/src/main/java/com/example/workflow/NoticeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,29 +317,29 @@ public void onFailure(@NonNull Exception e) {
private void EventChangeListener() {

db.collection("Notices")
.orderBy("count")
.addSnapshotListener(new EventListener<QuerySnapshot>() {
@Override
public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException error) {
if(error!=null){
.orderBy("count")
.addSnapshotListener(new EventListener<QuerySnapshot>() {
@Override
public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException error) {
if(error!=null){
if(progressDialog.isShowing())
progressDialog.dismiss();
Toast.makeText(NoticeActivity.this, "Snapshot error", Toast.LENGTH_SHORT).show();
}
else{
for(DocumentChange dc : value.getDocumentChanges()){

if(progressDialog.isShowing())
progressDialog.dismiss();
Toast.makeText(NoticeActivity.this, "Snapshot error", Toast.LENGTH_SHORT).show();
}
else{
for(DocumentChange dc : value.getDocumentChanges()){

if(progressDialog.isShowing())
progressDialog.dismiss();

if(dc.getType() == DocumentChange.Type.ADDED){
list.add(dc.getDocument().toObject(NoticeList.class));
}
adapterNotices.notifyDataSetChanged();
if(dc.getType() == DocumentChange.Type.ADDED){
list.add(dc.getDocument().toObject(NoticeList.class));
}
adapterNotices.notifyDataSetChanged();
}
}
});
}
});
}

@Override
Expand Down

0 comments on commit bee65fd

Please sign in to comment.