From 5061b49f6e9d133ebfc05ecf023741047fef2348 Mon Sep 17 00:00:00 2001 From: 230421 <230421@epvc.pt> Date: Tue, 21 Apr 2026 15:34:34 +0100 Subject: [PATCH] . --- .../vdcscore/ui/gallery/GalleryFragment.java | 14 +- .../example/vdcscore/ui/gallery/Match.java | 30 +++ .../vdcscore/ui/gallery/MatchesAdapter.java | 41 ++-- app/src/main/res/layout/item_match.xml | 221 +++++++++++------- gradle.properties | 21 +- 5 files changed, 217 insertions(+), 110 deletions(-) diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java b/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java index 51ca390..89bb036 100644 --- a/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/GalleryFragment.java @@ -133,7 +133,7 @@ public class GalleryFragment extends Fragment { if (matchdaysList.isEmpty()) return; Matchday currentMatchday = matchdaysList.get(currentJornadaIndex); - binding.textJornadaName.setText(currentMatchday.getName()); + binding.textJornadaName.setText(formatJornadaName(currentMatchday.getName())); adapter.setMatches(currentMatchday.getMatches()); // Enable/Disable navigation buttons @@ -145,6 +145,18 @@ public class GalleryFragment extends Fragment { 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 public void onDestroyView() { super.onDestroyView(); diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/Match.java b/app/src/main/java/com/example/vdcscore/ui/gallery/Match.java index bbceea4..d04f31f 100644 --- a/app/src/main/java/com/example/vdcscore/ui/gallery/Match.java +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/Match.java @@ -35,6 +35,16 @@ public class Match { 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") public String getAwayName() { return awayName; @@ -45,6 +55,16 @@ public class Match { 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") public Integer getHomeScore() { return homeScore; @@ -95,6 +115,11 @@ public class Match { this.homeLogo = homeLogo; } + @PropertyName("logo_casa") + public void setLogoCasa(String homeLogo) { + this.homeLogo = homeLogo; + } + @PropertyName("away_logo") public String getAwayLogo() { return awayLogo; @@ -105,6 +130,11 @@ public class Match { this.awayLogo = awayLogo; } + @PropertyName("logo_fora") + public void setLogoFora(String awayLogo) { + this.awayLogo = awayLogo; + } + @PropertyName("campo") public String getStadium() { return stadium; diff --git a/app/src/main/java/com/example/vdcscore/ui/gallery/MatchesAdapter.java b/app/src/main/java/com/example/vdcscore/ui/gallery/MatchesAdapter.java index 02b187d..1ba6798 100644 --- a/app/src/main/java/com/example/vdcscore/ui/gallery/MatchesAdapter.java +++ b/app/src/main/java/com/example/vdcscore/ui/gallery/MatchesAdapter.java @@ -61,17 +61,28 @@ public class MatchesAdapter extends RecyclerView.Adapter - + android:layout_marginHorizontal="16dp" + android:layout_marginVertical="8dp" + app:cardCornerRadius="12dp" + app:cardElevation="4dp" + app:strokeWidth="0dp"> - - - - - - - - - - - + + + - - + + + + + + + + + + + android:gravity="center" + android:orientation="horizontal"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + diff --git a/gradle.properties b/gradle.properties index 4387edc..f05d58f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,21 +1,16 @@ -# Project-wide Gradle settings. -# 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 +## For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html +# # Specifies the JVM arguments used for the daemon process. # 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. # This option should only be used with decoupled projects. For more details, visit # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects # org.gradle.parallel=true -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app's APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn +#Tue Apr 21 15:33:57 WEST 2026 +android.nonTransitiveRClass=true 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 \ No newline at end of file +org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1536M" -Dfile.encoding\=UTF-8