mais opcoes de ver estatisticas de clube
This commit is contained in:
@@ -19,6 +19,7 @@ import com.google.firebase.database.DatabaseError;
|
|||||||
import com.google.firebase.database.DatabaseReference;
|
import com.google.firebase.database.DatabaseReference;
|
||||||
import com.google.firebase.database.FirebaseDatabase;
|
import com.google.firebase.database.FirebaseDatabase;
|
||||||
import com.google.firebase.database.ValueEventListener;
|
import com.google.firebase.database.ValueEventListener;
|
||||||
|
import com.example.vdcscore.ui.home.Team;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
public class ClubDetailFragment extends Fragment {
|
public class ClubDetailFragment extends Fragment {
|
||||||
@@ -50,73 +51,129 @@ public class ClubDetailFragment extends Fragment {
|
|||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
if (getArguments() != null) {
|
if (getArguments() != null) {
|
||||||
Club clubeRecebido = (Club) getArguments().getSerializable("clube_selecionado");
|
Team statsTeam = (Team) getArguments().getSerializable("clube_selecionado_estatisticas");
|
||||||
|
|
||||||
if (clubeRecebido != null) {
|
if (statsTeam != null) {
|
||||||
// Preencher views diretamente
|
populateStats(statsTeam);
|
||||||
binding.textDetailClubName.setText(clubeRecebido.getName());
|
setupComparison(statsTeam);
|
||||||
binding.textDetailFoundation.setText(String.valueOf(clubeRecebido.getFoundationYear()));
|
} else {
|
||||||
binding.textDetailPresident.setText(clubeRecebido.getPresident());
|
Club clubeRecebido = (Club) getArguments().getSerializable("clube_selecionado");
|
||||||
binding.textDetailAddress.setText(clubeRecebido.getAddress());
|
if (clubeRecebido != null) {
|
||||||
|
populateClubInfo(clubeRecebido);
|
||||||
if (getContext() != null) {
|
|
||||||
Glide.with(this)
|
|
||||||
.load(clubeRecebido.getImageUrl())
|
|
||||||
.placeholder(R.mipmap.ic_launcher_round)
|
|
||||||
.error(R.mipmap.ic_launcher)
|
|
||||||
.into(binding.imageDetailLogo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configurar o botão para ver jogadores
|
|
||||||
binding.btnPlayers.setOnClickListener(v -> {
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
// Passar o 'clube_selecionado' também para a lista de jogadores se necessário,
|
|
||||||
// ou passar o ID como antes se o fragmento de jogadores esperar ID
|
|
||||||
bundle.putString("clubId", String.valueOf(clubeRecebido.getId()));
|
|
||||||
bundle.putString("escalao", escalao);
|
|
||||||
// Se o ClubPlayersFragment esperar "clube_selecionado" tambem, poderiamos
|
|
||||||
// passar:
|
|
||||||
// bundle.putSerializable("clube_selecionado", clubeRecebido);
|
|
||||||
|
|
||||||
Navigation.findNavController(view).navigate(R.id.action_nav_club_detail_to_nav_club_players,
|
|
||||||
bundle);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadClubDetails() {
|
private void populateStats(Team team) {
|
||||||
mDatabase.addListenerForSingleValueEvent(new ValueEventListener() {
|
binding.textDetailClubName.setText(team.getNome());
|
||||||
@Override
|
binding.textDetailPoints.setText(String.valueOf(team.getPontos()));
|
||||||
public void onDataChange(@NonNull DataSnapshot snapshot) {
|
binding.textDetailPlayed.setText(String.valueOf(team.getJogos()));
|
||||||
Club club = snapshot.getValue(Club.class);
|
binding.textDetailWon.setText(team.getVitorias() + "V");
|
||||||
if (club != null) {
|
binding.textDetailDrawn.setText(team.getEmpates() + "E");
|
||||||
binding.textDetailClubName.setText(club.getName());
|
binding.textDetailLost.setText(team.getDerrotas() + "D");
|
||||||
binding.textDetailFoundation.setText(String.valueOf(club.getFoundationYear()));
|
binding.textDetailGoals.setText(team.getGolos_marcados() + " - " + team.getGolos_sofridos());
|
||||||
binding.textDetailPresident.setText(club.getPresident());
|
binding.textDetailGoalDiff.setText((team.getDiferenca_golos() > 0 ? "+" : "") + team.getDiferenca_golos());
|
||||||
binding.textDetailAddress.setText(club.getAddress());
|
|
||||||
// binding.textDetailStadium.setText(club.getStadium()); // Hidden for now
|
// Posicao circle and text
|
||||||
|
binding.textDetailPosition.setText(team.getPosicao() > 0 ? team.getPosicao() + "º" : "---");
|
||||||
|
binding.textDetailPositionCircle.setText(String.valueOf(team.getPosicao() > 0 ? team.getPosicao() : "-"));
|
||||||
|
|
||||||
// binding.imageDetailLogo.setImageResource(R.mipmap.ic_launcher_round);
|
if (getContext() != null) {
|
||||||
if (getContext() != null) {
|
Glide.with(this)
|
||||||
Glide.with(ClubDetailFragment.this)
|
.load(team.getImagem())
|
||||||
.load(club.getImageUrl())
|
.placeholder(R.mipmap.ic_launcher_round)
|
||||||
.placeholder(R.mipmap.ic_launcher_round)
|
.error(R.mipmap.ic_launcher)
|
||||||
.error(R.mipmap.ic_launcher)
|
.into(binding.imageDetailLogo);
|
||||||
.into(binding.imageDetailLogo);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
// Button players
|
||||||
public void onCancelled(@NonNull DatabaseError error) {
|
binding.btnPlayers.setOnClickListener(v -> {
|
||||||
if (getContext() != null) {
|
Bundle bundle = new Bundle();
|
||||||
Toast.makeText(getContext(), "Failed to load club details.", Toast.LENGTH_SHORT).show();
|
bundle.putString("clubId", String.valueOf(team.getTeam_id()));
|
||||||
}
|
bundle.putString("escalao", escalao);
|
||||||
}
|
Navigation.findNavController(v).navigate(R.id.action_nav_club_detail_to_nav_club_players, bundle);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void populateClubInfo(Club club) {
|
||||||
|
binding.textDetailClubName.setText(club.getName());
|
||||||
|
// If coming from Clubs list, we don't have stats easily unless we fetch them or hide stats container.
|
||||||
|
// For now, hide stats if no statsTeam
|
||||||
|
binding.labelStats.setVisibility(View.GONE);
|
||||||
|
binding.containerStats.setVisibility(View.GONE);
|
||||||
|
binding.btnCompare.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (getContext() != null) {
|
||||||
|
Glide.with(this)
|
||||||
|
.load(club.getImageUrl())
|
||||||
|
.placeholder(R.mipmap.ic_launcher_round)
|
||||||
|
.error(R.mipmap.ic_launcher)
|
||||||
|
.into(binding.imageDetailLogo);
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.btnPlayers.setOnClickListener(v -> {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("clubId", String.valueOf(club.getId()));
|
||||||
|
bundle.putString("escalao", escalao);
|
||||||
|
Navigation.findNavController(v).navigate(R.id.action_nav_club_detail_to_nav_club_players, bundle);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupComparison(Team team1) {
|
||||||
|
binding.btnCompare.setOnClickListener(v -> {
|
||||||
|
// Fetch all teams of same escalao if not fetched
|
||||||
|
FirebaseDatabase.getInstance().getReference("classificacoes").child(escalao)
|
||||||
|
.addListenerForSingleValueEvent(new ValueEventListener() {
|
||||||
|
@Override
|
||||||
|
public void onDataChange(@NonNull DataSnapshot snapshot) {
|
||||||
|
java.util.List<Team> otherTeams = new java.util.ArrayList<>();
|
||||||
|
for (DataSnapshot postSnapshot : snapshot.getChildren()) {
|
||||||
|
Team t = postSnapshot.getValue(Team.class);
|
||||||
|
if (t != null && t.getTeam_id() != team1.getTeam_id()) {
|
||||||
|
otherTeams.add(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showComparisonDialog(team1, otherTeams);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancelled(@NonNull DatabaseError error) {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showComparisonDialog(Team team1, java.util.List<Team> otherTeams) {
|
||||||
|
String[] teamNames = new String[otherTeams.size()];
|
||||||
|
for (int i = 0; i < otherTeams.size(); i++) {
|
||||||
|
teamNames[i] = otherTeams.get(i).getNome();
|
||||||
|
}
|
||||||
|
|
||||||
|
new androidx.appcompat.app.AlertDialog.Builder(requireContext())
|
||||||
|
.setTitle("Selecionar Equipa para Comparar")
|
||||||
|
.setItems(teamNames, (dialog, which) -> {
|
||||||
|
Team team2 = otherTeams.get(which);
|
||||||
|
displayComparison(team1, team2);
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayComparison(Team t1, Team t2) {
|
||||||
|
binding.layoutComparison.setVisibility(View.VISIBLE);
|
||||||
|
binding.textCompareTeam1.setText(t1.getNome());
|
||||||
|
binding.textCompareTeam2.setText(t2.getNome());
|
||||||
|
|
||||||
|
binding.textCompareP1.setText(String.valueOf(t1.getPontos()));
|
||||||
|
binding.textCompareP2.setText(String.valueOf(t2.getPontos()));
|
||||||
|
|
||||||
|
binding.textCompareG1.setText(String.valueOf(t1.getGolos_marcados()));
|
||||||
|
binding.textCompareG2.setText(String.valueOf(t2.getGolos_marcados()));
|
||||||
|
|
||||||
|
// Highlight advantage
|
||||||
|
binding.textCompareP1.setTextColor(t1.getPontos() >= t2.getPontos() ? android.graphics.Color.GREEN : android.graphics.Color.RED);
|
||||||
|
binding.textCompareP2.setTextColor(t2.getPontos() >= t1.getPontos() ? android.graphics.Color.GREEN : android.graphics.Color.RED);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ public class HomeFragment extends Fragment {
|
|||||||
|
|
||||||
// Initialize RecyclerView
|
// Initialize RecyclerView
|
||||||
adapter = new StandingsAdapter();
|
adapter = new StandingsAdapter();
|
||||||
|
adapter.setOnTeamClickListener(team -> {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putSerializable("clube_selecionado_estatisticas", team);
|
||||||
|
bundle.putString("escalao", currentEscalao);
|
||||||
|
androidx.navigation.Navigation.findNavController(root).navigate(R.id.action_nav_home_to_nav_club_detail, bundle);
|
||||||
|
});
|
||||||
binding.recyclerStandings.setLayoutManager(new LinearLayoutManager(getContext()));
|
binding.recyclerStandings.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
binding.recyclerStandings.setAdapter(adapter);
|
binding.recyclerStandings.setAdapter(adapter);
|
||||||
|
|
||||||
@@ -92,13 +98,10 @@ public class HomeFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort properly
|
// Set positions after sorting
|
||||||
Collections.sort(teams, (t1, t2) -> {
|
for (int i = 0; i < teams.size(); i++) {
|
||||||
if (t1.getPontos() != t2.getPontos()) {
|
teams.get(i).setPosicao(i + 1);
|
||||||
return t2.getPontos() - t1.getPontos();
|
}
|
||||||
}
|
|
||||||
return t2.getDiferenca_golos() - t1.getDiferenca_golos();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
adapter.setTeams(teams);
|
adapter.setTeams(teams);
|
||||||
|
|||||||
@@ -18,11 +18,20 @@ import com.bumptech.glide.Glide;
|
|||||||
public class StandingsAdapter extends RecyclerView.Adapter<StandingsAdapter.ViewHolder> {
|
public class StandingsAdapter extends RecyclerView.Adapter<StandingsAdapter.ViewHolder> {
|
||||||
|
|
||||||
private List<Team> mTeams;
|
private List<Team> mTeams;
|
||||||
|
private OnTeamClickListener mListener;
|
||||||
|
|
||||||
|
public interface OnTeamClickListener {
|
||||||
|
void onTeamClick(Team team);
|
||||||
|
}
|
||||||
|
|
||||||
public StandingsAdapter() {
|
public StandingsAdapter() {
|
||||||
this.mTeams = new ArrayList<>();
|
this.mTeams = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnTeamClickListener(OnTeamClickListener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
public void setTeams(List<Team> teams) {
|
public void setTeams(List<Team> teams) {
|
||||||
this.mTeams = teams;
|
this.mTeams = teams;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
@@ -72,6 +81,12 @@ public class StandingsAdapter extends RecyclerView.Adapter<StandingsAdapter.View
|
|||||||
holder.textLost.setText(String.valueOf(team.getDerrotas()));
|
holder.textLost.setText(String.valueOf(team.getDerrotas()));
|
||||||
holder.textGoalDiff.setText(String.valueOf(team.getDiferenca_golos()));
|
holder.textGoalDiff.setText(String.valueOf(team.getDiferenca_golos()));
|
||||||
holder.textPoints.setText(String.valueOf(team.getPontos()));
|
holder.textPoints.setText(String.valueOf(team.getPontos()));
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onTeamClick(team);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.example.vdcscore.ui.home;
|
package com.example.vdcscore.ui.home;
|
||||||
|
|
||||||
@com.google.firebase.database.IgnoreExtraProperties
|
@com.google.firebase.database.IgnoreExtraProperties
|
||||||
public class Team {
|
public class Team implements java.io.Serializable {
|
||||||
private int team_id;
|
private int team_id;
|
||||||
private String nome;
|
private String nome;
|
||||||
private int pontos;
|
private int pontos;
|
||||||
|
|||||||
@@ -61,150 +61,314 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"/>
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
|
||||||
<!-- President Section -->
|
<!-- Statistics Header -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/label_stats"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="ESTATÍSTICAS:"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="#616161"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/text_detail_club_name"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"/>
|
||||||
|
|
||||||
|
<!-- Stats Container -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layout_president"
|
android:id="@+id/container_stats"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical"
|
||||||
android:gravity="center_vertical"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginTop="24dp"
|
app:layout_constraintTop_toBottomOf="@id/label_stats"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text_detail_club_name"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
<ImageView
|
<!-- Posicao Row -->
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@drawable/ic_person"
|
|
||||||
app:tint="#455A64"
|
|
||||||
android:background="@drawable/circle_edit_background"
|
|
||||||
android:backgroundTint="#ECEFF1"
|
|
||||||
android:padding="8dp"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:layout_marginStart="16dp">
|
android:gravity="center_vertical"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_detail_position_circle"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="1"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:background="@drawable/bg_circle_green"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:text="POSIÇÃO ATUAL:"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textColor="#616161"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_detail_position"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="1º"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="#263238"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Pontos Row -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/ic_soccer"
|
||||||
|
app:tint="#D32F2F"
|
||||||
|
android:background="@drawable/circle_edit_background"
|
||||||
|
android:backgroundTint="#FFEBEE"
|
||||||
|
android:padding="8dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:text="PONTOS:"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textColor="#616161"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_detail_points"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="30"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="#D32F2F"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View android:layout_width="match_parent" android:layout_height="1dp" android:background="#F5F5F5"/>
|
||||||
|
|
||||||
|
<!-- Games Row -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/ic_soccer"
|
||||||
|
app:tint="#1976D2"
|
||||||
|
android:background="@drawable/circle_edit_background"
|
||||||
|
android:backgroundTint="#E3F2FD"
|
||||||
|
android:padding="8dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:text="JOGOS REALIZADOS:"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textColor="#616161"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_detail_played"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="10"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="#263238"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- W/D/L Summary -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginStart="56dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/text_detail_won"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="PRESIDENTE:"
|
android:text="10V"
|
||||||
android:textSize="12sp"
|
android:textColor="#388E3C"
|
||||||
android:textColor="#616161"/>
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:layout_marginEnd="16dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_detail_president"
|
android:id="@+id/text_detail_drawn"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="João Silva"
|
android:text="0E"
|
||||||
android:textSize="16sp"
|
android:textColor="#FBC02D"
|
||||||
android:textColor="#263238"
|
android:textStyle="bold"
|
||||||
android:textStyle="bold"/>
|
android:textSize="14sp"
|
||||||
|
android:layout_marginEnd="16dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_detail_lost"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="0D"
|
||||||
|
android:textColor="#D32F2F"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Address Section -->
|
<View android:layout_width="match_parent" android:layout_height="1dp" android:background="#F5F5F5"/>
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layout_address"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/layout_president"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@drawable/ic_location"
|
|
||||||
app:tint="#455A64"
|
|
||||||
android:background="@drawable/circle_edit_background"
|
|
||||||
android:backgroundTint="#ECEFF1"
|
|
||||||
android:padding="8dp"/>
|
|
||||||
|
|
||||||
|
<!-- Goals Row -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:layout_marginStart="16dp">
|
android:gravity="center_vertical"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/ic_soccer"
|
||||||
|
app:tint="#455A64"
|
||||||
|
android:background="@drawable/circle_edit_background"
|
||||||
|
android:backgroundTint="#ECEFF1"
|
||||||
|
android:padding="8dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="MORADA:"
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:text="GOLOS (M-S):"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textColor="#616161"/>
|
android:textColor="#616161"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_detail_address"
|
android:id="@+id/text_detail_goals"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="Rua Desportiva 123"
|
android:text="54 - 8"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textColor="#263238"
|
android:textColor="#263238"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Foundation Section -->
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layout_foundation"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/layout_address"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@drawable/ic_calendar"
|
|
||||||
app:tint="#455A64"
|
|
||||||
android:background="@drawable/circle_edit_background"
|
|
||||||
android:backgroundTint="#ECEFF1"
|
|
||||||
android:padding="8dp"/>
|
|
||||||
|
|
||||||
|
<!-- Goal Diff Row -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:layout_marginStart="16dp">
|
android:gravity="center_vertical"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/ic_soccer"
|
||||||
|
app:tint="#7B1FA2"
|
||||||
|
android:background="@drawable/circle_edit_background"
|
||||||
|
android:backgroundTint="#F3E5F5"
|
||||||
|
android:padding="8dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="ANO DE FUNDAÇÃO:"
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:text="DIFERENÇA DE GOLOS:"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textColor="#616161"/>
|
android:textColor="#616161"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_detail_foundation"
|
android:id="@+id/text_detail_goal_diff"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="1995"
|
android:text="+46"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textColor="#263238"
|
android:textColor="#7B1FA2"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Comparison Button -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_compare"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="COMPARAR ESTATÍSTICAS"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:cornerRadius="12dp"
|
||||||
|
android:backgroundTint="#FFC107"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/container_stats"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
|
||||||
|
<!-- Comparison View (Hidden initially) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_comparison"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:background="@drawable/shape_score_bg"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/btn_compare">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CONFRONTO DIRETO"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginBottom="8dp"/>
|
||||||
|
|
||||||
|
<TableLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TableRow android:padding="4dp">
|
||||||
|
<View android:layout_width="0dp" android:layout_weight="1"/>
|
||||||
|
<TextView android:id="@+id/text_compare_team1" android:text="Equipa A" android:textStyle="bold" android:gravity="center" android:layout_width="0dp" android:layout_weight="2"/>
|
||||||
|
<TextView android:id="@+id/text_compare_team2" android:text="Equipa B" android:textStyle="bold" android:gravity="center" android:layout_width="0dp" android:layout_weight="2"/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:padding="4dp">
|
||||||
|
<TextView android:text="Pontos" android:textSize="12sp" android:layout_width="0dp" android:layout_weight="1"/>
|
||||||
|
<TextView android:id="@+id/text_compare_p1" android:text="30" android:gravity="center" android:layout_width="0dp" android:layout_weight="2"/>
|
||||||
|
<TextView android:id="@+id/text_compare_p2" android:text="20" android:gravity="center" android:layout_width="0dp" android:layout_weight="2"/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:padding="4dp">
|
||||||
|
<TextView android:text="Golos" android:textSize="12sp" android:layout_width="0dp" android:layout_weight="1"/>
|
||||||
|
<TextView android:id="@+id/text_compare_g1" android:text="50" android:gravity="center" android:layout_width="0dp" android:layout_weight="2"/>
|
||||||
|
<TextView android:id="@+id/text_compare_g2" android:text="30" android:gravity="center" android:layout_width="0dp" android:layout_weight="2"/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
</TableLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Stadium Section (Hidden per screenshot but kept in model, or should I show it?)
|
|
||||||
The screenshot doesn't explicitly show Stadium but the code had it.
|
|
||||||
I will hide it for now to match screenshot strictly or add it if plenty space?
|
|
||||||
The user said "appears like this", implies following the screenshot.
|
|
||||||
But previously stadium was shown. I will add it as well for completeness if it fits,
|
|
||||||
or just omit if the screenshot is strict.
|
|
||||||
Screenshot: CLUBE, PRESIDENTE, MORADA, ANO DE FUNDACAO. No Stadium.
|
|
||||||
I will omit Stadium from UI to match unique request "like this".
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Players Button -->
|
<!-- Players Button -->
|
||||||
<Button
|
<Button
|
||||||
@@ -223,7 +387,7 @@
|
|||||||
app:iconTint="@color/white"
|
app:iconTint="@color/white"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/layout_foundation"
|
app:layout_constraintTop_toBottomOf="@id/layout_comparison"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintVertical_bias="1.0"
|
app:layout_constraintVertical_bias="1.0"
|
||||||
android:layout_marginBottom="20dp"/>
|
android:layout_marginBottom="20dp"/>
|
||||||
|
|||||||
@@ -9,7 +9,11 @@
|
|||||||
android:id="@+id/nav_home"
|
android:id="@+id/nav_home"
|
||||||
android:name="com.example.vdcscore.ui.home.HomeFragment"
|
android:name="com.example.vdcscore.ui.home.HomeFragment"
|
||||||
android:label="@string/menu_home"
|
android:label="@string/menu_home"
|
||||||
tools:layout="@layout/fragment_home" />
|
tools:layout="@layout/fragment_home">
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_nav_home_to_nav_club_detail"
|
||||||
|
app:destination="@id/nav_club_detail" />
|
||||||
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/nav_gallery"
|
android:id="@+id/nav_gallery"
|
||||||
|
|||||||
Reference in New Issue
Block a user