Merge pull request 'FavoritePage' (#2) from FavoritePage into master
continuous-integration/drone/push Build is passing Details

Reviewed-on: #2
Stub_RecycleViewV2
Emre KARTAL 2 years ago
commit 464f9c9b7e

@ -9,9 +9,10 @@
---
  ![Android](https://img.shields.io/badge/Android-3DDC84?style=for-the-badge&logo=android&logoColor=white)
  ![XML](https://img.shields.io/badge/XML-000?style=for-the-badge&logoColor=white&color=yellow&textColor=white)
  ![Kotlin](https://img.shields.io/badge/Kotlin-0095D5?&style=for-the-badge&logo=kotlin&logoColor=white)
<br/>
&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)
@ -204,10 +205,15 @@ StubManager --|> DataManager
## :construction_worker: Technicien en charge de l'application
⚙️ Emre KARTAL
⚙️ Baptiste MARCEL
- 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/david.d_almeida">
<img src="https://codefirst.iut.uca.fr/git/avatars/6b1f2a8b8f636d8f4d315b060075578f?size=870" width="50" >
</a>
<div align = center>
© IUT - Auvergne
</div>

@ -19,9 +19,9 @@
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

@ -7,42 +7,108 @@ import MatchesManager
import PeopleManager
import TeamsManager
import uca.iut.clermont.model.*
import java.util.*
class StubData: DataManager() {
override val areaMgr: AreaManager = StubAreaManager()
override val peopleMgr: PeopleManager = StubPeopleManager()
override val areaMgr: AreaManager = StubAreaManager(this)
override val peopleMgr: PeopleManager = StubPeopleManager(this)
override val matchesMgr: MatchesManager = StubMatchesManager()
override val competitionsMgr: CompetitionsManager = StubCompetitionsManager()
override val teamsMgr: TeamsManager = StubTeamsManager()
class StubAreaManager : 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")
}
override val teamsMgr: TeamsManager = StubTeamsManager(this)
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")
)
private val peopleList = listOf(
Player(1, "Lionel", "Messi", "L. Messi", Date(1987, 6, 24), "Argentina", Contract(Date(2020, 6, 1), Date(2025, 6, 1)), "Forward", 10),
Player(2, "Cristiano", "Ronaldo", "C. Ronaldo", Date(1985, 2, 5), "Portugal", Contract(Date(2020, 7, 1), Date(2024, 7, 1)), "Forward", 7),
Player(3, "Neymar", "Jr", "Neymar", Date(1992, 2, 5), "Brazil", Contract(Date(2021, 1, 1), Date(2026, 1, 1)), "Forward", 10),
Player(4, "Kylian", "Mbappe", "K. Mbappe", Date(1998, 12, 20), "France", Contract(Date(2022, 1, 1), Date(2027, 1, 1)), "Forward", 7),
Player(5, "Mohamed", "Salah", "M. Salah", Date(1992, 6, 15), "Egypt", Contract(Date(2021, 7, 1), Date(2025, 7, 1)), "Forward", 11),
Player(6, "Kevin", "De Bruyne", "K. De Bruyne", Date(1991, 6, 28), "Belgium", Contract(Date(2021, 8, 1), Date(2026, 8, 1)), "Midfielder", 17),
Player(7, "Robert", "Lewandowski", "R. Lewandowski", Date(1988, 8, 21), "Poland", Contract(Date(2021, 1, 1), Date(2024, 1, 1)), "Forward", 9),
Player(8, "Sadio", "Mane", "S. Mane", Date(1992, 4, 10), "Senegal", Contract(Date(2022, 1, 1), Date(2026, 1, 1)), "Forward", 10),
Player(9, "Virgil", "Van Dijk", "V. Van Dijk", Date(1991, 7, 8), "Netherlands", Contract(Date(2023, 1, 1), Date(2026, 1, 1)), "Defender", 4),
Player(10, "Luka", "Modric", "L. Modric", Date(1985, 9, 9), "Croatia", Contract(Date(2020, 6, 1), Date(2022, 6, 1)), "Midfielder", 10),
Player(11, "Harry", "Kane", "H. Kane", Date(1993, 7, 28), "England", Contract(Date(2021, 7, 1), Date(2025, 7, 1)), "Forward", 10),
Player(12, "Sergio", "Aguero", "S. Aguero", Date(1988, 6, 2), "Argentina", Contract(Date(2021, 6, 1), Date(2023, 6, 1)), "Forward", 10),
Player(13, "Eden", "Hazard", "E. Hazard", Date(1991, 1, 7), "Belgium", Contract(Date(2022, 1, 1), Date(2027, 1, 1)), "Forward", 7),
Coach(14, "Pep", "Guardiola", "P. Guardiola", Date(1971, 1, 18), "Spain", Contract(Date(2020, 6, 1), Date(2023, 6, 1))),
Coach(15, "Jurgen", "Klopp", "J. Klopp", Date(1967, 6, 16), "Germany", Contract(Date(2020, 7, 1), Date(2024, 7, 1))),
Staff(16, "Jorge", "Desio", "J. Desio", Date(1966, 1, 1), "Argentina", Contract(Date(2020, 6, 1), Date(2023, 6, 1))),
Staff(17, "Craig", "Mawson", "C. Mawson", Date(1973, 8, 22), "England", Contract(Date(2020, 7, 1), Date(2024, 7, 1)))
)
private val teamList = listOf(
Team(
1,
"Paris Saint-Germain FC",
"PSG",
"https://crests.football-data.org/524.svg",
"24 Rue du Commandant Guilbaud, 75016 Paris, France",
"https://www.psg.fr/",
"1970",
"Navy / Red",
areaList[0],
"Parc des Princes",
peopleList[0] as Coach,
listOf(peopleList[2] as Staff),
listOf(peopleList[0] as Player, peopleList[3] as Player, peopleList[11] as Player)
),
Team(
2,
"FC Barcelona",
"BAR",
"https://crests.football-data.org/81.svg",
"Carrer d'Aristides Maillol, s/n, 08028 Barcelona, Spain",
"https://www.fcbarcelona.com/",
"1899",
"Blue / Red",
areaList[3],
"Camp Nou",
peopleList[0] as Coach,
listOf(peopleList[2] as Staff),
listOf(peopleList[0] as Player, peopleList[5] as Player, peopleList[9] as Player)
),
Team(
3,
"Liverpool FC",
"LIV",
"https://crests.football-data.org/64.svg",
"Anfield Road, Liverpool L4 0TH, United Kingdom",
"https://www.liverpoolfc.com/",
"1892",
"Red",
areaList[2],
"Anfield",
peopleList[1] as Coach,
listOf(peopleList[3] as Staff),
listOf(peopleList[7] as Player, peopleList[8] as Player, peopleList[10] as Player)
)
)
class StubAreaManager(private val parent: StubData) : AreaManager {
override fun getItemsByName(substring: String) =
parent.areaList.filter { it.name.contains(substring, ignoreCase = true) }
override fun getItems(): List<Area> = parent.areaList
override fun getItemById(id: Int) = parent.areaList.find { it.id == id }
}
class StubPeopleManager : PeopleManager {
override fun getItemsByName(substring: String): List<Personne> {
TODO("Not yet implemented")
}
override fun getItems(): List<Personne> {
TODO("Not yet implemented")
}
class StubPeopleManager(private val parent: StubData) : PeopleManager {
override fun getItemsByName(substring: String) =
parent.peopleList.filter { it.name.contains(substring, ignoreCase = true) }
override fun getItemById(id: Int): Personne? {
TODO("Not yet implemented")
}
override fun getItems() = parent.peopleList
override fun getItemById(id: Int) = parent.peopleList.find { it.id == id }
}
class StubMatchesManager : MatchesManager {
@ -75,18 +141,13 @@ class StubData: DataManager() {
}
class StubTeamsManager : TeamsManager {
override fun getItemsByName(substring: String): List<Team> {
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) }
override fun getItems(): List<Team> {
TODO("Not yet implemented")
}
override fun getItems() = parent.teamList
override fun getItemById(id: Int): Team? {
TODO("Not yet implemented")
}
override fun getItemById(id: Int) = parent.teamList.find { it.id == id }
}
}

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

@ -10,5 +10,4 @@ class Coach(
dateOfBirth: Date,
nationality: String,
contract: Contract
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract) {
}
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract)

@ -6,7 +6,6 @@ class Competition(
val code: String,
val type: String,
val emblem: String,
val currentSeason: season,
val currentSeason: Season,
val area: Area
) {
}
)

