Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElBuenoPeso
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matis SPINELLI
ElBuenoPeso
Commits
b716a458
Commit
b716a458
authored
Feb 21, 2024
by
m-spi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrections des XML
parent
d1ee753c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
20 deletions
+16
-20
AddFragment.kt
...c/main/java/com/example/elbuenopeso/ui/add/AddFragment.kt
+10
-13
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-2
fragment_add.xml
app/src/main/res/layout/fragment_add.xml
+2
-2
fragment_market.xml
app/src/main/res/layout/fragment_market.xml
+2
-2
fragment_menu.xml
app/src/main/res/layout/fragment_menu.xml
+1
-1
No files found.
app/src/main/java/com/example/elbuenopeso/ui/add/AddFragment.kt
View file @
b716a458
...
...
@@ -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
camera
Button
=
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
}
...
...
app/src/main/res/layout/activity_main.xml
View file @
b716a458
...
...
@@ -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"
...
...
app/src/main/res/layout/fragment_add.xml
View file @
b716a458
...
...
@@ -18,7 +18,7 @@
android:id=
"@+id/image"
android:layout_width=
"300dp"
android:layout_height=
"300dp"
android:layout_marginTop=
"1
00
dp"
android:layout_marginTop=
"1
6
dp"
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/
b
utton"
android:id=
"@+id/
sendB
utton"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
...
...
app/src/main/res/layout/fragment_market.xml
View file @
b716a458
...
...
@@ -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"
/>
...
...
app/src/main/res/layout/fragment_menu.xml
View file @
b716a458
...
...
@@ -15,7 +15,7 @@
android:paddingHorizontal=
"20dp"
>
<Button
android:id=
"@+id/
b
utton"
android:id=
"@+id/
sendB
utton"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment