ajout dernière modif bouton retour manquant

Alexis
Alexis1663 2 years ago
parent ebbc88dd2e
commit 85f3c8ce5e

@ -5,6 +5,7 @@ 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.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -44,6 +45,14 @@ class InfoUserFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val buttonBack: Button = view.findViewById(R.id.backButton)
buttonBack.setOnClickListener {
val fragmentManager = requireActivity().supportFragmentManager
fragmentManager.beginTransaction()
.replace(R.id.homeLayout, MainFragment())
.commit()
}
// Read the SSL certificate for the request
val certificateStream : InputStream = resources.openRawResource(R.raw.sni_cloudflaressl_com)

@ -7,6 +7,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.Button
import android.widget.Spinner
class OptionFragment : Fragment() {
@ -41,5 +42,13 @@ class OptionFragment : Fragment() {
// Ne rien faire si aucun élément n'est sélectionné
}
})*/
val buttonRetour: Button = view.findViewById(R.id.backButton)
buttonRetour.setOnClickListener {
val fragmentManager = requireActivity().supportFragmentManager
fragmentManager.beginTransaction()
.replace(R.id.homeLayout, MainFragment())
.commit()
}
}
}

@ -2,6 +2,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/backButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Retour"
android:layout_margin="2mm"
/>
<LinearLayout
android:layout_width="match_parent"

@ -7,7 +7,8 @@
tools:context=".OptionFragment">
<LinearLayout
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
@ -17,24 +18,26 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5">
<Button
android:id="@+id/backButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Retour"
/>
<TextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Difficulty"/>
<Spinner
android:id="@+id/spinnerDifficulty"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="1mm"
/>
<Button
android:id="@+id/backButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Retour"
android:layout_margin="2mm"
/>
</LinearLayout>
</FrameLayout>
Loading…
Cancel
Save