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

Reviewed-on: #4
Gyroscope
Emre KARTAL 2 years ago
commit 6a449a5c13

@ -115,9 +115,7 @@ class Season {
class Match {
-id: Int
-idHomeTeam: Int
-score: Score
-idAwayTeam: Int
-status: String
}
@ -138,6 +136,9 @@ Team --> "-coach" Coach
Team --> "-squad*" Player
Team --> "-area" Area
Match --> "-HomeTeam" Team
Match --> "-AwayTeam" Team
Competition --> "-area" Area
Competition --> "-currentSeason" Season
@ -164,24 +165,27 @@ skinparam package {
hide circle
interface GenericDataManager {
+getItemsByName(substring: String) : List<T>
+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 {

@ -1,4 +0,0 @@
<changelist name="Uncommitted_changes_before_Update_at_21_03_2023_09_05_[Changes]" date="1679385937643" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_21_03_2023_09_05_[Changes]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Update at 21/03/2023 09:05 [Changes]" />
</changelist>

@ -33,8 +33,14 @@ android {
}
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'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'

@ -15,7 +15,7 @@
android:theme="@style/Theme.Scor_It"
tools:targetApi="31">
<activity
android:name=".view.HomeActivity"
android:name=".view.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

@ -13,7 +13,7 @@ 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()
override val competitionsMgr: CompetitionsManager = StubCompetitionsManager(this)
override val teamsMgr: TeamsManager = StubTeamsManager(this)
private val areaList = listOf(
@ -247,56 +247,76 @@ class StubData : DataManager() {
)
private val random = java.util.Random()
val matchList = listOf(
Match(
1,
1,
2,
Calendar.getInstance().apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(1, 1, "DRAW")
),
Match(
2,
3,
1,
Calendar.getInstance().apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(2, 0, "HOME_TEAM")
),
Match(
3,
2,
3,
Calendar.getInstance().apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(0, 4, "AWAY_TEAM")
),
Match(
4,
1,
3,
Calendar.getInstance().apply { set(2023, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(0, 1, "AWAY_TEAM")
),
Match(
5,
2,
1,
Calendar.getInstance().apply { set(2023, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(0, 0, "DRAW")
),
Match(
6,
3,
2,
Calendar.getInstance().apply { set(2023, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(2, 0, "HOME_TEAM")
val matchList: MutableList<Match> = mutableListOf()
fun initMatches() {
matchList.add(
Match(
1,
teamList[0],
teamList[1],
Calendar.getInstance()
.apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(1, 1, "DRAW")
)
)
)
matchList.add(
Match(
2,
teamList[2],
teamList[0],
Calendar.getInstance()
.apply { set(2022, random.nextInt(12), random.nextInt(28) + 1) },
"FINISHED",
Score(2, 0, "HOME_TEAM")
)
)
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")
)
)
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")
)
)
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")
)
)
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")
)
)
}
val teamList: MutableList<Team> = mutableListOf()
@ -313,8 +333,8 @@ class StubData : DataManager() {
"Navy / Red",
areaList[0],
"Parc des Princes",
peopleList[0] as Coach,
listOf(peopleList[2] as Staff),
peopleList[13] as Coach,
listOf(peopleList[15] as Staff),
listOf(peopleList[0] as Player, peopleList[3] as Player, peopleList[11] as Player)
)
)
@ -330,9 +350,9 @@ class StubData : DataManager() {
"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)
peopleList[14] as Coach,
listOf(peopleList[16] as Staff),
listOf(peopleList[2] as Player, peopleList[5] as Player, peopleList[9] as Player)
)
)
teamList.add(
@ -347,13 +367,40 @@ class StubData : DataManager() {
"Red",
areaList[2],
"Anfield",
peopleList[1] as Coach,
listOf(peopleList[3] as Staff),
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 fun getItemsByName(substring: String) =
@ -375,8 +422,6 @@ class StubData : DataManager() {
}
class StubMatchesManager(private val parent: StubData) : MatchesManager {
override fun getItemsByName(substring: String) =
throw java.lang.Exception("Don't call this function")
override fun getItems(): List<Match> = parent.matchList
@ -384,18 +429,13 @@ class StubData : DataManager() {
}
class StubCompetitionsManager : CompetitionsManager {
override fun getItemsByName(substring: String): List<Competition> {
throw java.lang.Exception("Don't call this function")
}
class StubCompetitionsManager(private val parent: StubData) : CompetitionsManager {
override fun getItemsByName(substring: String) =
parent.competitionList.filter { it.name.contains(substring, ignoreCase = true) }
override fun getItems(): List<Competition> {
throw java.lang.Exception("Don't call this function")
}
override fun getItems() = parent.competitionList
override fun getItemById(id: Int): Competition? {
throw java.lang.Exception("Don't call this function")
}
override fun getItemById(id: Int) = parent.competitionList.find { it.id == id }
}

@ -45,9 +45,6 @@ class ApiManager : DataManager() {
}
class ApiMatchesManager : MatchesManager {
override fun getItemsByName(substring: String): List<Match> {
TODO("Not yet implemented")
}
override fun getItems(): List<Match> {
TODO("Not yet implemented")

@ -9,12 +9,21 @@ abstract class DataManager {
}
interface AreaManager : GenericDataManager<Area>
interface AreaManager : GenericDataManager<Area> {
fun getItemsByName(substring: String): List<Area>
}
interface PeopleManager : GenericDataManager<Personne>
interface PeopleManager : GenericDataManager<Personne> {
fun getItemsByName(substring: String): List<Personne>
}
interface MatchesManager : GenericDataManager<Match>
interface CompetitionsManager : GenericDataManager<Competition>
interface CompetitionsManager : GenericDataManager<Competition> {
fun getItemsByName(substring: String): List<Competition>
}
interface TeamsManager : GenericDataManager<Team> {
fun getItemsByName(substring: String): List<Team>
interface TeamsManager : GenericDataManager<Team>
}

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

@ -4,8 +4,8 @@ import java.util.Calendar
class Match(
val id: Int,
val idHomeTeam: Int,
val idAwayTeam: Int,
val homeTeam: Team,
val awayTeam: Team,
val date: Calendar,
val status: String,
val score: Score

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

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

@ -0,0 +1,55 @@
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.fragment.app.Fragment
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.model.Match
import uca.iut.clermont.view.adapter.FavoritesAdapter
import uca.iut.clermont.view.adapter.MatchesAdapter
class FavoriteFragment: Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_favorite, container, false)
val competitions = (activity as MainActivity).manager.competitionsMgr.getItems()
var buttonHome = view.findViewById<ImageButton>(R.id.buttonHome)
val buttonTextFavorite = view.findViewById<Button>(R.id.buttonTextHome)
buttonHome.setOnClickListener {
navigate()
}
buttonTextFavorite.setOnClickListener {
navigate()
}
initRecyclerView(view, competitions)
return view
}
fun navigate() {
findNavController().navigate(R.id.homeFragment)
}
private fun initRecyclerView(view: View, favorites: List<Competition>) {
val recyclerViewFavorites = view.findViewById<RecyclerView>(R.id.listFavorites)
with(recyclerViewFavorites) {
layoutManager = LinearLayoutManager(view.context)
adapter = FavoritesAdapter(favorites.toList().toTypedArray())
}
}
}

@ -1,36 +0,0 @@
package uca.iut.clermont.view
import android.app.Activity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import uca.iut.clermont.R
import uca.iut.clermont.data.StubData
import uca.iut.clermont.view.adapter.MatchesAdapter
class HomeActivity : Activity() {
private var manager = StubData()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
//val imageFirstTeam = findViewById<ImageView>(R.id.ImageFirstTeam)
val adapterMatches = findViewById<RecyclerView>(R.id.ListRecentsMatches)
with(adapterMatches) {
adapter = MatchesAdapter(manager.matchesMgr.getItems().toList().toTypedArray())
}
adapterMatches.layoutManager = LinearLayoutManager(this)
adapterMatches
/*Glide.with(this)
.load("https://crests.football-data.org/1765.svg")
.error(R.drawable.imagenotfound)
.into(imageFirstTeam)*/
}
}

@ -0,0 +1,49 @@
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 androidx.fragment.app.Fragment
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
class HomeFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_home, container, false)
val matches = (activity as MainActivity).manager.matchesMgr.getItems()
val buttonFavorite = view.findViewById<ImageButton>(R.id.buttonFavorite)
buttonFavorite.setOnClickListener {
findNavController().navigate(R.id.favoriteFragment)
}
initRecyclerView(view, matches)
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())
}
}
}

