Commit b716a458 authored by m-spi's avatar m-spi

Corrections des XML

parent d1ee753c
......@@ -4,16 +4,13 @@ import android.app.Activity
import android.content.Intent
import android.graphics.Bitmap
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.provider.MediaStore
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.ImageView
import androidx.activity.result.ActivityResultCallback
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.fragment.app.Fragment
......@@ -29,15 +26,15 @@ class AddFragment : Fragment() {
// onDestroyView.
private val binding get() = _binding!!
lateinit var camera_open_id: ImageButton
lateinit var click_image_id: ImageView
private lateinit var cameraButton: ImageButton
private lateinit var image: ImageView
private val galleryActivityResultLauncher: ActivityResultLauncher<Intent> =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
result -> run {
if (result.resultCode == Activity.RESULT_OK) {
val image = result?.data?.data as Uri
click_image_id.setImageURI(image)
this.image.setImageURI(image)
}
}
}
......@@ -47,7 +44,7 @@ class AddFragment : Fragment() {
result -> run {
if (result.resultCode == Activity.RESULT_OK) {
val image = result.data?.extras?.get("data") as Bitmap?
click_image_id.setImageBitmap(image)
this.image.setImageBitmap(image)
}
}
}
......@@ -63,8 +60,8 @@ class AddFragment : Fragment() {
_binding = FragmentAddBinding.inflate(inflater, container, false)
val root: View = binding.root
click_image_id = binding.image
camera_open_id = binding.cameraButton
image = binding.image
cameraButton = binding.cameraButton
binding.image.setOnClickListener {
val gallery = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
......@@ -76,10 +73,10 @@ class AddFragment : Fragment() {
cameraActivityResultLauncher.launch(camera)
}
// val textView: TextView = binding.textNotifications
// notificationsViewModel.text.observe(viewLifecycleOwner) {
// textView.text = it
// }
binding.sendButton.setOnClickListener {
}
return root
}
......
......@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?attr/actionBarSize">
android:layout_height="match_parent">
<fragment
android:id="@+id/nav_host_fragment_activity_main"
......
......@@ -18,7 +18,7 @@
android:id="@+id/image"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_marginTop="100dp"
android:layout_marginTop="16dp"
android:contentDescription="@string/gallery"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -77,7 +77,7 @@
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/button"
android:id="@+id/sendButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
......
......@@ -8,8 +8,8 @@
<ListView
android:id="@+id/listView"
android:layout_width="409dp"
android:layout_height="681dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -15,7 +15,7 @@
android:paddingHorizontal="20dp">
<Button
android:id="@+id/button"
android:id="@+id/sendButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment