This commit is contained in:
2026-03-17 15:36:54 +00:00
parent 1316a46231
commit 91fde336b3
3 changed files with 108 additions and 35 deletions

View File

@@ -4,6 +4,7 @@
<selectionStates> <selectionStates>
<SelectionState runConfigName="app"> <SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" /> <option name="selectionMode" value="DROPDOWN" />
<DialogSelection />
</SelectionState> </SelectionState>
</selectionStates> </selectionStates>
</component> </component>

View File

@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.example.vdcscore.R; import com.example.vdcscore.R;
import com.bumptech.glide.Glide;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -73,6 +74,16 @@ public class StandingsAdapter extends RecyclerView.Adapter<StandingsAdapter.View
holder.textLost.setText(String.valueOf(team.getLost())); holder.textLost.setText(String.valueOf(team.getLost()));
holder.textGoalDiff.setText(String.valueOf(team.getGoalDifference())); holder.textGoalDiff.setText(String.valueOf(team.getGoalDifference()));
holder.textPoints.setText(String.valueOf(team.getPoints())); holder.textPoints.setText(String.valueOf(team.getPoints()));
if (team.getImageUrl() != null && !team.getImageUrl().isEmpty()) {
Glide.with(holder.itemView.getContext())
.load(team.getImageUrl())
.placeholder(R.mipmap.ic_launcher)
.error(R.mipmap.ic_launcher)
.into(holder.imageLogo);
} else {
holder.imageLogo.setImageResource(R.mipmap.ic_launcher);
}
} }
@Override @Override

View File

@@ -1,45 +1,106 @@
package com.example.vdcscore.ui.home; package com.example.vdcscore.ui.home;
import com.google.firebase.database.Exclude;
import com.google.firebase.database.IgnoreExtraProperties;
@IgnoreExtraProperties
public class Team { public class Team {
@Exclude
private String id; private String id;
private String name;
// Nomes exatos dos nós na Base de Dados private int points;
public String nome; private int played;
public int pontos; private int won;
public int jogos; private int drawn;
public int empates; private int lost;
public int derrotas; private int goalsFor;
public int diferenca_golos; private int goalsAgainst;
public int golos_marcados; private int goalDifference;
public int golos_sofridos;
public String imagem;
public Team() { public Team() {
// Necessário pelo Firebase // Required empty constructor for Firebase
} }
// Apenas usados para consumo na UI, ignorados na leitura direta do Firebase public Team(String id, String name, int points, int played) {
@Exclude public String getId() { return id; } this.id = id;
@Exclude public void setId(String id) { this.id = id; } this.name = name;
this.points = points;
@Exclude public String getName() { return nome; } this.played = played;
@Exclude public int getPlayed() { return jogos; }
@Exclude public int getWon() {
if (pontos > 0) return (pontos - empates) / 3;
return 0;
} }
@Exclude public int getDrawn() { return empates; } // Getters and Setters
@Exclude public int getLost() { return derrotas; } public String getId() {
@Exclude public int getGoalDifference() { return diferenca_golos; } return id;
@Exclude public int getGoalsFor() { return golos_marcados; } }
@Exclude public int getGoalsAgainst() { return golos_sofridos; }
@Exclude public int getPoints() { return pontos; } public void setId(String id) {
@Exclude public String getImageUrl() { return imagem; } this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPoints() {
return points;
}
public void setPoints(int points) {
this.points = points;
}
public int getPlayed() {
return played;
}
public void setPlayed(int played) {
this.played = played;
}
public int getWon() {
return won;
}
public void setWon(int won) {
this.won = won;
}
public int getDrawn() {
return drawn;
}
public void setDrawn(int drawn) {
this.drawn = drawn;
}
public int getLost() {
return lost;
}
public void setLost(int lost) {
this.lost = lost;
}
public int getGoalsFor() {
return goalsFor;
}
public void setGoalsFor(int goalsFor) {
this.goalsFor = goalsFor;
}
public int getGoalsAgainst() {
return goalsAgainst;
}
public void setGoalsAgainst(int goalsAgainst) {
this.goalsAgainst = goalsAgainst;
}
public int getGoalDifference() {
return goalDifference;
}
public void setGoalDifference(int goalDifference) {
this.goalDifference = goalDifference;
}
} }