Communication entre mes activités et fragment fonctionelle + Ajout d'un chien fonctionnel

master
LouisPerret 3 years ago
parent b8a5e6059a
commit bea9b186f5

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

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

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

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

@ -8,7 +8,6 @@
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Ouaff"
tools:targetApi="31">
@ -25,6 +24,8 @@
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity android:name=".vues.DetailActivity" android:exported="true"/>
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@ -12,6 +12,17 @@ class Stub : Chargeur {
listeChien.add(Chien("Daisy", "Chihuahua", Genre.Femele, 20, 2))
listeChien.add(Chien("Deku", "Labrador", Genre.Femele, 35,1))
listeChien.add(Chien("Louis", "Golden Retriever", Genre.Male, 40, 0))
listeChien.add(Chien("Elfe", "Dalmatien", Genre.Inconnu, 30, 1))
listeChien.add(Chien("Dexter", "Pitbull allemand", Genre.Male, 50, 3))
listeChien.add(Chien("Daisy", "Chihuahua", Genre.Femele, 20, 2))
listeChien.add(Chien("Deku", "Labrador", Genre.Femele, 35,1))
listeChien.add(Chien("Louis", "Golden Retriever", Genre.Male, 40, 0))
listeChien.add(Chien("Elfe", "Dalmatien", Genre.Inconnu, 30, 1))
listeChien.add(Chien("Dexter", "Pitbull allemand", Genre.Male, 50, 3))
listeChien.add(Chien("Daisy", "Chihuahua", Genre.Femele, 20, 2))
listeChien.add(Chien("Deku", "Labrador", Genre.Femele, 35,1))
return listeChien
}
}

@ -0,0 +1,65 @@
package fr.iut.ouaff.vues
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import fr.iut.ouaff.R
import fr.iut.ouaff.modele.metier.Genre
import fr.iut.ouaff.vues.fragment.FragmentDetail
class DetailActivity : AppCompatActivity(), FragmentDetail.ListenerDetail {
private lateinit var fragmentDetail:FragmentDetail
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_detail)
if(supportFragmentManager.findFragmentById(R.id.id_fragmentDetail) == null){
fragmentDetail = FragmentDetail(this)
supportFragmentManager.beginTransaction()
.add(R.id.id_fragmentDetail, fragmentDetail)
.commit()
}
}
companion object{
private const val NOMCHIEN:String = "nomChien"
private const val RACECHIEN:String = "raceChien"
private const val GENRECHIEN:String = "genreChien"
private const val MESURECHIEN:String = "mesureChien"
private const val AGRESSIVITECHIEN:String = "agressiviteChien"
public fun createIntent(context:Context): Intent = Intent(context, DetailActivity::class.java)
public fun getNomChien(result:Intent) = result.getStringExtra(NOMCHIEN)
public fun getRaceChien(result:Intent) = result.getStringExtra(RACECHIEN)
public fun getGenreChien(result:Intent) = result.getSerializableExtra((GENRECHIEN))
public fun getMesureChien(result:Intent) = result.getIntExtra(MESURECHIEN, 0)
public fun getAgressiviteChien(result:Intent) = result.getIntExtra(AGRESSIVITECHIEN, 0)
}
override fun ajouterChien(
nom: String?,
race: String?,
genre: Genre,
poids: Int,
agressivite: Int
) {
val data = Intent().apply {
putExtra(NOMCHIEN, nom)
putExtra(RACECHIEN, race)
putExtra(GENRECHIEN, genre)
putExtra(MESURECHIEN, poids)
putExtra(AGRESSIVITECHIEN, agressivite)
}
setResult(RESULT_OK, data)
finish()
}
}