@ -10,5 +10,4 @@ abstract class Personne(
val dateOfBirth: Date,
val nationality: String,
val contract: Contract
) {
}
)

@ -12,5 +12,4 @@ class Player(
contract: Contract,
val position: String,
val shirtNumber: Int
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract) {
}
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract)

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

@ -10,5 +10,4 @@ class Staff(
dateOfBirth: Date,
nationality: String,
contract: Contract
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract) {
}
) : Personne(id, firstName, lastName, name, dateOfBirth, nationality, contract)

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

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

@ -1,14 +1,21 @@
package uca.iut.clermont.view
import android.app.Activity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import com.bumptech.glide.Glide
import uca.iut.clermont.R
class HomeActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
val imageFirstTeam = findViewById<ImageView>(R.id.ImageFirstTeam)
Glide.with(this)
.load("https://crests.football-data.org/1765.svg")
.error(R.drawable.imagenotfound)
.into(imageFirstTeam)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

@ -0,0 +1,13 @@
<?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>

@ -0,0 +1,79 @@
<?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.FavoriteActivity">
<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">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:fontFamily="@font/mulish_bold"
android:text="Exit"
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" />
<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_toBottomOf="@+id/textFavorites">
<ImageView
android:id="@+id/imageFavorites"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/mulish_bold"
android:maxLines="3"
android:text="Campeonato Brasileiro Série A"
android:textColor="@color/black"
android:textSize="18dp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -119,8 +119,8 @@
<ImageView
android:id="@+id/ImageFirstTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_width="60dp"
android:layout_height="60dp" />
<TextView
android:layout_width="wrap_content"
@ -171,8 +171,8 @@
<ImageView
android:id="@+id/ImageSecondTeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_width="60dp"
android:layout_height="60dp" />
<TextView
android:layout_width="wrap_content"

@ -1,19 +1,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.
-->
<?xml version="1.0" encoding="utf-8"?>
<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 addition_isCorrect() {
fun additionIsCorrect() {
assertEquals(4, 2 + 2)
}
}
Loading…
Cancel
Save