ajout vu et detail

pull/17/head
louwar 2 years ago
parent fe8895b1ff
commit 77452aff27

@ -7,6 +7,7 @@
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="Embedded JDK" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />

@ -0,0 +1,51 @@
package fr.iut.cinecool
import android.os.Bundle
import android.widget.ImageButton
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
class DetailActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?){
super.onCreate(savedInstanceState)
setContentView(R.layout.vu_detail)
// Récupération de la référence de l'ImageButton
val backButton: ImageButton =findViewById(R.id.backButton)
// Ajout d'un listener pour gérer le clic sur le bouton
backButton.setOnClickListener{
// Code à exécuter lorsque l'utilisateur clique sur le bouton de retour
// Par exemple, pour fermer l'activité en cours et revenir à l'activité précédente :
finish()
}
// Récupération de la référence du TextView
val textView: TextView =findViewById(R.id.titreFilm)
// Modification du texte affiché dans le TextView
textView.text="Titre de la page"
// Récupération des références des ImageView
val imageView2: ImageView =findViewById(R.id.logo)
val imageView3:ImageView=findViewById(R.id.afficheFilm)
// Chargement des images à partir de fichiers ou d'Internet, par exemple :
/*Glide.with(this)
.load(R.drawable.cinema)
.into(imageView2)
Glide.with(this)
.load(R.drawable.imitation_game)
.into(imageView3)*/
// Récupération de la référence du TextView 2
val textView2:TextView=findViewById(R.id.description)
// Modification du texte affiché dans le TextView 2
textView2.text="Contenu de la page"
}
}

@ -1,18 +1,10 @@
package fr.iut.cinecool
import android.Manifest
import android.content.Intent
import android.os.Bundle
import android.widget.EditText
import android.widget.ImageView
import com.google.android.material.snackbar.Snackbar
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import fr.iut.cinecool.databinding.ActivityMainBinding
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
@ -37,3 +29,4 @@ class MainActivity : AppCompatActivity() {
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

@ -0,0 +1,60 @@
<?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">
<ImageButton
android:id="@+id/backButton"
android:layout_width="60dp"
android:layout_height="55dp"
android:scaleType="fitCenter"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/Back_arrow" />
<TextView
android:id="@+id/titreFilm"
android:layout_width="220dp"
android:layout_height="25dp"
android:layout_marginStart="20dp"
android:layout_marginTop="80dp"
android:text="TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/logo"
android:layout_width="65dp"
android:layout_height="60dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/cinema"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:scaleType="fitCenter"
/>
<ImageView
android:id="@+id/afficheFilm"
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titreFilm"
app:srcCompat="@drawable/imitation_game" />
<TextView
android:id="@+id/description"
android:layout_width="380dp"
android:layout_height="100dp"
android:layout_marginTop="25dp"
android:text="TextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/afficheFilm" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,50 @@
<?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">
<ImageView
android:id="@+id/imageView"
android:layout_width="66dp"
android:layout_height="54dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/cinema" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="211dp"
android:layout_height="27dp"
android:background="?attr/colorPrimary"
app:layout_constraintEnd_toStartOf="@+id/imageButton5"
app:layout_constraintStart_toEndOf="@+id/imageView"
tools:layout_editor_absoluteY="29dp">
<androidx.appcompat.widget.SearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:iconifiedByDefault="false"
app:queryHint="Rechercher" />
</androidx.appcompat.widget.Toolbar>
<ImageButton
android:id="@+id/imageButton5"
android:layout_width="56dp"
android:layout_height="56dp"
android:scaleType="fitCenter"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/Filtrage"
tools:layout_editor_absoluteY="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save