@ -1,25 +1,52 @@
package fr.iut.ouaff.vues
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.fragment.app.Fragment
import fr.iut.ouaff.R
import fr.iut.ouaff.data.chargeur.Stub
import fr.iut.ouaff.modele.metier.Chien
import fr.iut.ouaff.modele.metier.Genre
import fr.iut.ouaff.vues.fragment.FragmentDetail
import fr.iut.ouaff.vues.fragment.FragmentMaster
class MainActivity : AppCompatActivity() {
private var listeChiens: MutableList<Chien> = Stub().charger("")
private lateinit var fragment:FragmentMaster
private var activityLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()){ result ->
if(result.resultCode == RESULT_OK){
result.data?.let { ajouterChien(
DetailActivity.getNomChien(it),
DetailActivity.getRaceChien(it),
DetailActivity.getGenreChien(it) as Genre,
DetailActivity.getMesureChien(it),
DetailActivity.getAgressiviteChien(it))
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
if(supportFragmentManager.findFragmentById(R.id.id_fragment) == null){
supportFragmentManager.beginTransaction()
.add(R.id.id_fragment, FragmentMaster(listeChiens))
.commit()
if(supportFragmentManager.findFragmentById(R.id.id_fragment) == null){
fragment = FragmentMaster(listeChiens)
supportFragmentManager.beginTransaction()
.add(R.id.id_fragment, fragment)
.commit()
}
}
override fun onStart() {
super.onStart()
fragment.getBoutonAjouterChien().setOnClickListener() { activityLauncher.launch(DetailActivity.createIntent(this)) }
}
private fun ajouterChien(nom: String?, race: String?, genre: Genre, poids: Int, agressivite: Int) {
if(nom != null && race != null) listeChiens.add(Chien(nom, race, genre, poids, agressivite))
}
}

@ -3,6 +3,7 @@ package fr.iut.ouaff.vues.adapter
import android.content.res.Resources
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import fr.iut.ouaff.R
@ -38,14 +39,13 @@ class AdapterChien(private var listeChiens:MutableList<Chien>): RecyclerView.Ada
/// setter la couleur à afficher suivant son aggressivité
// when équivalent du switch case en Java ou en C#
var color = R.color.colorNice
holder.cardViewChien.setCardBackgroundColor(ContextCompat.getColor(holder.itemView.context,
when(chienAAfficher.agressivite){
1 -> color = R.color.colorNormal
2 -> color = R.color.colorBad
3 -> color = R.color.colorAggressive
}
holder.cardViewChien.setCardBackgroundColor(ressources.getColor(color))
1 -> R.color.colorNormal
2 -> R.color.colorBad
3 -> R.color.colorAggressive
else -> R.color.colorNice
}))
}
}

@ -4,11 +4,24 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.Button
import android.widget.EditText
import android.widget.ImageButton
import android.widget.RatingBar
import android.widget.Spinner
import android.widget.Toolbar
import androidx.fragment.app.Fragment
import fr.iut.ouaff.R
import fr.iut.ouaff.modele.metier.Genre
class FragmentDetail : Fragment() {
class FragmentDetail(private var listener:ListenerDetail) : Fragment() {
private lateinit var boutonAjouterChien:ImageButton
interface ListenerDetail{
fun ajouterChien(nom: String?, race: String?, genre: Genre, poids: Int, agressivite: Int)
}
override fun onCreateView(
inflater: LayoutInflater,
@ -17,6 +30,19 @@ class FragmentDetail : Fragment() {
): View? {
var view = inflater.inflate(R.layout.fragment_detail
, container, false)
var spinnerGenre = view.findViewById<Spinner>(R.id.spinnerGenre)
spinnerGenre.adapter = ArrayAdapter<Genre>(view.context, R.layout.cellule_spinner, Genre.values())
boutonAjouterChien = view.findViewById(R.id.bouttonAjouter)
boutonAjouterChien.setOnClickListener() { listener.ajouterChien(
view.findViewById<EditText>(R.id.textFieldNomChien).text.toString(),
view.findViewById<EditText>(R.id.textFieldRaceChien).text.toString(),
spinnerGenre.selectedItem as Genre,
view.findViewById<EditText>(R.id.textFieldMesureChien).text.toString().toInt(),
view.findViewById<RatingBar>(R.id.ratingBarAgressivite).rating.toInt())
}
return view
}
}

@ -4,25 +4,33 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.floatingactionbutton.FloatingActionButton
import fr.iut.ouaff.R
import fr.iut.ouaff.modele.metier.Chien
import fr.iut.ouaff.vues.adapter.AdapterChien
class FragmentMaster(private var listeChiens: MutableList<Chien>) : Fragment() {
private lateinit var boutonAjouterChien: FloatingActionButton
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_master, container);
val view = inflater.inflate(R.layout.fragment_master, container, false);
val recyclerView = view.findViewById<RecyclerView>(R.id.recyclerViewChien);
//recyclerView.layoutManager = GridLayoutManager(context, 2, GridLayoutManager.VERTICAL, false)
recyclerView.layoutManager = GridLayoutManager(context, 2, GridLayoutManager.VERTICAL, false)
recyclerView.adapter = AdapterChien(listeChiens)
return super.onCreateView(inflater, container, savedInstanceState)
boutonAjouterChien = view.findViewById(R.id.floatingActionButton)
return view
}
public fun getBoutonAjouterChien() = boutonAjouterChien
}

@ -1,30 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

