From 548f1edd4c21feedff756c2da5d8707405c40588 Mon Sep 17 00:00:00 2001 From: Andre <230421@epvc.pt> Date: Tue, 17 Mar 2026 10:24:41 +0000 Subject: [PATCH] tabela --- .../vdcscore/ui/home/HomeFragment.java | 2 +- .../vdcscore/ui/home/StandingsAdapter.java | 11 ++++ .../com/example/vdcscore/ui/home/Team.java | 62 ++++++++++++++++--- 3 files changed, 67 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java b/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java index 0302c59..9503b6b 100644 --- a/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java +++ b/app/src/main/java/com/example/vdcscore/ui/home/HomeFragment.java @@ -61,7 +61,7 @@ public class HomeFragment extends Fragment { } private void fetchStandings() { - mDatabase = FirebaseDatabase.getInstance().getReference("standings").child(currentEscalao); + mDatabase = FirebaseDatabase.getInstance().getReference("classificacoes").child(currentEscalao); // Remove previous listener to avoid duplicate data or leaks if (mValueEventListener != null) { diff --git a/app/src/main/java/com/example/vdcscore/ui/home/StandingsAdapter.java b/app/src/main/java/com/example/vdcscore/ui/home/StandingsAdapter.java index 287f797..bbb9f98 100644 --- a/app/src/main/java/com/example/vdcscore/ui/home/StandingsAdapter.java +++ b/app/src/main/java/com/example/vdcscore/ui/home/StandingsAdapter.java @@ -56,6 +56,17 @@ public class StandingsAdapter extends RecyclerView.Adapter 0) { + return (points - drawn) / 3; + } return won; } + @PropertyName("vitorias") public void setWon(int won) { this.won = won; } + @PropertyName("empates") public int getDrawn() { return drawn; } + @PropertyName("empates") public void setDrawn(int drawn) { this.drawn = drawn; } + @PropertyName("derrotas") public int getLost() { return lost; } + @PropertyName("derrotas") public void setLost(int lost) { this.lost = lost; } + @PropertyName("golos_marcados") public int getGoalsFor() { return goalsFor; } + @PropertyName("golos_marcados") public void setGoalsFor(int goalsFor) { this.goalsFor = goalsFor; } + @PropertyName("golos_sofridos") public int getGoalsAgainst() { return goalsAgainst; } + @PropertyName("golos_sofridos") public void setGoalsAgainst(int goalsAgainst) { this.goalsAgainst = goalsAgainst; } + @PropertyName("diferenca_golos") public int getGoalDifference() { return goalDifference; } + @PropertyName("diferenca_golos") public void setGoalDifference(int goalDifference) { this.goalDifference = goalDifference; } + + @PropertyName("imagem") + public String getImageUrl() { + return imageUrl; + } + + @PropertyName("imagem") + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } }