.
This commit is contained in:
@@ -133,7 +133,7 @@ public class GalleryFragment extends Fragment {
|
|||||||
if (matchdaysList.isEmpty()) return;
|
if (matchdaysList.isEmpty()) return;
|
||||||
|
|
||||||
Matchday currentMatchday = matchdaysList.get(currentJornadaIndex);
|
Matchday currentMatchday = matchdaysList.get(currentJornadaIndex);
|
||||||
binding.textJornadaName.setText(currentMatchday.getName());
|
binding.textJornadaName.setText(formatJornadaName(currentMatchday.getName()));
|
||||||
adapter.setMatches(currentMatchday.getMatches());
|
adapter.setMatches(currentMatchday.getMatches());
|
||||||
|
|
||||||
// Enable/Disable navigation buttons
|
// Enable/Disable navigation buttons
|
||||||
@@ -145,6 +145,18 @@ public class GalleryFragment extends Fragment {
|
|||||||
binding.btnNextJornada.setAlpha(currentJornadaIndex < matchdaysList.size() - 1 ? 1.0f : 0.3f);
|
binding.btnNextJornada.setAlpha(currentJornadaIndex < matchdaysList.size() - 1 ? 1.0f : 0.3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String formatJornadaName(String name) {
|
||||||
|
if (name == null) return "---";
|
||||||
|
// If the name is just a number, format it as "Xª Jornada"
|
||||||
|
try {
|
||||||
|
int num = Integer.parseInt(name);
|
||||||
|
return num + "ª Jornada";
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// If it's already a full name like "Jornada 1", return as is
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
|||||||
@@ -35,6 +35,16 @@ public class Match {
|
|||||||
this.homeName = homeName;
|
this.homeName = homeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PropertyName("home_equipa")
|
||||||
|
public void setHomeEquipa(String homeName) {
|
||||||
|
this.homeName = homeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PropertyName("equipa_casa")
|
||||||
|
public void setEquipaCasa(String homeName) {
|
||||||
|
this.homeName = homeName;
|
||||||
|
}
|
||||||
|
|
||||||
@PropertyName("away_nome")
|
@PropertyName("away_nome")
|
||||||
public String getAwayName() {
|
public String getAwayName() {
|
||||||
return awayName;
|
return awayName;
|
||||||
@@ -45,6 +55,16 @@ public class Match {
|
|||||||
this.awayName = awayName;
|
this.awayName = awayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PropertyName("away_equipa")
|
||||||
|
public void setAwayEquipa(String awayName) {
|
||||||
|
this.awayName = awayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PropertyName("equipa_fora")
|
||||||
|
public void setEquipaFora(String awayName) {
|
||||||
|
this.awayName = awayName;
|
||||||
|
}
|
||||||
|
|
||||||
@PropertyName("home_golos")
|
@PropertyName("home_golos")
|
||||||
public Integer getHomeScore() {
|
public Integer getHomeScore() {
|
||||||
return homeScore;
|
return homeScore;
|
||||||
@@ -95,6 +115,11 @@ public class Match {
|
|||||||
this.homeLogo = homeLogo;
|
this.homeLogo = homeLogo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PropertyName("logo_casa")
|
||||||
|
public void setLogoCasa(String homeLogo) {
|
||||||
|
this.homeLogo = homeLogo;
|
||||||
|
}
|
||||||
|
|
||||||
@PropertyName("away_logo")
|
@PropertyName("away_logo")
|
||||||
public String getAwayLogo() {
|
public String getAwayLogo() {
|
||||||
return awayLogo;
|
return awayLogo;
|
||||||
@@ -105,6 +130,11 @@ public class Match {
|
|||||||
this.awayLogo = awayLogo;
|
this.awayLogo = awayLogo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PropertyName("logo_fora")
|
||||||
|
public void setLogoFora(String awayLogo) {
|
||||||
|
this.awayLogo = awayLogo;
|
||||||
|
}
|
||||||
|
|
||||||
@PropertyName("campo")
|
@PropertyName("campo")
|
||||||
public String getStadium() {
|
public String getStadium() {
|
||||||
return stadium;
|
return stadium;
|
||||||
|
|||||||
@@ -61,17 +61,28 @@ public class MatchesAdapter extends RecyclerView.Adapter<MatchesAdapter.ViewHold
|
|||||||
.placeholder(R.drawable.ic_club_placeholder)
|
.placeholder(R.drawable.ic_club_placeholder)
|
||||||
.into(holder.imgAwayLogo);
|
.into(holder.imgAwayLogo);
|
||||||
|
|
||||||
// Scores and Time
|
// Scores
|
||||||
if (match.getHomeScore() != null && match.getAwayScore() != null) {
|
if (match.getHomeScore() != null) {
|
||||||
holder.textScore.setText(match.getHomeScore() + " - " + match.getAwayScore());
|
holder.textHomeScore.setText(String.valueOf(match.getHomeScore()));
|
||||||
holder.textTime.setText(match.getDate() != null ? match.getDate() : "Final");
|
|
||||||
} else {
|
} else {
|
||||||
holder.textScore.setText("Vs");
|
holder.textHomeScore.setText("-");
|
||||||
String timeStr = "";
|
|
||||||
if (match.getDate() != null) timeStr += match.getDate();
|
|
||||||
if (match.getTime() != null) timeStr += " " + match.getTime();
|
|
||||||
holder.textTime.setText(timeStr.trim().isEmpty() ? "Agendado" : timeStr.trim());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (match.getAwayScore() != null) {
|
||||||
|
holder.textAwayScore.setText(String.valueOf(match.getAwayScore()));
|
||||||
|
} else {
|
||||||
|
holder.textAwayScore.setText("-");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Match Info (Date/Time)
|
||||||
|
String dateStr = match.getDate() != null ? match.getDate() : "";
|
||||||
|
String timeStr = match.getTime() != null ? match.getTime() : "";
|
||||||
|
String fullInfo = (dateStr + " " + timeStr).trim();
|
||||||
|
holder.textMatchInfo.setText(fullInfo.isEmpty() ? "Data a definir" : fullInfo);
|
||||||
|
|
||||||
|
// Stadium
|
||||||
|
String stadium = match.getStadium();
|
||||||
|
holder.textStadium.setText(isValid(stadium) ? "Campo: " + stadium : "Campo a definir");
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isValid(String text) {
|
private boolean isValid(String text) {
|
||||||
@@ -86,8 +97,10 @@ public class MatchesAdapter extends RecyclerView.Adapter<MatchesAdapter.ViewHold
|
|||||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
public final TextView textHomeTeam;
|
public final TextView textHomeTeam;
|
||||||
public final TextView textAwayTeam;
|
public final TextView textAwayTeam;
|
||||||
public final TextView textScore;
|
public final TextView textHomeScore;
|
||||||
public final TextView textTime;
|
public final TextView textAwayScore;
|
||||||
|
public final TextView textMatchInfo;
|
||||||
|
public final TextView textStadium;
|
||||||
public final ImageView imgHomeLogo;
|
public final ImageView imgHomeLogo;
|
||||||
public final ImageView imgAwayLogo;
|
public final ImageView imgAwayLogo;
|
||||||
|
|
||||||
@@ -95,8 +108,10 @@ public class MatchesAdapter extends RecyclerView.Adapter<MatchesAdapter.ViewHold
|
|||||||
super(view);
|
super(view);
|
||||||
textHomeTeam = view.findViewById(R.id.text_home_team);
|
textHomeTeam = view.findViewById(R.id.text_home_team);
|
||||||
textAwayTeam = view.findViewById(R.id.text_away_team);
|
textAwayTeam = view.findViewById(R.id.text_away_team);
|
||||||
textScore = view.findViewById(R.id.text_score);
|
textHomeScore = view.findViewById(R.id.text_home_score);
|
||||||
textTime = view.findViewById(R.id.text_time);
|
textAwayScore = view.findViewById(R.id.text_away_score);
|
||||||
|
textMatchInfo = view.findViewById(R.id.text_match_info);
|
||||||
|
textStadium = view.findViewById(R.id.text_match_stadium);
|
||||||
imgHomeLogo = view.findViewById(R.id.img_home_logo);
|
imgHomeLogo = view.findViewById(R.id.img_home_logo);
|
||||||
imgAwayLogo = view.findViewById(R.id.img_away_logo);
|
imgAwayLogo = view.findViewById(R.id.img_away_logo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,95 +1,150 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:gravity="center_vertical"
|
android:layout_marginVertical="8dp"
|
||||||
android:padding="12dp"
|
app:cardCornerRadius="12dp"
|
||||||
android:layout_marginBottom="8dp"
|
app:cardElevation="4dp"
|
||||||
android:background="@drawable/bg_match_item">
|
app:strokeWidth="0dp">
|
||||||
|
|
||||||
<!-- Home Team Section -->
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center_vertical|end"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/text_home_team"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="end"
|
|
||||||
android:text="Home"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="@color/text_primary"
|
|
||||||
android:layout_marginEnd="8dp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/img_home_logo"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:padding="2dp"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:src="@drawable/ic_club_placeholder" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Score / Time Section -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="12dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:minWidth="70dp">
|
android:padding="12dp">
|
||||||
|
|
||||||
<TextView
|
<!-- Header: Date, Time and Stadium -->
|
||||||
android:id="@+id/text_score"
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Vs"
|
android:gravity="center"
|
||||||
android:textStyle="bold"
|
android:orientation="vertical"
|
||||||
android:textColor="@color/primary_color"
|
android:layout_marginBottom="8dp">
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_time"
|
android:id="@+id/text_match_info"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="29/03/2026 10:00"
|
||||||
|
android:textColor="#1976D2"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_match_stadium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Campo:Guilhabreu"
|
||||||
|
android:textColor="#1976D2"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#BBDEFB"
|
||||||
|
android:layout_marginBottom="12dp" />
|
||||||
|
|
||||||
|
<!-- Teams and Scores -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="15:00"
|
android:gravity="center"
|
||||||
android:textSize="11sp"
|
android:orientation="horizontal">
|
||||||
android:textColor="@color/text_secondary" />
|
|
||||||
|
<!-- Home Team -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_home_logo"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@drawable/ic_club_placeholder" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_home_team"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="J.U. Mosteiró"
|
||||||
|
android:textColor="@color/text_primary"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Score Section -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_home_score"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="2"
|
||||||
|
android:textColor="#0D47A1"
|
||||||
|
android:textSize="32sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="2dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:background="#E3F2FD"
|
||||||
|
android:layout_marginHorizontal="12dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_away_score"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="4"
|
||||||
|
android:textColor="#0D47A1"
|
||||||
|
android:textSize="32sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Away Team -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_away_logo"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@drawable/ic_club_placeholder" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_away_team"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="G.D.C. Rio Mau"
|
||||||
|
android:textColor="@color/text_primary"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Away Team Section -->
|
</com.google.android.material.card.MaterialCardView>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center_vertical|start"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/img_away_logo"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:padding="2dp"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:src="@drawable/ic_club_placeholder" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/text_away_team"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="start"
|
|
||||||
android:text="Away"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="@color/text_primary"
|
|
||||||
android:layout_marginStart="8dp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
# Project-wide Gradle settings.
|
## For more details on how to configure your build environment visit
|
||||||
# IDE (e.g. Android Studio) users:
|
|
||||||
# Gradle settings configured through the IDE *will override*
|
|
||||||
# any settings specified in this file.
|
|
||||||
# For more details on how to configure your build environment visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
#
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
# Default value: -Xmx1024m -XX:MaxPermSize=256m
|
||||||
|
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
|
#
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. For more details, visit
|
# This option should only be used with decoupled projects. For more details, visit
|
||||||
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
#Tue Apr 21 15:33:57 WEST 2026
|
||||||
# Android operating system, and which are packaged with your app's APK
|
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
||||||
android.useAndroidX=true
|
|
||||||
# Enables namespacing of each library's R class so that its R class includes only the
|
|
||||||
# resources declared in the library itself and none from the library's dependencies,
|
|
||||||
# thereby reducing the size of the R class for that library
|
|
||||||
android.nonTransitiveRClass=true
|
android.nonTransitiveRClass=true
|
||||||
|
android.useAndroidX=true
|
||||||
|
org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1536M" -Dfile.encoding\=UTF-8
|
||||||
|
|||||||
Reference in New Issue
Block a user