@ -0,0 +1,43 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="47.625"
android:viewportWidth="47.625">
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="m24.08,45.6c4.68,-0.08 9.76,-0.44 13.6,-3.43 3.15,-2.62 3.73,-7.22 2.72,-10.98 -1.86,-7.54 -9.73,-12.82 -17.39,-12.16 -6.89,0.38 -13.57,5.25 -15.23,12.09 -1.01,3.72 -0.5,8.25 2.57,10.9 3.75,3.2 9.03,3.46 13.73,3.58"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeLineCap="butt"
android:strokeLineJoin="miter"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M16.57,6.94m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M31.08,6.92m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M6.89,16.59m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M40.74,16.59m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/>
</vector>

@ -0,0 +1,49 @@
<vector android:height="105dp" android:viewportHeight="105.9596"
android:viewportWidth="151.06255" android:width="150dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#ffecb2"
android:pathData="M116.4,23.99m-23.99,0a23.99,23.99 0,1 1,47.97 0a23.99,23.99 0,1 1,-47.97 0"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.96375841"/>
<path android:fillAlpha="1" android:fillColor="#586a7e"
android:pathData="M-0,21.1h119.63v8.52h-119.63z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="1"/>
<path android:fillAlpha="1" android:fillColor="#92a7bd"
android:pathData="M3.22,29.62h113.19v4.27h-113.19z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="1"/>
<path android:fillAlpha="1" android:fillColor="#abc0d7"
android:pathData="M3.22,33.89h113.19v72.07h-113.19z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="1"/>
<path android:fillAlpha="1" android:fillColor="#586a7e"
android:pathData="m59.82,60.13a24.29,22.07 0,0 0,-24.29 22.07,24.29 22.07,0 0,0 0,0v23.76h48.59L84.11,82.2a24.29,22.07 0,0 0,0 -0,24.29 22.07,0 0,0 -24.29,-22.07z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="1.18381763"/>
<path android:fillAlpha="1" android:fillColor="#2b3d4d"
android:pathData="m59.82,64.43a20,20 0,0 0,-20 20,20 20,0 0,0 0,0L39.82,105.96L79.82,105.96L79.82,84.43a20,20 0,0 0,0 -0,20 20,0 0,0 -20,-20z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="1.02245367"/>
<path android:fillAlpha="1" android:fillColor="#22303d"
android:pathData="M39.82,105.96L79.82,105.96L79.82,86.84Z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="0.26458332"/>
<path android:fillAlpha="1" android:fillColor="#586a7e"
android:pathData="m59.91,54.99c1.73,-0.03 3.6,-0.16 5.01,-1.26 1.16,-0.96 1.38,-2.66 1,-4.05 -0.69,-2.78 -3.59,-4.72 -6.41,-4.48 -2.54,0.14 -5,1.94 -5.61,4.46 -0.37,1.37 -0.18,3.04 0.95,4.02 1.38,1.18 3.33,1.27 5.06,1.32"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="0.06586754"/>
<path android:fillAlpha="1" android:fillColor="#586a7e"
android:pathData="M57.15,40.74m-1.8,0a1.8,1.8 0,1 1,3.61 0a1.8,1.8 0,1 1,-3.61 0"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.06586754"/>
<path android:fillAlpha="1" android:fillColor="#586a7e"
android:pathData="M62.49,40.73m-1.8,0a1.8,1.8 0,1 1,3.61 0a1.8,1.8 0,1 1,-3.61 0"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.06586754"/>
<path android:fillAlpha="1" android:fillColor="#586a7e"
android:pathData="M53.58,44.3m-1.8,0a1.8,1.8 0,1 1,3.61 0a1.8,1.8 0,1 1,-3.61 0"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.06586754"/>
<path android:fillAlpha="1" android:fillColor="#586a7e"
android:pathData="M66.05,44.3m-1.8,0a1.8,1.8 0,1 1,3.61 0a1.8,1.8 0,1 1,-3.61 0"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.06586754"/>
<path android:fillAlpha="1" android:fillColor="#a3b7ce"
android:pathData="m105,84.86c-2.55,0.11 -4.55,2.32 -4.8,4.78 -1.19,5.44 -2.38,10.88 -3.57,16.32h19.79L116.41,84.86Z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="0.27995262"/>
<path android:fillAlpha="1" android:fillColor="#bfd9f5"
android:pathData="m106.03,86.02c-2.41,0.11 -4.3,2.2 -4.54,4.52 -1.13,5.14 -2.25,10.28 -3.38,15.42 17.65,0 35.3,0 52.95,0 -1.15,-5.47 -2.28,-10.94 -3.43,-16.4 -0.59,-2.4 -3.1,-3.82 -5.47,-3.54 -12.04,0 -24.09,0 -36.13,0z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="0.26458332"/>
</vector>

