Fix all issues

-> setting and locationn to do
Système_de_proximité
Bastien JACQUELIN 2 years ago
parent 08182f9b04
commit a5c4189c92

@ -44,6 +44,9 @@ class MoviesFragment : Fragment() {
// Charge les films populaires // Charge les films populaires
loadPopularMovies() loadPopularMovies()
binding.settings.setOnClickListener {
findNavController().navigate(R.id.movies_to_sessions)
}
} }
private fun initRecyclerView() { private fun initRecyclerView() {

@ -8,9 +8,11 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Button import android.widget.Button
import android.widget.ImageButton import android.widget.ImageButton
import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
import com.bumptech.glide.Glide
import fr.iut.cinecool.API.Movie import fr.iut.cinecool.API.Movie
import fr.iut.cinecool.databinding.FragmentSessionBinding import fr.iut.cinecool.databinding.FragmentSessionBinding
import fr.iut.cinecool.model.cineViewModel import fr.iut.cinecool.model.cineViewModel
@ -34,11 +36,18 @@ class SessionFragment : Fragment() {
} }
} }
private fun init() { private fun init() {
requireView().findViewById<TextView>(R.id.title).text= sharedViewModel.cine.value!!.title requireView().findViewById<TextView>(R.id.title).text= sharedViewModel.cine.value?.title
val desc = requireView().findViewById<TextView>(R.id.description) val desc = requireView().findViewById<TextView>(R.id.description)
desc.text=sharedViewModel.cine.value!!.overview desc.text=sharedViewModel.cine.value?.overview
desc.isScrollContainer = true desc.isScrollContainer = true
desc.movementMethod = ScrollingMovementMethod() desc.movementMethod = ScrollingMovementMethod()
//requireView().findViewById<TextView>(R.id.afficheFilm).setText()=movie.poster_path val img=requireView().findViewById<ImageView>(R.id.afficheFilm)
val imageUrl = "https://image.tmdb.org/t/p/w500${sharedViewModel.cine.value?.poster_path}"
Glide.with(this.requireContext())
.load(imageUrl)
.placeholder(R.drawable.no_pictures)
.into(img)
} }
} }

@ -6,6 +6,7 @@ import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import fr.iut.cinecool.R import fr.iut.cinecool.R
import fr.iut.cinecool.API.Movie import fr.iut.cinecool.API.Movie
@ -28,13 +29,13 @@ class MovieAdapter(private var moviesList: List<Movie>) :
} }
override fun onBindViewHolder(holder: MovieViewHolder, position: Int) { override fun onBindViewHolder(holder: MovieViewHolder, position: Int) {
val movie = moviesList[position]/* val movie = moviesList[position]
val imageUrl = "https://image.tmdb.org/t/p/w500${movie.poster_path}" val imageUrl = "https://image.tmdb.org/t/p/w500${movie.poster_path}"
Glide.with(holder.itemView.context) Glide.with(holder.itemView.context)
.load(imageUrl) .load(imageUrl)
.placeholder(R.drawable.imitation_game) .placeholder(R.drawable.imitation_game)
.into(holder.imageView)*/ .into(holder.imageView)
holder.MovieName.text = movie.title holder.MovieName.text = movie.title
holder.OtherInformations.text = movie.overview holder.OtherInformations.text = movie.overview

@ -5,7 +5,48 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MoviesFragment"> tools:context=".MoviesFragment">
<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/settings"
app:layout_constraintStart_toEndOf="@+id/imageView"
tools:layout_editor_absoluteY="29dp"
tools:ignore="MissingConstraints">
<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/settings"
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"
/>
<TextView <TextView
android:id="@+id/textView" android:id="@+id/textView"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -19,12 +60,13 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerMovie" android:id="@+id/recyclerMovie"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="@+id/textView" app:layout_constraintBottom_toBottomOf="@+id/textView"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toBottomOf="@+id/imageView"
app:layout_constraintVertical_bias="1.0" /> app:layout_constraintVertical_bias="1.0" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -12,7 +12,7 @@
<ImageView <ImageView
android:id="@+id/imageView" android:id="@+id/imageView"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="150dp" android:layout_height="130dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_bias="0.0"

@ -1,60 +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">
<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>

@ -1,50 +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">
<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>

@ -9,12 +9,7 @@
android:id="@+id/CinemaFragment" android:id="@+id/CinemaFragment"
android:name="fr.iut.cinecool.CinemaFragment" android:name="fr.iut.cinecool.CinemaFragment"
android:label="Cinema Fragment" android:label="Cinema Fragment"
tools:layout="@layout/fragment_cinema"> tools:layout="@layout/fragment_cinema"/>
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/fragment_movies">
</action>
</fragment>
<fragment <fragment
android:id="@+id/fragment_movies" android:id="@+id/fragment_movies"
@ -26,6 +21,9 @@
android:id="@+id/movies_to_sessions" android:id="@+id/movies_to_sessions"
app:destination="@id/SessionFragment"> app:destination="@id/SessionFragment">
</action> </action>
<action
android:id="@+id/movies_to_cinema"
app:destination="@id/CinemaFragment" />
</fragment> </fragment>
<fragment <fragment
@ -38,19 +36,4 @@
app:destination="@id/fragment_movies" /> app:destination="@id/fragment_movies" />
</fragment> </fragment>
<fragment
android:id="@+id/moviesFragment"
android:name="fr.iut.cinecool.MoviesFragment"
android:label="Movies"
tools:layout="@layout/fragment_movies">
<action
android:id="@+id/action_moviesFragment_to_movieDetailFragment"
app:destination="@id/movieDetailFragment" />
</fragment>
<fragment
android:id="@+id/movieDetailFragment"
android:name="fr.iut.cinecool.MovieDetailFragment"
android:label="Movie Details"
tools:layout="@layout/vu_detail" />
</navigation> </navigation>
Loading…
Cancel
Save