@ -0,0 +1,57 @@
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.initMatches()
manager.initCompetitions()
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.fragment) as NavHostFragment
val navController = navHostFragment.navController
}
}

@ -0,0 +1,82 @@
package uca.iut.clermont.view
import android.animation.ObjectAnimator
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.ImageView
import androidx.fragment.app.Fragment
import uca.iut.clermont.R
class StartFragment : Fragment(), SensorEventListener {
private lateinit var ball: ImageView
private lateinit var sensorManager: SensorManager
private lateinit var accelerometer: Sensor
private var lastX = 0f
private var lastY = 0f
private var lastZ = 0f
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)
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_NORMAL)
return view
}
override fun onSensorChanged(event: SensorEvent) {
val x = event.values[0]
val y = event.values[1]
val z = event.values[2]
val angleX = x / 9.81f
val angleY = y / 9.81f
if (Math.abs(angleX) > 0.1) {
// Déplacer la balle à droite ou à gauche en fonction de la direction du mouvement
val deltaX = angleX * 20f // La vitesse de déplacement est de 20 pixels par seconde
ObjectAnimator.ofFloat(ball, View.TRANSLATION_X, ball.x + deltaX).start()
// Faire tourner la balle pendant qu'elle se déplace
ObjectAnimator.ofFloat(ball, View.ROTATION, -angleX * 70f).start()
}
lastX = x
lastY = y
lastZ = z
}
override fun onAccuracyChanged(sensor: Sensor, accuracy: Int) {
}
override fun onResume() {
super.onResume()
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_NORMAL)
}
override fun onPause() {
super.onPause()
sensorManager.unregisterListener(this)
}
}