@ -0,0 +1,48 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="1.3170898"
android:scaleY="1.3170898"
android:translateX="22.6368"
android:translateY="22.6368">
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="m24.08,45.6c4.68,-0.08 9.76,-0.44 13.6,-3.43 3.15,-2.62 3.73,-7.22 2.72,-10.98 -1.86,-7.54 -9.73,-12.82 -17.39,-12.16 -6.89,0.38 -13.57,5.25 -15.23,12.09 -1.01,3.72 -0.5,8.25 2.57,10.9 3.75,3.2 9.03,3.46 13.73,3.58"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeLineCap="butt"
android:strokeLineJoin="miter"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M16.57,6.94m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M31.08,6.92m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M6.89,16.59m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
<path
android:fillAlpha="1"
android:fillColor="#FFFFFFFF"
android:pathData="M40.74,16.59m-4.9,0a4.9,4.9 0,1 1,9.79 0a4.9,4.9 0,1 1,-9.79 0"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeWidth="0.17870538" />
</group>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#727272"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#727272"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
</vector>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/id_fragmentDetail">
</FrameLayout>
</LinearLayout>

@ -4,8 +4,8 @@
android:layout_height="match_parent">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/id_fragment"/>
</LinearLayout>

@ -1,23 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/cardViewChien">
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardViewChien"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/margin_dog_card"
android:layout_marginStart="@dimen/margin_dog_card"
android:layout_marginLeft="@dimen/margin_dog_card"
android:layout_marginRight="@dimen/margin_dog_card"
app:cardCornerRadius="@dimen/margin_dog_card">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:adjustViewBounds="true">
<TextView
android:id="@+id/nomChien"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/nomChien"/>
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:gravity="center_horizontal"
android:text="Miss Chiwa"
android:textAlignment="center"
android:textColor="@color/colorPrimaryText"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/raceChien"/>
android:id="@+id/raceChien"
android:text="Chiwaua"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:textColor="@color/colorSecondaryText"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="5dp">
</TextView>

@ -5,7 +5,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/bouttonAjouter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_done"
tools:ignore="SpeakableTextPresentCheck" />
<RatingBar
android:id="@+id/ratingBarAgressivite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="3"
@ -28,7 +38,7 @@
<Spinner
android:id="@+id/spinner"
android:id="@+id/spinnerGenre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="Genre"
@ -55,7 +65,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="Nom"
android:hint="Race"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="@id/raceChien"
app:layout_constraintLeft_toRightOf="@+id/barrier"
@ -69,9 +79,9 @@
android:layout_marginTop="56dp"
android:text="Aggressivité"
android:textColor="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@+id/mesureChien"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/barrier"/>
app:layout_constraintRight_toLeftOf="@id/barrier"
app:layout_constraintTop_toBottomOf="@+id/mesureChien" />
<TextView
android:id="@+id/mesureChien"
@ -80,9 +90,9 @@
android:layout_marginTop="56dp"
android:text="Mesure"
android:textColor="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@+id/genreChien"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/barrier"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintTop_toBottomOf="@+id/genreChien" />
<TextView
android:id="@+id/genreChien"
@ -91,9 +101,9 @@
android:layout_marginTop="58dp"
android:text="Genre"
android:textColor="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@+id/raceChien"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/barrier"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintTop_toBottomOf="@+id/raceChien" />
<TextView
android:id="@+id/raceChien"
@ -102,8 +112,8 @@
android:layout_marginTop="16dp"
android:textColor="@color/colorPrimary"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nomChien"
app:layout_constraintRight_toLeftOf="@id/barrier"/>
app:layout_constraintRight_toLeftOf="@id/barrier"
app:layout_constraintTop_toBottomOf="@+id/nomChien" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
@ -113,8 +123,7 @@
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintStart_toEndOf="@+id/nomChien"
app:layout_constraintTop_toTopOf="parent"
/>
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/nomChien"
@ -124,13 +133,14 @@
android:text="Identité"
android:textColor="@color/colorPrimary"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar"
app:layout_constraintRight_toLeftOf="@id/barrier"/>
app:layout_constraintRight_toLeftOf="@id/barrier"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="right"
app:constraint_referenced_ids="nomChien,genreChien,mesureChien,agressiviteChien" />
app:constraint_referenced_ids="nomChien,genreChien,mesureChien,agressiviteChien"
tools:layout_editor_absoluteX="78dp" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,14 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:clickable="true"
app:backgroundTint="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_add_pet"
tools:ignore="SpeakableTextPresentCheck"
android:layout_margin="10dp"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
android:orientation="vertical"
android:id="@+id/recyclerViewChien"/>
android:id="@+id/recyclerViewChien"
android:layout_margin="10dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="margin_dog_card">10dp</dimen>
<dimen name="title_dog_name">20sp</dimen>
</resources>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FF2424</color>
</resources>
Loading…
Cancel
Save