Compare commits

..

No commits in common. 'master' and 'View_Home' have entirely different histories.

@ -1,24 +0,0 @@
kind: pipeline
type: docker
name: Scor_It
trigger:
event:
- push
steps:
- name: code-analysis
image: openjdk:8-jdk
environment:
SONAR_TOKEN:
from_secret: SECRET_TOKEN
settings:
sources: ./src/
commands:
- export SONAR_SCANNER_VERSION=4.7.0.2747
- export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
- curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- export PATH=$SONAR_SCANNER_HOME/bin:$PATH
- export SONAR_SCANNER_OPTS="-server"
- sonar-scanner -D sonar.projectKey=Scor_It -D sonar.sources=./src -D sonar.host.url=https://codefirst.iut.uca.fr/sonar

@ -1,6 +1,6 @@
<div align = center>
<img src="doc/Images/Banner-Scor_It.png" width="1050">
<img src="doc/Images/Banner-Scor_It.png" width="1000">
</div>
@ -8,16 +8,9 @@
---
&nbsp; ![Android](https://img.shields.io/badge/Android-3DDC84?style=for-the-badge&logo=android&logoColor=white)
&nbsp; ![Kotlin](https://img.shields.io/badge/Kotlin-0095D5?&style=for-the-badge&logo=kotlin&logoColor=white)
&nbsp; ![Google Play](https://img.shields.io/badge/Google_Play-414141?style=for-the-badge&logo=google-play&color=white&logoColor=green)
&nbsp; ![Android Studio](https://img.shields.io/badge/Android%20Studio-3DDC84.svg?style=for-the-badge&logo=android-studio&logoColor=white)
[![Code Smells](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Scor_It&metric=code_smells&token=f19f43142bada43a272cd7bce342e340e1298f15)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Scor_It)
[![Maintainability Rating](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Scor_It&metric=sqale_rating&token=f19f43142bada43a272cd7bce342e340e1298f15)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Scor_It)
[![Quality Gate Status](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Scor_It&metric=alert_status&token=f19f43142bada43a272cd7bce342e340e1298f15)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Scor_It)
[![Security Rating](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Scor_It&metric=security_rating&token=f19f43142bada43a272cd7bce342e340e1298f15)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Scor_It)
[![Vulnerabilities](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=Scor_It&metric=vulnerabilities&token=f19f43142bada43a272cd7bce342e340e1298f15)](https://codefirst.iut.uca.fr/sonar/dashboard?id=Scor_It)
&nbsp; ![Android](https://img.shields.io/badge/Android-000?style=for-the-badge&logo=Android&logoColor=green&color=white)
&nbsp; ![XML](https://img.shields.io/badge/XML-000?style=for-the-badge&logoColor=white&color=yellow&textColor=white)
&nbsp; ![Kotlin](https://img.shields.io/badge/Kotlin-000?style=for-the-badge&logo=Kotlin&logoColor=purple&color=white)
---
@ -30,253 +23,12 @@ API : https://www.football-data.org/documentation/quickstart (Football Data)
IDE : https://developer.android.com/studio (Android Studio)
## :bookmark_tabs: Fonctionnement
### Diagramme de classes du modèle :
```plantuml
@startuml
skinparam defaultFontName Tahoma
skinparam classAttributeIconSize 0
skinparam monochrome true
skinparam shadowing true
skinparam linetype ortho
skinparam class {
BackgroundColor transparent
}
skinparam package {
BackgroundColor transparent
}
hide circle
class Contract {
-start: Calendar
-until: Calendar
+duration() : Int
}
abstract class Personne {
-id: Int
-firstName: String
-lastName: String
-name: String
-dateOfBirth: Calendar
-nationality: String
}
class Staff {
}
class Coach {
}
class Player {
-position: String
shirtNumber: Int
}
class Team {
-id: Int
-name: String
-shortName: String
-crest: String
-adress: String
-website: String
-founded: Int
-clubColors: String
-venue: String
}
class Area {
-id: Int
-name: String
-code: String
-flag: String
-parentArea: String
}
class Competition {
-id: Int
-name: String
-code: String
-type: String
-emblem: String
}
class Season {
-id: Int
-startDate: Calendar
-endDate: Calendar
-currentMatchday: Int
-winner: Int
}
class Match {
-id: Int
-score: Score
-status: String
}
class Score {
-home: Int
-away: Int
-winner: String
}
Personne --> "-contract" Contract
Staff ..|> Personne
Coach ..|> Personne
Player ..|> Personne
Team --> "-staff*" Staff
Team --> "-coach" Coach
Team --> "-squad*" Player
Team --> "-area" Area
Match --> "-HomeTeam" Team
Match --> "-AwayTeam" Team
Match --> "-competition" Competition
Competition --> "-area" Area
Competition --> "-currentSeason" Season
Match --> "-score" Score
@enduml
```
### Diagramme de classes des interfaces et classes de gestion de l'accées aux données :
```plantuml
@startuml
skinparam defaultFontName Tahoma
skinparam classAttributeIconSize 0
skinparam monochrome true
skinparam shadowing true
skinparam linetype ortho
skinparam class {
BackgroundColor transparent
}
skinparam package {
BackgroundColor transparent
}
hide circle
interface GenericDataManager {
+getItems() : List<T>
+getItemById(id: Int) : T
}
class TeamsManager {
+getItemsByName(substring: String) : List<Team>
}
class CompetitionsManager {
+getItemsByName(substring: String) : List<Competition>
}
class MatchesManager {
}
class PeopleManager {
+getItemsByName(substring: String) : List<People>
}
class AreaManager {
+getItemsByName(substring: String) : List<Area>
}
abstract class DataManager {
}
## Technicien en charge de l'application
class ApiManager {
}
⚙️ Emre KARTAL
class StubManager {
}
AreaManager ..|> GenericDataManager
PeopleManager ..|> GenericDataManager
MatchesManager ..|> GenericDataManager
CompetitionsManager ..|> GenericDataManager
TeamsManager ..|> GenericDataManager
DataManager --> "-areaMgr" AreaManager
DataManager --> "-peopleMgr" PeopleManager
DataManager --> "-matchesMgr*" MatchesManager
DataManager --> "-competitionsMgr" CompetitionsManager
DataManager --> "-teamsMgr" TeamsManager
ApiManager --|> DataManager
StubManager --|> DataManager
@enduml
```
## Visuel de l'Application
⚙️ Baptiste MARCEL
<div align = center>
<img src="doc/Images/StartPage.jpg" width="250" >
<img src="doc/Images/HomePage.jpg" width="250" >
<img src="doc/Images/FavoritePage.jpg" width="250" >
<img src="doc/Images/DetailCompetitionPage.jpg" width="250" >
</div>
## Avancement du projet
<u>Où en sommes-nous</u>:grey_question::grey_exclamation: (:white_check_mark: réalisé, :warning: presque abouti, :x: non commencé )
```Côté vue:```
- :white_check_mark: [**Partie 1**](src) : **Réalisation de la vue Start Page**
- :white_check_mark: [**Partie 2**](src) : **Réalisation de la vue Home Page**
- :white_check_mark: [**Partie 3**](src) : **Réalisation de la vue Favorite Page**
- :white_check_mark: [**Partie 4**](src) : **Réalisation de la vue Detail Competition Page**
- :x: [**Partie 5**](src) : **Réalisation de la vue Team Detail Page**
```Côté back-end:```
- :white_check_mark: [**Partie 1**](src) : **Réalisation de la navigation entre les fragments**
- :white_check_mark: [**Partie 2**](src) : **Master Detail**
- :white_check_mark: [**Partie 3**](src) : **Appelle à l'API**
- :white_check_mark: [**Partie 4**](src) : **Gyroscope pour le ballon de foot**
- :white_check_mark: [**Partie 5**](doc) : **Conception et réalisation du Model**
- :warning: [**Partie 6**](src) : **Persistance des donnéees**
- :x: [**Partie 7**](src) : **Réalisation de la barre de recherche**
- :x: [**Partie 8**](src) : **Affichage des images SVG**
```Autre:```
- :white_check_mark: [**Partie 1**](.drone.yml) : **Mise en place de SonarQube**
## :construction_worker: Technicien en charge de l'application
- Emre KARTAL : Emre.KARTAL@etu.uca.fr
- Baptiste MARCEL : Baptiste.MARCEL@etu.uca.fr
<div align="center">
<a href = "https://codefirst.iut.uca.fr/git/emre.kartal">
<img src="https://codefirst.iut.uca.fr/git/avatars/402cf312e853192f42c0135a888725c2?size=870" width="50" >
</a>
<a href = "https://codefirst.iut.uca.fr/git/baptiste.marcel">
<img src="https://codefirst.iut.uca.fr/git/avatars/6b1f2a8b8f636d8f4d315b060075578f?size=870" width="50" >
</a>
© IUT - Auvergne
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

@ -1,123 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

@ -32,25 +32,10 @@ android {
}
}
apply plugin: 'kotlin-kapt'
dependencies {
// Navigation
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
// Glide
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// Room
implementation 'androidx.room:room-runtime:2.5.1'
implementation 'androidx.room:room-ktx:2.5.1'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

@ -8,20 +8,20 @@
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@drawable/icon"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@drawable/round_icon"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Scor_It"
tools:targetApi="31">
<activity
android:name=".view.MainActivity"
android:name=".view.HomeActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

@ -1,119 +0,0 @@
package uca.iut.clermont.api
import AreaManager
import CompetitionsManager
import DataManager
import MatchesManager
import PeopleManager
import TeamsManager
import kotlinx.coroutines.coroutineScope
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import uca.iut.clermont.model.*
val retrofit: Retrofit = Retrofit.Builder()
.baseUrl("https://api.football-data.org/v4/")
.addConverterFactory(GsonConverterFactory.create())
.build()
val footballApi: FootballApi = retrofit.create(FootballApi::class.java)
class ApiManager : DataManager() {
override val areaMgr: AreaManager = ApiAreaManager()
override val peopleMgr: PeopleManager = ApiPeopleManager()
override val matchesMgr: MatchesManager = ApiMatchesManager()
override val competitionsMgr: CompetitionsManager = ApiCompetitionsManager()
override val teamsMgr: TeamsManager = ApiTeamsManager()
class ApiAreaManager : AreaManager {
override suspend fun getItemsByName(substring: String): List<Area> = coroutineScope {
val areas = footballApi.getAreas()
return@coroutineScope areas.areas.filter { it.name.contains(substring) }
}
override suspend fun getItems(): List<Area> = coroutineScope {
val areas = footballApi.getAreas()
return@coroutineScope areas.areas
}
override suspend fun getItemById(id: Int): Area = coroutineScope {
val area = footballApi.getArea(id)
return@coroutineScope area
}
}
class ApiPeopleManager : PeopleManager {
override suspend fun getItems(): List<Personne> = listOf()
override suspend fun getItemById(id: Int): Personne? = coroutineScope {
val personne = footballApi.getPlayer(id)
return@coroutineScope personne.toModel()
}
}
class ApiMatchesManager : MatchesManager {
override suspend fun getNbItemsByCompetition(id: Int): Int = coroutineScope {
val matches = footballApi.getMatchesByCompetition(id)
return@coroutineScope matches.matches.size
}
override suspend fun getItemsByCompetition(id: Int): List<Match> =
coroutineScope {
val matches = footballApi.getMatchesByCompetition(id)
return@coroutineScope matches.matches.map { it.toModel() }
}
override suspend fun getItems(): List<Match> = coroutineScope {
val matches = footballApi.getMatches()
return@coroutineScope matches.matches.map { matchResult -> matchResult.toModel() }
}
override suspend fun getItemById(id: Int): Match = coroutineScope {
val match = footballApi.getMatch(id)
return@coroutineScope match.toModel()
}
}
class ApiCompetitionsManager : CompetitionsManager {
override suspend fun getItemsByName(substring: String): List<Competition> = coroutineScope {
val competitons = footballApi.getCompetitions()
return@coroutineScope competitons.competitions.map { competitionResult -> competitionResult.toModel() }
.filter { it.name == substring }
}
override suspend fun getItems(): List<Competition> = coroutineScope {
val competitons = footballApi.getCompetitions()
return@coroutineScope competitons.competitions.map { competitionResult -> competitionResult.toModel() }
.sortedBy { it.name }
}
override suspend fun getItemById(id: Int): Competition = coroutineScope {
val competition = footballApi.getCompetition(id)
return@coroutineScope competition.toModel()
}
}
class ApiTeamsManager : TeamsManager {
override fun getItemsByName(substring: String): List<Team> {
TODO("Not yet implemented")
}
override suspend fun getItems(): List<Team> {
TODO("Not yet implemented")
}
override suspend fun getItemById(id: Int): Team? {
TODO("Not yet implemented")
}
}
}

@ -1,48 +0,0 @@
package uca.iut.clermont.api
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Path
import uca.iut.clermont.api.response.areaResponse.AreaResponse
import uca.iut.clermont.api.response.competitionResponse.CompetitionResponse
import uca.iut.clermont.api.response.competitionResponse.CompetitionResult
import uca.iut.clermont.api.response.matchResponse.MatchResponse
import uca.iut.clermont.api.response.matchResponse.MatchResult
import uca.iut.clermont.model.Area
import uca.iut.clermont.model.PlayerResponse
interface FootballApi {
@Headers("X-Auth-Token: 7814ffe5b0314b5291a287d32a178e57")
@GET("areas/{id}")
suspend fun getArea(@Path("id") id: Int): Area
@Headers("X-Auth-Token: 7814ffe5b0314b5291a287d32a178e57")
@GET("areas")
suspend fun getAreas(): AreaResponse
@Headers("X-Auth-Token: 7814ffe5b0314b5291a287d32a178e57")
@GET("persons/{id}")
suspend fun getPlayer(@Path("id") playerId: Int): PlayerResponse
@Headers("X-Auth-Token: 621ef06e148542f98b4993a5442421eb")
@GET("competitions")
suspend fun getCompetitions(): CompetitionResponse
@Headers("X-Auth-Token: 8f51b43de0444026bd3ec3484f082575")
@GET("competitions/{id}")
suspend fun getCompetition(@Path("id") id: Int): CompetitionResult
@Headers("X-Auth-Token: 7814ffe5b0314b5291a287d32a178e57")
@GET("matches")
suspend fun getMatches(): MatchResponse
@Headers("X-Auth-Token: 621ef06e148542f98b4993a5442421eb")
@GET("matches/{id}")
suspend fun getMatch(@Path("id") id: Int): MatchResult
@Headers("X-Auth-Token: b002ff114afa41a590e2baef63d8c689")
@GET("competitions/{id}/matches")
suspend fun getMatchesByCompetition(@Path("id") id: Int): MatchResponse
}

@ -1,8 +0,0 @@
package uca.iut.clermont.api.response.areaResponse
import uca.iut.clermont.model.Area
data class AreaResponse(
val areas: List<Area>,
val count: Int
)

@ -1,7 +0,0 @@
package uca.iut.clermont.api.response.competitionResponse
data class CompetitionResponse(
val competitions: List<CompetitionResult>,
val count: Int,
val filters: Filters
)

@ -1,24 +0,0 @@
package uca.iut.clermont.api.response.competitionResponse
import uca.iut.clermont.model.Area
import uca.iut.clermont.model.Competition
class CompetitionResult(
val id: Int,
val name: String,
val code: String,
val type: String,
val emblem: String,
val currentSeason: CurrentSeason,
val area: Area
) {
fun toModel() = Competition(
id,
name,
code,
type,
emblem,
currentSeason.toModel(),
area
)
}

@ -1,29 +0,0 @@
package uca.iut.clermont.api.response.competitionResponse
import uca.iut.clermont.model.Season
import java.text.SimpleDateFormat
import java.util.*
data class CurrentSeason(
val currentMatchday: Int,
val endDate: String,
val id: Int,
val startDate: String,
val winner: Any
) {
fun toModel(): Season {
val calendar = Calendar.getInstance()
val calendar2 = Calendar.getInstance()
return Season(
id,
calendar.apply {
time = SimpleDateFormat("yyyy-MM-dd", Locale.US).parse(startDate) as Date
},
calendar2.apply {
time = SimpleDateFormat("yyyy-MM-dd", Locale.US).parse(endDate) as Date
},
currentMatchday,
if (winner is Int) winner else null
)
}
}

@ -1,5 +0,0 @@
package uca.iut.clermont.api.response.competitionResponse
data class Filters(
val client: String
)

@ -1,7 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
data class Filters(
val dateFrom: String,
val dateTo: String,
val permission: String
)

@ -1,23 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
import uca.iut.clermont.api.response.competitionResponse.CurrentSeason
import uca.iut.clermont.model.Area
import uca.iut.clermont.model.Competition
class MatchCompetitionResult(
val id: Int,
val name: String,
val code: String,
val type: String,
val emblem: String
) {
fun toModel(season: CurrentSeason, area: Area) = Competition(
id,
name,
code,
type,
emblem,
season.toModel(),
area
)
}

@ -1,7 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
data class MatchResponse(
val filters: Filters,
val matches: List<MatchResult>,
val resultSet: ResultSet
)

@ -1,32 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
import uca.iut.clermont.api.response.competitionResponse.CurrentSeason
import uca.iut.clermont.model.Area
import uca.iut.clermont.model.Match
import java.text.SimpleDateFormat
import java.util.*
class MatchResult(
val id: Int,
val homeTeam: TeamResult,
val awayTeam: TeamResult,
val utcDate: String,
val status: String,
val score: ScoreResult,
val season: CurrentSeason,
val area: Area,
val competition: MatchCompetitionResult
) {
fun toModel() = Match(
id,
homeTeam.toModel(),
awayTeam.toModel(),
Calendar.getInstance().apply {
time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US).parse(utcDate) as Date
},
status,
score.toModel(),
competition.toModel(season, area)
)
}

@ -1,9 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
data class ResultSet(
val competitions: String,
val count: Int,
val first: String,
val last: String,
val played: Int
)

@ -1,16 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
import uca.iut.clermont.model.Score
data class ScoreResult(
val duration: String,
val fullTime: Time,
val halfTime: Time,
val winner: String?
){
fun toModel() = Score(
fullTime.home,
fullTime.away,
winner
)
}

@ -1,37 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
import uca.iut.clermont.model.Area
import uca.iut.clermont.model.Coach
import uca.iut.clermont.model.Contract
import uca.iut.clermont.model.Team
import java.util.*
class TeamResult(
val id: Int,
val name: String,
val shortName: String,
val crest: String
) {
fun toModel() = Team(
id,
name,
shortName,
crest,
"",
"",
"",
"",
Area(1, "", "", "", ""),
"",
Coach(
1, "", "", "", Calendar.getInstance()
.apply { set(2022, 12, 28) }, "",
Contract(
Calendar.getInstance().apply { set(2020, 7, 1) },
Calendar.getInstance().apply { set(2024, 7, 1) })
),
listOf(),
listOf()
)
}

@ -1,6 +0,0 @@
package uca.iut.clermont.api.response.matchResponse
data class Time(
val away: Int?,
val home: Int?
)

@ -1,6 +0,0 @@
package uca.iut.clermont.api.response.playerResponse
data class ContractResponse(
val start: String,
val until: String
)

@ -1,7 +0,0 @@
package uca.iut.clermont.api.response.playerResponse
data class CurrentTeamResponse(
val id: Int,
val name: String,
val contract: ContractResponse
)

@ -1,38 +0,0 @@
package uca.iut.clermont.model
import uca.iut.clermont.api.response.playerResponse.CurrentTeamResponse
import java.text.SimpleDateFormat
import java.util.*
data class PlayerResponse(
val id: Int,
val firstName: String,
val lastName: String,
val name: String,
val dateOfBirth: String,
val nationality: String,
val position: String,
val shirtNumber: Int,
val lastUpdated: String,
val currentTeam: CurrentTeamResponse
) {
fun toModel() = Personne(
id,
firstName,
lastName,
name,
Calendar.getInstance().apply {
time = SimpleDateFormat("yyyy-MM-dd", Locale.US).parse(dateOfBirth) as Date
},
nationality,
Contract(
Calendar.getInstance().apply {
time = SimpleDateFormat("yyyy-MM", Locale.US).parse(currentTeam.contract.start) as Date
},
Calendar.getInstance().apply {
time = SimpleDateFormat("yyyy-MM", Locale.US).parse(currentTeam.contract.until) as Date
}
)
)
}

@ -1,31 +0,0 @@
package uca.iut.clermont.data
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import uca.iut.clermont.data.dao.CompetitionDao
import uca.iut.clermont.model.Competition
@Database(entities = arrayOf(Competition::class), version = 1)
abstract class BDD : RoomDatabase() {
abstract fun competitionDao(): CompetitionDao
companion object {
private var INSTANCE: BDD? = null
fun getInstance(context: Context) =
INSTANCE ?: synchronized(this) {
val db = Room.databaseBuilder(
context,
BDD::class.java,
"ScorItDB"
).build()
INSTANCE = db
}
}
}

@ -7,467 +7,86 @@ import MatchesManager
import PeopleManager
import TeamsManager
import uca.iut.clermont.model.*
import java.util.*
class StubData : DataManager() {
override val areaMgr: AreaManager = StubAreaManager(this)
override val peopleMgr: PeopleManager = StubPeopleManager(this)
override val matchesMgr: MatchesManager = StubMatchesManager(this)
override val competitionsMgr: CompetitionsManager = StubCompetitionsManager(this)
override val teamsMgr: TeamsManager = StubTeamsManager(this)
class StubData: DataManager() {
override val areaMgr: AreaManager = StubAreaManager()
override val peopleMgr: PeopleManager = StubPeopleManager()
override val matchesMgr: MatchesManager = StubMatchesManager()
override val competitionsMgr: CompetitionsManager = StubCompetitionsManager()
override val teamsMgr: TeamsManager = StubTeamsManager()
private val areaList = listOf(
Area(1, "France", "FRA", "https://crests.football-data.org/773.svg", "Europe"),
Area(2, "Spain", "ESP", "https://crests.football-data.org/760.svg", "Europe"),
Area(3, "Brazil", "BRA", "https://crests.football-data.org/764.svg", "South America"),
Area(4, "Mexico", "Mex", "https://crests.football-data.org/mexico.svg", "North America"),
Area(
5,
"Australia",
"AUS",
"https://australie-voyage.fr/wp-content/uploads/2020/08/Drapeau-australien.jpg",
"Oceania"
)
)
class StubAreaManager : AreaManager {
override fun getItemsByName(substring: String): List<Area> {
TODO("Not yet implemented")
}
private val peopleList = listOf(
Player(
1,
"Lionel",
"Messi",
"L. Messi",
Calendar.getInstance().apply { set(1987, 6, 24) },
"Argentina",
Contract(
Calendar.getInstance().apply { set(2020, 6, 1) },
Calendar.getInstance().apply { set(2025, 6, 1) }),
"Forward",
10
),
Player(
2,
"Cristiano",
"Ronaldo",
"C. Ronaldo",
Calendar.getInstance().apply { set(1985, 2, 5) },
"Portugal",
Contract(
Calendar.getInstance().apply { set(2020, 7, 1) },
Calendar.getInstance().apply { set(2024, 7, 1) }),
"Forward",
7
),
Player(
3,
"Neymar",
"Jr",
"Neymar",
Calendar.getInstance().apply { set(1992, 2, 5) },
"Brazil",
Contract(
Calendar.getInstance().apply { set(2021, 1, 1) },
Calendar.getInstance().apply { set(2026, 1, 1) }),
"Forward",
10
),
Player(
4,
"Kylian",
"Mbappe",
"K. Mbappe",
Calendar.getInstance().apply { set(1998, 12, 20) },
"France",
Contract(
Calendar.getInstance().apply { set(2022, 1, 1) },
Calendar.getInstance().apply { set(2027, 1, 1) }),
"Forward",
7
),
Player(
5,
"Mohamed",
"Salah",
"M. Salah",
Calendar.getInstance().apply { set(1992, 6, 15) },
"Egypt",
Contract(
Calendar.getInstance().apply { set(2021, 7, 1) },
Calendar.getInstance().apply { set(2025, 7, 1) }),
"Forward",
11
),
Player(
6,
"Kevin",
"De Bruyne",
"K. De Bruyne",
Calendar.getInstance().apply { set(1991, 6, 28) },
"Belgium",
Contract(
Calendar.getInstance().apply { set(2021, 8, 1) },
Calendar.getInstance().apply { set(2026, 8, 1) }),
"Midfielder",
17
),
Player(
7,
"Robert",
"Lewandowski",
"R. Lewandowski",
Calendar.getInstance().apply { set(1988, 8, 21) },
"Poland",
Contract(
Calendar.getInstance().apply { set(2021, 1, 1) },
Calendar.getInstance().apply { set(2024, 1, 1) }),
"Forward",
9
),
Player(
8,
"Sadio",
"Mane",
"S. Mane",
Calendar.getInstance().apply { set(1992, 4, 10) },
"Senegal",
Contract(
Calendar.getInstance().apply { set(2022, 1, 1) },
Calendar.getInstance().apply { set(2026, 1, 1) }),
"Forward",
10
),
Player(
9,
"Virgil",
"Van Dijk",
"V. Van Dijk",
Calendar.getInstance().apply { set(1991, 7, 8) },
"Netherlands",
Contract(
Calendar.getInstance().apply { set(2023, 1, 1) },
Calendar.getInstance().apply { set(2026, 1, 1) }),
"Defender",
4
),
Player(
10,
"Luka",
"Modric",
"L. Modric",
Calendar.getInstance().apply { set(1985, 9, 9) },
"Croatia",
Contract(
Calendar.getInstance().apply { set(2020, 6, 1) },
Calendar.getInstance().apply { set(2022, 6, 1) }),
"Midfielder",
10
),
Player(
11,
"Harry",
"Kane",
"H. Kane",
Calendar.getInstance().apply { set(1993, 7, 28) },
"England",
Contract(
Calendar.getInstance().apply { set(2021, 7, 1) },
Calendar.getInstance().apply { set(2025, 7, 1) }),
"Forward",
10
),
Player(
12,
"Sergio",
"Aguero",
"S. Aguero",
Calendar.getInstance().apply { set(1988, 6, 2) },
"Argentina",
Contract(
Calendar.getInstance().apply { set(2021, 6, 1) },
Calendar.getInstance().apply { set(2023, 6, 1) }),
"Forward",
10
),
Player(
13,
"Eden",
"Hazard",
"E. Hazard",
Calendar.getInstance().apply { set(1991, 1, 7) },
"Belgium",
Contract(
Calendar.getInstance().apply { set(2022, 1, 1) },
Calendar.getInstance().apply { set(2027, 1, 1) }),
"Forward",
7
),
Coach(
14,
"Pep",
"Guardiola",
"P. Guardiola",
Calendar.getInstance().apply { set(1971, 1, 18) },
"Spain",
Contract(
Calendar.getInstance().apply { set(2020, 6, 1) },
Calendar.getInstance().apply { set(2023, 6, 1) })
),
Coach(
15,
"Jurgen",
"Klopp",
"J. Klopp",
Calendar.getInstance().apply { set(1967, 6, 16) },
"Germany",
Contract(
Calendar.getInstance().apply { set(2020, 7, 1) },
Calendar.getInstance().apply { set(2024, 7, 1) })
),
Staff(
16,
"Jorge",
"Desio",
"J. Desio",
Calendar.getInstance().apply { set(1966, 1, 1) },
"Argentina",
Contract(
Calendar.getInstance().apply { set(2020, 6, 1) },
Calendar.getInstance().apply { set(2023, 6, 1) })
),
Staff(
17,
"Craig",
"Mawson",
"C. Mawson",
Calendar.getInstance().apply { set(1973, 8, 22) },
"England",
Contract(
Calendar.getInstance().apply { set(2020, 7, 1) },
Calendar.getInstance().apply { set(2024, 7, 1) })
)
)
override fun getItems(): List<Area> {
TODO("Not yet implemented")
}
private val random = Random()
val matchList: MutableList<Match> = mutableListOf()
override fun getItemById(id: Int): Area? {
TODO("Not yet implemented")
}
fun initMatches() {
matchList.add(
Match(
1,
teamList[0],
teamList[1],
Calendar.getInstance()
.apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(2, 1, "DRAW"),
competitionList[1]
)
)
matchList.add(
Match(
2,
teamList[2],
teamList[0],
Calendar.getInstance()
.apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(2, 3, "HOME_TEAM"),
competitionList[0]
)
)
matchList.add(
Match(
3,
teamList[1],
teamList[2],
Calendar.getInstance()
.apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(0, 4, "AWAY_TEAM"),
competitionList[0]
)
)
matchList.add(
Match(
4,
teamList[0],
teamList[2],
Calendar.getInstance()
.apply { set(2023, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(0, 1, "AWAY_TEAM"),
competitionList[0]
)
)
matchList.add(
Match(
5,
teamList[1],
teamList[0],
Calendar.getInstance()
.apply { set(2023, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(0, 0, "DRAW"),
competitionList[1]
)
)
matchList.add(
Match(
6,
teamList[2],
teamList[1],
Calendar.getInstance()
.apply { set(2023, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(2, 0, "HOME_TEAM"),
competitionList[0]
)
)
}
val teamList: MutableList<Team> = mutableListOf()
class StubPeopleManager : PeopleManager {
override fun getItemsByName(substring: String): List<Personne> {
TODO("Not yet implemented")
}
fun initTeams() {
teamList.add(
Team(
1,
"Paris Saint-Germain FC",
"PSG",
"https://www.psg.fr/img/DefaultOpenGraphImage.jpg?20230329",
"24 Rue du Commandant Guilbaud, 75016 Paris, France",
"https://www.psg.fr/",
"1970",
"Navy / Red",
areaList[0],
"Parc des Princes",
peopleList[13] as Coach,
listOf(peopleList[15] as Staff),
listOf(peopleList[0] as Player, peopleList[3] as Player, peopleList[11] as Player)
)
)
teamList.add(
Team(
2,
"FC Barcelona",
"BAR",
"https://crests.football-data.org/109.svg",
"Carrer d'Aristides Maillol, s/n, 08028 Barcelona, Spain",
"https://www.fcbarcelona.com/",
"1899",
"Blue / Red",
areaList[3],
"Camp Nou",
peopleList[14] as Coach,
listOf(peopleList[16] as Staff),
listOf(peopleList[2] as Player, peopleList[5] as Player, peopleList[9] as Player)
)
)
teamList.add(
Team(
3,
"Liverpool FC",
"LIV",
"https://upload.wikimedia.org/wikipedia/fr/thumb/5/54/Logo_FC_Liverpool.svg/1200px-Logo_FC_Liverpool.svg.png",
"Anfield Road, Liverpool L4 0TH, United Kingdom",
"https://www.liverpoolfc.com/",
"1892",
"Red",
areaList[2],
"Anfield",
peopleList[14] as Coach,
listOf(peopleList[15] as Staff),
listOf(peopleList[7] as Player, peopleList[8] as Player, peopleList[10] as Player)
)
)
}
val competitionList: MutableList<Competition> = mutableListOf()
fun initCompetitions() {
competitionList.add(
Competition(
1,
"Campeonato Brasileiro Série A",
"BSA",
"LEAGUE",
"https://crests.football-data.org/764.svg",
Season(
1557,
Calendar.getInstance().apply { set(2023, Calendar.MARCH, 15) },
Calendar.getInstance().apply { set(2022, Calendar.DECEMBER, 3) },
1,
null
),
areaList[2],
)
)
competitionList.add(
Competition(
2,
"Championship",
"ELC",
"LEAGUE",
"https://crests.football-data.org/PL.png",
Season(
1557,
Calendar.getInstance().apply { set(2023, Calendar.MARCH, 15) },
Calendar.getInstance().apply { set(2022, Calendar.DECEMBER, 3) },
1,
null
),
areaList[2],
)
)
}
class StubAreaManager(private val parent: StubData) : AreaManager {
override suspend fun getItemsByName(substring: String) =
parent.areaList.filter { it.name.contains(substring, ignoreCase = true) }
override suspend fun getItems(): List<Area> = parent.areaList
override fun getItems(): List<Personne> {
TODO("Not yet implemented")
}
override suspend fun getItemById(id: Int) = parent.areaList.find { it.id == id }
override fun getItemById(id: Int): Personne? {
TODO("Not yet implemented")
}
}
class StubPeopleManager(private val parent: StubData) : PeopleManager {
override suspend fun getItems() = parent.peopleList
override suspend fun getItemById(id: Int) = parent.peopleList.find { it.id == id }
}
class StubMatchesManager(private val parent: StubData) : MatchesManager {
override suspend fun getNbItemsByCompetition(id: Int) =
parent.matchList.filter { it.competition.id == id }.size
override suspend fun getItemsByCompetition(id: Int) =
parent.matchList.filter { it.competition.id == id }
class StubMatchesManager : MatchesManager {
override fun getItemsByName(substring: String): List<Match> {
TODO("Not yet implemented")
}
override suspend fun getItems(): List<Match> = parent.matchList
override fun getItems(): List<Match> {
TODO("Not yet implemented")
}
override suspend fun getItemById(id: Int) = parent.matchList.find { it.id == id }
override fun getItemById(id: Int): Match? {
TODO("Not yet implemented")
}
}
class StubCompetitionsManager(private val parent: StubData) : CompetitionsManager {
override suspend fun getItemsByName(substring: String) =
parent.competitionList.filter { it.name.contains(substring, ignoreCase = true) }
class StubCompetitionsManager : CompetitionsManager {
override fun getItemsByName(substring: String): List<Competition> {
TODO("Not yet implemented")
}
override suspend fun getItems() = parent.competitionList
override fun getItems(): List<Competition> {
TODO("Not yet implemented")
}
override suspend fun getItemById(id: Int) = parent.competitionList.find { it.id == id }
override fun getItemById(id: Int): Competition? {
TODO("Not yet implemented")
}
}
class StubTeamsManager(private val parent: StubData) : TeamsManager {
override fun getItemsByName(substring: String) =
parent.teamList.filter { it.name.contains(substring, ignoreCase = true) }
class StubTeamsManager : TeamsManager {
override fun getItemsByName(substring: String): List<Team> {
TODO("Not yet implemented")
}
override suspend fun getItems() = parent.teamList
override fun getItems(): List<Team> {
TODO("Not yet implemented")
}
override suspend fun getItemById(id: Int) = parent.teamList.find { it.id == id }
override fun getItemById(id: Int): Team? {
TODO("Not yet implemented")
}
}
}

@ -1,22 +0,0 @@
package uca.iut.clermont.data.dao
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import kotlinx.coroutines.flow.Flow
import uca.iut.clermont.model.Competition
@Dao
interface CompetitionDao {
@Delete
fun deleteCompetition(competition: Competition)
@Query("SELECT * FROM competition")
fun getAllCompetitions(): Flow<List<Competition>>
@Insert
fun insertCompetition(competition: Competition)
}

@ -0,0 +1,91 @@
package uca.iut.clermont.model
import AreaManager
import CompetitionsManager
import DataManager
import MatchesManager
import PeopleManager
import TeamsManager
class StubData : DataManager() {
override val areaMgr: AreaManager = ApiAreaManager()
override val peopleMgr: PeopleManager = ApiPeopleManager()
override val matchesMgr: MatchesManager = ApiMatchesManager()
override val competitionsMgr: CompetitionsManager = ApiCompetitionsManager()
override val teamsMgr: TeamsManager = ApiTeamsManager()
class ApiAreaManager : AreaManager {
override fun getItemsByName(substring: String): List<Area> {
TODO("Not yet implemented")
}
override fun getItems(): List<Area> {
TODO("Not yet implemented")
}
override fun getItemById(id: Int): Area? {
TODO("Not yet implemented")
}
}
class ApiPeopleManager : PeopleManager {
override fun getItemsByName(substring: String): List<Personne> {
TODO("Not yet implemented")
}
override fun getItems(): List<Personne> {
TODO("Not yet implemented")
}
override fun getItemById(id: Int): Personne? {
TODO("Not yet implemented")
}
}
class ApiMatchesManager : MatchesManager {
override fun getItemsByName(substring: String): List<Match> {
TODO("Not yet implemented")
}
override fun getItems(): List<Match> {
TODO("Not yet implemented")
}
override fun getItemById(id: Int): Match? {
TODO("Not yet implemented")
}
}
class ApiCompetitionsManager : CompetitionsManager {
override fun getItemsByName(substring: String): List<Competition> {
TODO("Not yet implemented")
}
override fun getItems(): List<Competition> {
TODO("Not yet implemented")
}
override fun getItemById(id: Int): Competition? {
TODO("Not yet implemented")
}
}
class ApiTeamsManager : TeamsManager {
override fun getItemsByName(substring: String): List<Team> {
TODO("Not yet implemented")
}
override fun getItems(): List<Team> {
TODO("Not yet implemented")
}
override fun getItemById(id: Int): Team? {
TODO("Not yet implemented")
}
}
}

@ -6,4 +6,5 @@ class Area(
val code: String,
val flag: String,
val parentArea: String
)
) {
}

@ -7,7 +7,8 @@ class Coach(
firstName: String,
lastName: String,
name: String,
dateOfBirth: Calendar,
dateOfBirth: Date,
nationality: String,
contract: Contract
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract)
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract) {
}

@ -1,16 +1,12 @@
package uca.iut.clermont.model
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity(tableName = "competitions")
class Competition(
@PrimaryKey val id: Int,
@ColumnInfo val name: String,
@ColumnInfo val code: String,
@ColumnInfo val type: String,
@ColumnInfo val emblem: String,
@ColumnInfo val currentSeason: Season,
val id: Int,
val name: String,
val code: String,
val type: String,
val emblem: String,
val currentSeason: season,
val area: Area
)
) {
}

@ -4,11 +4,11 @@ import java.util.*
import java.util.concurrent.TimeUnit
class Contract(
val start: Calendar,
val until: Calendar
val start: Date,
val until: Date
) {
fun duration(): Int {
val diffInMillis = until.timeInMillis - start.timeInMillis
return TimeUnit.DAYS.convert(diffInMillis, TimeUnit.MILLISECONDS).toInt()
val diffInMillies = until.time - start.time
return TimeUnit.DAYS.convert(diffInMillies, TimeUnit.MILLISECONDS).toInt()
}
}

@ -8,24 +8,12 @@ abstract class DataManager {
abstract val teamsMgr: TeamsManager
}
interface AreaManager : GenericDataManager<Area> {
suspend fun getItemsByName(substring: String): List<Area>
}
interface PeopleManager : GenericDataManager<Personne> {}
interface MatchesManager : GenericDataManager<Match> {
suspend fun getNbItemsByCompetition(id: Int): Int
interface AreaManager : GenericDataManager<Area>
suspend fun getItemsByCompetition(id: Int): List<Match>
interface PeopleManager : GenericDataManager<Personne>
}
interface CompetitionsManager : GenericDataManager<Competition> {
suspend fun getItemsByName(substring: String): List<Competition>
}
interface MatchesManager : GenericDataManager<Match>
interface TeamsManager : GenericDataManager<Team> {
fun getItemsByName(substring: String): List<Team>
interface CompetitionsManager : GenericDataManager<Competition>
}
interface TeamsManager : GenericDataManager<Team>

@ -1,6 +1,7 @@
package uca.iut.clermont.model
interface GenericDataManager<T> {
suspend fun getItems(): List<T>
suspend fun getItemById(id: Int): T?
fun getItemsByName(substring: String): List<T>
fun getItems(): List<T>
fun getItemById(id: Int): T?
}

@ -1,13 +1,10 @@
package uca.iut.clermont.model
import java.util.Calendar
class Match(
val id: Int,
val homeTeam: Team,
val awayTeam: Team,
val date: Calendar,
val idHomeTeam: Int,
val idAwayTeam: Int,
val status: String,
val score: Score,
val competition: Competition
)
val winner: String
) {
}

@ -1,13 +1,14 @@
package uca.iut.clermont.model
import java.util.Calendar
import java.util.Date
open class Personne(
abstract class Personne(
val id: Int,
val firstName: String,
val lastName: String,
val name: String,
val dateOfBirth: Calendar,
val dateOfBirth: Date,
val nationality: String,
val contract: Contract
)
) {
}

@ -7,9 +7,10 @@ class Player(
firstName: String,
lastName: String,
name: String,
dateOfBirth: Calendar,
dateOfBirth: Date,
nationality: String,
contract: Contract,
val position: String,
val shirtNumber: Int
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract)
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract) {
}

@ -1,7 +0,0 @@
package uca.iut.clermont.model
class Score(
val home: Int?,
val away: Int?,
val winner: String?
)

@ -1,11 +0,0 @@
package uca.iut.clermont.model
import java.util.Calendar
class Season(
val id: Int,
val startDate: Calendar,
val endDate: Calendar,
val currentMatchday: Int,
val winner: Int?
)

@ -1,13 +1,14 @@
package uca.iut.clermont.model
import java.util.Calendar
import java.util.Date
class Staff(
id: Int,
firstName: String,
lastName: String,
name: String,
dateOfBirth: Calendar,
dateOfBirth: Date,
nationality: String,
contract: Contract
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract)
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract) {
}

@ -12,6 +12,7 @@ class Team(
val area: Area,
val venue: String,
val coach: Coach,
val staff: List<Staff>,
val staff: Staff,
val squads: List<Player>
)
) {
}

@ -0,0 +1,12 @@
package uca.iut.clermont.model
import java.util.Date
class season(
val id: Int,
val startDate: Date,
val endDate: Date,
val currentMatchday: Int,
val winner: Int
) {
}

@ -1,129 +0,0 @@
package uca.iut.clermont.view
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.ImageView
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import com.bumptech.glide.Glide
import uca.iut.clermont.R
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import uca.iut.clermont.model.Competition
import uca.iut.clermont.view.adapter.MatchesAdapter
import uca.iut.clermont.view.viewModel.DetailViewModel
import java.text.SimpleDateFormat
import java.util.*
class DetailFragment : Fragment() {
private var isLiked = false
private lateinit var competition: Competition
private val viewModel: DetailViewModel by viewModels()
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_detail, container, false)
val id = arguments?.getInt("idItem")!!
viewModel.competition.observe(viewLifecycleOwner, Observer { comp ->
comp?.let {
competition = comp
initializeView(view)
initRecyclerView(view)
}
})
viewModel.loadCurrentCompetition(id)
viewModel.nbCompetitionMatches.observe(viewLifecycleOwner, Observer { comp ->
comp?.let {
initNumberMatches(view)
}
})
viewModel.competitionMatches.observe(viewLifecycleOwner, Observer { competitions ->
competitions?.let {
initRecyclerView(view)
viewModel.loadNumberMatches()
}
})
viewModel.loadMatches(id)
return view;
}
private fun initializeView(view: View) {
val button = view.findViewById<ImageButton>(R.id.buttonLike)
val buttonExit = view.findViewById<ImageButton>(R.id.buttonExit)
val imageHeader = view.findViewById<ImageView>(R.id.imageDetail)
val titleHeader = view.findViewById<TextView>(R.id.title)
val nbMatches = view.findViewById<TextView>(R.id.nbMatches)
val dateEnd = view.findViewById<TextView>(R.id.dateEnd)
val dateStart = view.findViewById<TextView>(R.id.dateStart)
buttonExit.setOnClickListener {
findNavController().navigate(R.id.favoriteFragment)
}
button.setOnClickListener {
isLiked = !isLiked
button.setImageResource(if (isLiked) R.drawable.full_like else R.drawable.empty_like)
}
Glide.with(view.context)
.load(competition.emblem)
.error(R.drawable.imagenotfound)
.into(imageHeader)
titleHeader.text = competition.name
var date = competition.currentSeason.endDate
var formatter = SimpleDateFormat("dd-MM-yyyy", Locale.US)
var formattedDate = formatter.format(date.time)
dateEnd.text = formattedDate
date = competition.currentSeason.startDate
formatter = SimpleDateFormat("dd-MM-yyyy", Locale.US)
formattedDate = formatter.format(date.time)
dateStart.text = formattedDate
}
private fun initNumberMatches(view: View) {
val nbMatches = view.findViewById<TextView>(R.id.nbMatches)
nbMatches.text = viewModel.nbCompetitionMatches.value.toString()
}
private fun initRecyclerView(view: View) {
val recyclerViewMatches = view.findViewById<RecyclerView>(R.id.listRecentsMatches)
with(recyclerViewMatches) {
layoutManager = LinearLayoutManager(view.context)
adapter = viewModel.competitionMatches.value?.toList()?.let {
MatchesAdapter(
it.toTypedArray()
)
}
}
}
}

@ -1,78 +0,0 @@
package uca.iut.clermont.view
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageButton
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import uca.iut.clermont.R
import uca.iut.clermont.model.Competition
import uca.iut.clermont.view.adapter.FavoritesAdapter
import uca.iut.clermont.view.viewModel.FavoriteViewModel
class FavoriteFragment : Fragment(), FavoritesAdapter.OnItemClickListener {
private val viewModel: FavoriteViewModel by viewModels()
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_favorite, container, false)
viewModel.competitions.observe(viewLifecycleOwner, Observer { competitions ->
competitions?.let {
initRecyclerView(view, competitions, this)
}
})
viewModel.loadCompetitions()
initializeView(view)
return view
}
private fun navigate() {
findNavController().navigate(R.id.homeFragment)
}
private fun initializeView(view: View) {
val buttonHome = view.findViewById<ImageButton>(R.id.buttonHome)
val buttonTextFavorite = view.findViewById<Button>(R.id.buttonTextHome)
buttonHome.setOnClickListener {
navigate()
}
buttonTextFavorite.setOnClickListener {
navigate()
}
}
private fun initRecyclerView(
view: View,
favorites: List<Competition>,
listener: FavoritesAdapter.OnItemClickListener
) {
val recyclerViewFavorites = view.findViewById<RecyclerView>(R.id.listFavorites)
with(recyclerViewFavorites) {
layoutManager = LinearLayoutManager(view.context)
adapter = FavoritesAdapter(favorites.toList().toTypedArray(), listener)
}
}
override fun onItemClick(position: Int) {
val competitions = viewModel.competitions.value!!
val bundle = bundleOf("idItem" to competitions[position].id)
findNavController().navigate(R.id.action_favoriteFragment_to_detailFragment, bundle)
}
}

@ -0,0 +1,14 @@
package uca.iut.clermont.view
import android.app.Activity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import uca.iut.clermont.R
class HomeActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
}
}

@ -1,72 +0,0 @@
package uca.iut.clermont.view
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import uca.iut.clermont.R
import uca.iut.clermont.model.Match
import uca.iut.clermont.view.adapter.MatchesAdapter
import uca.iut.clermont.view.viewModel.HomeViewModel
class HomeFragment : Fragment() {
val viewModel: HomeViewModel by viewModels()
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_home, container, false)
val buttonFavorite = view.findViewById<ImageButton>(R.id.buttonFavorite)
val restartMatches = view.findViewById<ImageButton>(R.id.restartMatches)
val text = view.findViewById<TextView>(R.id.textEmpty)
viewModel.matches.observe(viewLifecycleOwner, Observer { matches ->
matches?.let {
if (it.isNotEmpty()) {
initRecyclerView(view, it)
} else {
text.setText(R.string.noMatches)
}
}
})
displayMatches()
buttonFavorite.setOnClickListener {
findNavController().navigate(R.id.favoriteFragment)
}
restartMatches.setOnClickListener {
displayMatches()
}
return view
}
private fun initRecyclerView(view: View, matches: List<Match>) {
val recyclerViewMatches = view.findViewById<RecyclerView>(R.id.listRecentsMatches)
with(recyclerViewMatches) {
layoutManager = LinearLayoutManager(view.context)
adapter = MatchesAdapter(matches.toList().toTypedArray())
}
}
private fun displayMatches() {
viewModel.loadMatches()
}
}

@ -1,55 +0,0 @@
package uca.iut.clermont.view
import android.os.Build
import android.os.Bundle
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import uca.iut.clermont.R
import uca.iut.clermont.data.StubData
class MainActivity : AppCompatActivity() {
var manager = StubData()
private lateinit var navController: NavController
@RequiresApi(Build.VERSION_CODES.R)
private fun hideSystemUI() {
WindowCompat.setDecorFitsSystemWindows(window, false)
WindowInsetsControllerCompat(
window,
window.decorView.findViewById(android.R.id.content)
).let { controller ->
controller.hide(WindowInsetsCompat.Type.systemBars())
controller.systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
}
@RequiresApi(Build.VERSION_CODES.R)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
hideSystemUI()
setContentView(R.layout.activity_main)
supportActionBar?.hide()
manager.initTeams()
manager.initCompetitions()
manager.initMatches()
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.fragment) as NavHostFragment
navHostFragment.navController
}
}

@ -1,99 +0,0 @@
package uca.iut.clermont.view
import android.content.Context
import android.hardware.Sensor
import android.hardware.SensorEvent
import android.hardware.SensorEventListener
import android.hardware.SensorManager
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.ImageView
import androidx.core.view.marginStart
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import uca.iut.clermont.R
class StartFragment : Fragment(), SensorEventListener {
private lateinit var ball: ImageView
private lateinit var sensorManager: SensorManager
private var accelerometer: Sensor? = null
private var lastUpdate: Long = 0
private var xPosition = 600f
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_start, container, false)
ball = view.findViewById(R.id.ball)
sensorManager = activity?.getSystemService(Context.SENSOR_SERVICE) as SensorManager
accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER)
val buttonFavorite = view.findViewById<ImageButton>(R.id.nextButton)
buttonFavorite.setOnClickListener {
findNavController().navigate(R.id.homeFragment)
}
return view
}
override fun onResume() {
super.onResume()
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_UI)
lastUpdate = System.currentTimeMillis()
}
override fun onPause() {
super.onPause()
sensorManager.unregisterListener(this)
}
override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) {
// not used
}
override fun onSensorChanged(event: SensorEvent?) {
if (event?.sensor?.type == Sensor.TYPE_ACCELEROMETER) {
val curTime = System.currentTimeMillis()
if ((curTime - lastUpdate) > 10) {
val x = event.values[0] * 6f
val width = ball.width
val margin = ball.marginStart
val maxXPosition = (ball.parent as View).width - width - margin.toFloat()
val newXPosition = xPosition - x
if (newXPosition < 0) {
xPosition = 0f
ball.clearAnimation()
} else if (newXPosition > maxXPosition) {
xPosition = maxXPosition
ball.clearAnimation()
} else {
xPosition = newXPosition
}
val rotation = x * 5
ball.post {
val rotationDirection = if (x > 0) -1 else 1
ball.rotation = ball.rotation + rotationDirection * rotation
}
ball.x = xPosition
lastUpdate = curTime
ball.animate().x(xPosition)
}
}
}
}