@ -0,0 +1,30 @@
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.Competition
import uca.iut.clermont.view.viewHolder.FavoriteHolder
class FavoritesAdapter(private val favoriteCompetition: Array<Competition> ) : RecyclerView.Adapter<FavoriteHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FavoriteHolder {
return 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)
}
override fun getItemCount() = favoriteCompetition.size
}

@ -7,13 +7,18 @@ import uca.iut.clermont.R
import uca.iut.clermont.model.Match
import uca.iut.clermont.view.viewHolder.MatchHolder
class MatchesAdapter(val recentMatches: Array<Match>) : RecyclerView.Adapter<MatchHolder>() {
class MatchesAdapter(private val recentMatches: Array<Match>) : RecyclerView.Adapter<MatchHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MatchHolder {
return MatchHolder(LayoutInflater.from(parent.context).inflate(R.layout.cellule_match, parent, false))
return MatchHolder(
LayoutInflater.from(parent.context).inflate(R.layout.cellule_match, parent, false)
)
}
override fun onBindViewHolder(holder: MatchHolder, position: Int) {
holder.textView.text = recentMatches[position].id.toString()
holder.titleFirstTeam.text = recentMatches[position].homeTeam.name
holder.titleSecondTeam.text = recentMatches[position].awayTeam.name
holder.scoreHomeTeam.text = recentMatches[position].score.home.toString()
holder.scoreAwayTeam.text = recentMatches[position].score.away.toString()
}
override fun getItemCount() = recentMatches.size

@ -0,0 +1,17 @@
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 FavoriteHolder(view: View) : RecyclerView.ViewHolder(view) {
val imageFavorites: ImageView
val textFavorites: TextView
init {
imageFavorites = view.findViewById(R.id.imageFavorites)
textFavorites = view.findViewById(R.id.textFavorites)
}
}

@ -6,11 +6,16 @@ import androidx.recyclerview.widget.RecyclerView
import uca.iut.clermont.R
class MatchHolder(view: View) : RecyclerView.ViewHolder(view) {
val textView: TextView
val titleFirstTeam: TextView
val titleSecondTeam: TextView
val scoreHomeTeam: TextView
val scoreAwayTeam: TextView
init {
// Define click listener for the ViewHolder's View
textView = view.findViewById(R.id.TitleFirstTeam)
titleFirstTeam = view.findViewById(R.id.TitleFirstTeam)
titleSecondTeam = view.findViewById(R.id.TitleSecondTeam)
scoreHomeTeam = view.findViewById(R.id.ScoreHomeTeam)
scoreAwayTeam = view.findViewById(R.id.ScoreAwayTeam)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -0,0 +1,23 @@
<?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:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:defaultNavHost="true"
app:navGraph="@navigation/my_nav" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,8 +1,8 @@
<?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="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="350dp"
@ -22,12 +22,12 @@
android:layout_marginVertical="10dp" />
<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:text="Campeonato Brasileiro Série A"
android:textColor="@color/black"
android:textSize="18dp" />

@ -25,7 +25,7 @@
android:maxLines="1"
android:text="Champions League - Groupe Stage: Matchay"
android:textColor="@color/title"
android:textSize="14dp"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
@ -52,34 +52,56 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textSize="16dp" />
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:layout_weight="0.4"
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" />
<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:text="Full-time"
android:textColor="@color/title"
android:textSize="18dp" />
android:textSize="18sp" />
</LinearLayout>
@ -96,11 +118,12 @@
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="16dp" />
android:textSize="16sp" />
</LinearLayout>

@ -0,0 +1,6 @@
<?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">
</androidx.constraintlayout.widget.ConstraintLayout>

@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
android:paddingVertical="30dp"
tools:context=".view.FavoriteActivity">
tools:context=".view.FavoriteFragment">
<LinearLayout
android:id="@+id/exitContainer"
@ -17,19 +17,23 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
<ImageButton
android:id="@+id/buttonHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:src="@drawable/arrow" />
<TextView
<Button
android:id="@+id/buttonTextHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@android:color/transparent"
android:fontFamily="@font/mulish_bold"
android:text="Exit"
android:textColor="@color/title"
android:textSize="26dp" />
android:textSize="26dp"
android:textAllCaps="false" />
</LinearLayout>
@ -45,6 +49,13 @@
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>

@ -5,19 +5,37 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
tools:context=".view.HomeActivity">
tools:context=".view.HomeFragment">
<TextView
android:id="@+id/textViewTitle"
android:layout_width="wrap_content"
<FrameLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="Hello Varun"
android:textColor="@color/title"
android:textSize="20sp"
android:textStyle="bold"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="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="right"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:src="@drawable/icon_like" />
</FrameLayout>
<TextView
android:id="@+id/textViewSubtitle"
@ -29,7 +47,7 @@
android:textColor="@color/title"
android:textSize="28sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewTitle" />
app:layout_constraintTop_toBottomOf="@+id/header" />
<LinearLayout
android:id="@+id/searchBarContainer"
@ -78,7 +96,7 @@
app:layout_constraintTop_toBottomOf="@+id/searchBarContainer" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/ListRecentsMatches"
android:id="@+id/listRecentsMatches"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"

@ -0,0 +1,18 @@
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ball"
android:layout_centerInParent="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,34 @@
<?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_homeFragment2"
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" />
</fragment>
</navigation>
Loading…
Cancel
Save