@ -1,59 +0,0 @@
package uca.iut.clermont.view.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import uca.iut.clermont.R
import uca.iut.clermont.model.Competition
class FavoritesAdapter(
private val favoriteCompetition: Array<Competition>,
private val listener: OnItemClickListener,
) :
RecyclerView.Adapter<FavoritesAdapter.FavoriteHolder>() {
inner class FavoriteHolder(view: View) : RecyclerView.ViewHolder(view), View.OnClickListener {
val imageFavorites: ImageView
val textFavorites: TextView
init {
itemView.setOnClickListener(this)
imageFavorites = view.findViewById(R.id.imageFavorites)
textFavorites = view.findViewById(R.id.textFavorites)
}
override fun onClick(v: View?) {
val position = adapterPosition
listener.onItemClick(position)
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = FavoriteHolder(
LayoutInflater.from(parent.context).inflate(R.layout.cellule_favorite, parent, false)
)
override fun onBindViewHolder(holder: FavoriteHolder, position: Int) {
holder.textFavorites.text = favoriteCompetition[position].name
Glide.with(holder.itemView.context)
.load(favoriteCompetition[position].emblem)
.error(R.drawable.imagenotfound)
.into(holder.imageFavorites)
}
interface OnItemClickListener {
fun onItemClick(position: Int)
}
override fun getItemCount() = favoriteCompetition.size
}

@ -1,85 +0,0 @@
package uca.iut.clermont.view.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import uca.iut.clermont.R
import uca.iut.clermont.model.Match
import uca.iut.clermont.view.viewHolder.MatchHolder
import java.text.SimpleDateFormat
import java.util.*
class MatchesAdapter(private val recentMatches: Array<Match>) :
RecyclerView.Adapter<MatchHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = MatchHolder(
LayoutInflater.from(parent.context).inflate(R.layout.cellule_match, parent, false)
)
override fun onBindViewHolder(holder: MatchHolder, position: Int) {
holder.titleFirstTeam.text = recentMatches[position].homeTeam.name
holder.titleSecondTeam.text = recentMatches[position].awayTeam.name
if (recentMatches[position].score.home != null) {
holder.scoreHomeTeam.text = recentMatches[position].score.home.toString()
} else {
holder.scoreHomeTeam.text = "0"
}
if (recentMatches[position].score.away != null) {
holder.scoreAwayTeam.text = recentMatches[position].score.away.toString()
} else {
holder.scoreAwayTeam.text = "0"
}
val date = recentMatches[position].date
val formatter = SimpleDateFormat("dd/MM/yyyy' 'HH:mm", Locale.US)
val formattedDate = formatter.format(date.time)
with(holder.iconStatus) {
setImageResource(R.drawable.mi_temp)
layoutParams.width = 0
layoutParams.height = 0
(layoutParams as ViewGroup.MarginLayoutParams).apply {
topMargin = 8
bottomMargin = 7
}
}
if (recentMatches[position].status == "IN_PLAY") {
with(holder.iconStatus) {
setImageResource(R.drawable.live)
layoutParams.width = 130
layoutParams.height = 130
(layoutParams as ViewGroup.MarginLayoutParams).apply {
topMargin = 0
bottomMargin = 0
}
}
}
if (recentMatches[position].status == "PAUSED") {
with(holder.iconStatus) {
setImageResource(R.drawable.mi_temp)
layoutParams.width = 100
layoutParams.height = 100
}
}
holder.dateCompetition.text =
recentMatches[position].competition.name.plus(" : ").plus(formattedDate)
Glide.with(holder.itemView.context)
.load(recentMatches[position].homeTeam.crest)
.error(R.drawable.imagenotfound)
.into(holder.imageHomeTeam)
Glide.with(holder.itemView.context)
.load(recentMatches[position].awayTeam.crest)
.error(R.drawable.imagenotfound)
.into(holder.imageAwayTeam)
}
override fun getItemCount() = recentMatches.size
}

@ -1,32 +0,0 @@
package uca.iut.clermont.view.viewHolder
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import uca.iut.clermont.R
class MatchHolder(view: View) : RecyclerView.ViewHolder(view) {
val titleFirstTeam: TextView
val titleSecondTeam: TextView
val scoreHomeTeam: TextView
val scoreAwayTeam: TextView
val imageHomeTeam: ImageView
val imageAwayTeam: ImageView
val iconStatus: ImageView
val dateCompetition: TextView
init {
titleFirstTeam = view.findViewById(R.id.TitleFirstTeam)
titleSecondTeam = view.findViewById(R.id.TitleSecondTeam)
scoreHomeTeam = view.findViewById(R.id.ScoreHomeTeam)
scoreAwayTeam = view.findViewById(R.id.ScoreAwayTeam)
imageHomeTeam = view.findViewById(R.id.ImageFirstTeam)
imageAwayTeam = view.findViewById(R.id.ImageSecondTeam)
dateCompetition = view.findViewById(R.id.DateCompetition)
iconStatus = view.findViewById(R.id.iconStatus)
}
}

@ -1,45 +0,0 @@
package uca.iut.clermont.view.viewModel
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch
import uca.iut.clermont.api.ApiManager
import uca.iut.clermont.model.Competition
import uca.iut.clermont.model.Match
import java.util.*
class DetailViewModel(
//val dao: CompetitionDao
) : ViewModel() {
val manager = ApiManager()
val competition = MutableLiveData<Competition?>()
val competitionMatches = MutableLiveData<List<Match>>()
val nbCompetitionMatches = MutableLiveData<Int>()
/*fun insertCompetition(competition: Competition) =
viewModelScope.launch {
dao.insertCompetition(competition)
}
*/
fun loadCurrentCompetition(id: Int) = viewModelScope.launch {
val result = manager.competitionsMgr.getItemById(id)
competition.value = result
}
fun loadMatches(id: Int) = viewModelScope.launch {
val matchResults = manager.matchesMgr.getItemsByCompetition(id)
competitionMatches.value =
matchResults.filter { it.status != "TIMED" && it.status != "SCHEDULED" && it.status != "POSTPONED" }
.apply { forEach { it.date.add(Calendar.HOUR_OF_DAY, 2) } }
.sortedBy { it.competition.name }
.sortedByDescending { it.date }
}
fun loadNumberMatches() = viewModelScope.launch {
nbCompetitionMatches.value = competitionMatches.value?.size
}
}

@ -1,25 +0,0 @@
package uca.iut.clermont.view.viewModel
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch
import uca.iut.clermont.api.ApiManager
import uca.iut.clermont.model.Competition
class FavoriteViewModel(
//val dao: CompetitionDao
) : ViewModel() {
val manager = ApiManager()
val competitions = MutableLiveData<List<Competition>>()
//fun getAllCompetitions() = dao.getAllCompetitions()
//.isLiveDate()
fun loadCompetitions() = viewModelScope.launch {
val result = manager.competitionsMgr.getItems()
competitions.value = result
}
}

@ -1,24 +0,0 @@
package uca.iut.clermont.view.viewModel
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch
import uca.iut.clermont.api.ApiManager
import uca.iut.clermont.model.Match
import java.util.*
class HomeViewModel : ViewModel() {
val manager = ApiManager()
val matches = MutableLiveData<List<Match>?>()
fun loadMatches() = viewModelScope.launch {
val matchResults = manager.matchesMgr.getItems()
matches.value = matchResults.filter { it.status != "TIMED" }
.apply { forEach { it.date.add(Calendar.HOUR_OF_DAY, 2) } }
.sortedBy { it.competition.name }
.sortedByDescending { it.date }
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 B

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="12dp" />
<stroke
android:width="2dp"
android:color="#F2E7FC" />
<solid android:color="@android:color/transparent" />
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
android:paddingVertical="30dp"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:id="@+id/exitContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageButton
android:id="@+id/buttonHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:src="@drawable/arrow"
android:contentDescription="@string/imageNotFound" />
<Button
android:id="@+id/buttonTextHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:fontFamily="@font/mulish_bold"
android:text="Exit"
android:textAllCaps="false"
android:textColor="@color/title"
android:textSize="26dp" />
</LinearLayout>
<TextView
android:id="@+id/textFavorites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mulish_black"
android:text="Favoris"
android:textColor="@color/title"
android:textSize="30dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/exitContainer" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listFavorites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textFavorites" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:paddingHorizontal="30dp">
<FrameLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"
android:textColor="@color/title"
android:textSize="20sp"
android:textStyle="bold" />
<ImageButton
android:id="@+id/buttonFavorite"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_gravity="end"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:src="@drawable/icon_like"
android:contentDescription="@string/imageNotFound" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/textViewSubtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/mulish_black"
android:text="Welcome Back!"
android:textColor="@color/title"
android:textSize="28sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header" />
<LinearLayout
android:id="@+id/searchBarContainer"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:background="@drawable/background"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:contentDescription="search icon"
android:src="@drawable/search" />
<EditText
android:id="@+id/searchBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:background="@android:color/transparent"
android:drawablePadding="8dp"
android:hint="Search for a league, team, etc."
android:inputType="text"
android:maxLines="1"
android:textColorHint="#B0B0B0"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:orientation="vertical">
<TextView
android:id="@+id/textViewRecentMatches"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Recent Matches"
android:textColor="@color/title"
android:textSize="30dp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchBarContainer" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listRecentsMatches"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewRecentMatches"
tools:itemCount="10" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
tools:context=".view.HomeActivity">
<TextView
android:id="@+id/textViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="Hello Varun"
android:textColor="@color/title"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textViewSubtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/mulish_black"
android:text="Welcome Back!"
android:textColor="@color/title"
android:textSize="28sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewTitle" />
<LinearLayout
android:id="@+id/searchBarContainer"
android:layout_width="0dp"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:background="@drawable/background"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewSubtitle">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:contentDescription="search icon"
android:src="@drawable/search" />
<EditText
android:id="@+id/searchBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:background="@android:color/transparent"
android:drawablePadding="8dp"
android:hint="Search for a league, team, etc."
android:inputType="text"
android:maxLines="1"
android:textColorHint="#B0B0B0"
android:textSize="15dp" />
</LinearLayout>
<TextView
android:id="@+id/textViewRecentMatches"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Recent Matches"
android:textColor="@color/title"
android:textSize="20dp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchBarContainer" />
<LinearLayout
android:id="@+id/CardContainer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/background"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingHorizontal="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewRecentMatches">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:ellipsize="end"
android:fontFamily="@font/mulish_bold"
android:maxLines="1"
android:text="Champions League - Groupe Stage: Matchay"
android:textColor="@color/title"
android:textSize="14dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/ImageFirstTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:text="Fluminense FC"
android:textAlignment="center"
android:textSize="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mulish_black"
android:text="2-1"
android:textColor="@color/title"
android:textSize="43dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/mulish_extrabold"
android:maxLines="2"
android:text="Full-time"
android:textAlignment="center"
android:textColor="@color/title"
android:textSize="18dp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/ImageSecondTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:text="CA Mineiro"
android:textAlignment="center"
android:textSize="16dp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="20dp"
android:background="#E1DFDF" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.MainActivity">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
android:layout_height="0dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/my_nav" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/border_rounded"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageFavorites"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="10dp"
android:contentDescription="@string/imageNotFound"/>
<TextView
android:id="@+id/textFavorites"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/mulish_bold"
android:maxLines="3"
android:textColor="@color/black"
android:textSize="18sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,157 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@drawable/background"
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iconStatus"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginBottom="7dp"
android:contentDescription="@string/imageNotFound" />
</FrameLayout>
<TextView
android:id="@+id/DateCompetition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:ellipsize="end"
android:fontFamily="@font/mulish_bold"
android:maxLines="1"
android:textColor="@color/title"
android:textSize="15sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:baselineAligned="false"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/ImageFirstTeam"
android:layout_width="60dp"
android:layout_height="60dp" />
<TextView
android:id="@+id/TitleFirstTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal">
<TextView
android:id="@+id/ScoreHomeTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mulish_black"
android:textColor="@color/title"
android:textSize="37sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mulish_black"
android:text="-"
android:textColor="@color/title"
android:textSize="37sp" />
<TextView
android:id="@+id/ScoreAwayTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mulish_black"
android:textColor="@color/title"
android:textSize="37sp" />
</LinearLayout>
<TextView
android:id="@+id/Duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/mulish_extrabold"
android:maxLines="2"
android:textColor="@color/title"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/ImageSecondTeam"
android:layout_width="60dp"
android:layout_height="60dp" />
<TextView
android:id="@+id/TitleSecondTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="20dp"
android:background="#E1DFDF" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,211 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.DetailFragment">
<ImageView
android:id="@+id/imageDetail"
android:layout_width="220dp"
android:layout_height="0dp"
android:layout_marginTop="30dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.25"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/buttonExit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:background="@android:color/transparent"
android:src="@drawable/exit_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/buttonLike"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginRight="15dp"
android:background="@android:color/transparent"
android:src="@drawable/empty_like"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:fontFamily="@font/mulish_black"
android:textColor="@color/black"
android:textSize="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageDetail" />
<TextView
android:id="@+id/currentSeason"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:fontFamily="@font/mulish_bold"
android:text="Current season"
android:textColor="@color/title"
android:textSize="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
<LinearLayout
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/currentSeason">
<LinearLayout
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/background"
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="10dp">
<TextView
android:id="@+id/dateStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:fontFamily="@font/mulish_bold"
android:maxLines="2"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="20dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E1DFDF" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:fontFamily="@font/mulish_bold"
android:maxLines="1"
android:text="Start"
android:textColor="@color/text"
android:textSize="18dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="10dp">
<TextView
android:id="@+id/nbMatches"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:fontFamily="@font/mulish_bold"
android:maxLines="1"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="26dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E1DFDF" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:fontFamily="@font/mulish_bold"
android:maxLines="1"
android:text="Number matches"
android:textColor="@color/text"
android:textSize="18dp" />
</LinearLayout>
<LinearLayout
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/background"
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="10dp">
<TextView
android:id="@+id/dateEnd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:fontFamily="@font/mulish_bold"
android:maxLines="3"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="20dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E1DFDF" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:fontFamily="@font/mulish_bold"
android:maxLines="1"
android:text="End"
android:textColor="@color/text"
android:textSize="18dp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/latestMatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/mulish_bold"
android:text="Latest Match"
android:textColor="@color/title"
android:textSize="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listRecentsMatches"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingHorizontal="30dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/latestMatch"
tools:itemCount="100" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
android:paddingVertical="30dp"
tools:context=".view.FavoriteFragment">
<LinearLayout
android:id="@+id/exitContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageButton
android:id="@+id/buttonHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:src="@drawable/arrow"
android:contentDescription="@string/imageNotFound" />
<Button
android:id="@+id/buttonTextHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:fontFamily="@font/mulish_bold"
android:text="Exit"
android:textAllCaps="false"
android:textColor="@color/title"
android:textSize="26dp" />
</LinearLayout>
<TextView
android:id="@+id/textFavorites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:fontFamily="@font/mulish_black"
android:text="Favoris"
android:textColor="@color/title"
android:textSize="30dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/exitContainer" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listFavorites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textFavorites" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,132 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
tools:context=".view.HomeFragment">
<FrameLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"
android:textColor="@color/title"
android:textSize="20sp"
android:textStyle="bold" />
<ImageButton
android:id="@+id/buttonFavorite"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_gravity="end"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:src="@drawable/icon_like"
android:contentDescription="@string/imageNotFound" />
</FrameLayout>
<TextView
android:id="@+id/textViewSubtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/mulish_black"
android:text="Welcome Back!"
android:textColor="@color/title"
android:textSize="28sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header" />
<LinearLayout
android:id="@+id/searchBarContainer"
android:layout_width="0dp"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:background="@drawable/background"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewSubtitle">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:contentDescription="search icon"
android:src="@drawable/search" />
<EditText
android:id="@+id/searchBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:background="@android:color/transparent"
android:drawablePadding="8dp"
android:hint="Search for a league, team, etc."
android:inputType="text"
android:maxLines="1"
android:textColorHint="#B0B0B0"
android:textSize="15dp" />
</LinearLayout>
<TextView
android:id="@+id/textViewRecentMatches"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Recent Matches Day"
android:textColor="@color/title"
android:textSize="20dp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchBarContainer" />
<ImageButton
android:id="@+id/restartMatches"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="20dp"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:src="@drawable/restart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/searchBarContainer" />
<TextView
android:id="@+id/textEmpty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/title"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewRecentMatches" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listRecentsMatches"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingBottom="200dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewRecentMatches"
tools:itemCount="10" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/ball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ball"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/imageNotFound" />
<ImageView
android:id="@+id/shadow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/shadow"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ball" />
<LinearLayout
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/shadow">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mulish_black"
android:text="Continuer"
android:textColor="@color/title"
android:textSize="32sp" />
<ImageButton
android:id="@+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@android:color/transparent"
android:src="@drawable/button_next" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/my_nav"
app:startDestination="@id/startFragment">
<fragment
android:id="@+id/startFragment"
android:name="uca.iut.clermont.view.StartFragment"
android:label="StartFragment">
<action
android:id="@+id/action_startFragment_to_detailFragment"
app:destination="@id/homeFragment" />
</fragment>
<fragment
android:id="@+id/homeFragment"
android:name="uca.iut.clermont.view.HomeFragment"
android:label="HomeFragment">
<action
android:id="@+id/action_homeFragment_to_favoriteFragment"
app:destination="@id/favoriteFragment" />
</fragment>
<fragment
android:id="@+id/favoriteFragment"
android:name="uca.iut.clermont.view.FavoriteFragment"
android:label="FavoriteFragment">
<action
android:id="@+id/action_favoriteFragment_to_homeFragment"
app:destination="@id/homeFragment" />
<action
android:id="@+id/action_favoriteFragment_to_detailFragment"
app:destination="@id/detailFragment" />
</fragment>
<fragment
android:id="@+id/detailFragment"
android:name="uca.iut.clermont.view.DetailFragment"
android:label="DetailFragment">
<action
android:id="@+id/action_detailFragment_to_favoriteFragment"
app:destination="@id/favoriteFragment" />
</fragment>
</navigation>

@ -1,7 +1,3 @@
<resources>
<string name="app_name">Scor_It</string>
<string name="noMatches">No games started yet!</string>
<string name="imageNotFound">Image not found</string>
<string name="hello">Hello</string>
</resources>

@ -1,8 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

@ -11,7 +11,7 @@ import org.junit.Assert.*
*/
class ExampleUnitTest {
@Test
fun additionIsCorrect() {
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
Loading…
Cancel
Save