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
8030d4ff
Commit
8030d4ff
authored
Feb 16, 2024
by
Alutulu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pichu update
parent
78f44799
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
150 additions
and
24 deletions
+150
-24
deploymentTargetDropDown.xml
.idea/deploymentTargetDropDown.xml
+3
-0
gradle.xml
.idea/gradle.xml
+1
-0
misc.xml
.idea/misc.xml
+0
-1
MainActivity.kt
app/src/main/java/com/example/elbuenopeso/MainActivity.kt
+3
-0
AdAdapter.kt
...c/main/java/com/example/elbuenopeso/adapters/AdAdapter.kt
+35
-0
AdModel.kt
app/src/main/java/com/example/elbuenopeso/models/AdModel.kt
+4
-0
MarketFragment.kt
...va/com/example/elbuenopeso/ui/dashboard/MarketFragment.kt
+61
-0
MarketViewModel.kt
...a/com/example/elbuenopeso/ui/dashboard/MarketViewModel.kt
+1
-1
pichu.png
app/src/main/res/drawable/pichu.png
+0
-0
activity_test.xml
app/src/main/res/layout/activity_test.xml
+0
-9
fragment_market.xml
app/src/main/res/layout/fragment_market.xml
+5
-11
item_listview_ad.xml
app/src/main/res/layout/item_listview_ad.xml
+35
-0
mobile_navigation.xml
app/src/main/res/navigation/mobile_navigation.xml
+2
-2
No files found.
.idea/deploymentTargetDropDown.xml
View file @
8030d4ff
...
...
@@ -2,6 +2,9 @@
<project
version=
"4"
>
<component
name=
"deploymentTargetDropDown"
>
<value>
<entry
key=
"Basic"
>
<State
/>
</entry>
<entry
key=
"app"
>
<State
/>
</entry>
...
...
.idea/gradle.xml
View file @
8030d4ff
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"GradleMigrationSettings"
migrationVersion=
"1"
/>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
...
...
.idea/misc.xml
View file @
8030d4ff
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ExternalStorageConfigurationManager"
enabled=
"true"
/>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_17"
default=
"true"
project-jdk-name=
"jbr-17"
project-jdk-type=
"JavaSDK"
>
...
...
app/src/main/java/com/example/elbuenopeso/MainActivity.kt
View file @
8030d4ff
package
com.example.elbuenopeso
import
AdAdapter
import
android.os.Bundle
import
com.google.android.material.bottomnavigation.BottomNavigationView
import
androidx.appcompat.app.AppCompatActivity
...
...
@@ -8,6 +9,7 @@ import androidx.navigation.ui.AppBarConfiguration
import
androidx.navigation.ui.setupActionBarWithNavController
import
androidx.navigation.ui.setupWithNavController
import
com.example.elbuenopeso.databinding.ActivityMainBinding
import
com.example.elbuenopeso.models.AdModel
class
MainActivity
:
AppCompatActivity
()
{
...
...
@@ -31,5 +33,6 @@ class MainActivity : AppCompatActivity() {
)
setupActionBarWithNavController
(
navController
,
appBarConfiguration
)
navView
.
setupWithNavController
(
navController
)
}
}
\ No newline at end of file
app/src/main/java/com/example/elbuenopeso/adapters/AdAdapter.kt
0 → 100644
View file @
8030d4ff
import
android.content.Context
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.BaseAdapter
import
android.widget.ImageView
import
android.widget.TextView
import
com.example.elbuenopeso.R
import
com.example.elbuenopeso.models.AdModel
import
com.example.elbuenopeso.ui.dashboard.MarketFragment
class
AdAdapter
(
private
val
context
:
Context
,
private
val
adModelArrayList
:
List
<
AdModel
>)
:
BaseAdapter
()
{
private
val
inflater
:
LayoutInflater
=
LayoutInflater
.
from
(
context
)
override
fun
getCount
():
Int
=
adModelArrayList
.
size
override
fun
getItem
(
i
:
Int
):
Any
=
adModelArrayList
[
i
]
override
fun
getItemId
(
i
:
Int
):
Long
=
i
.
toLong
()
override
fun
getView
(
i
:
Int
,
view
:
View
?,
viewGroup
:
ViewGroup
):
View
{
var
convertView
=
view
val
ad
=
adModelArrayList
[
i
]
convertView
=
inflater
.
inflate
(
R
.
layout
.
item_listview_ad
,
viewGroup
,
false
)
val
imageIV
:
ImageView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewImageView
)
val
titleTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTitleView
)
val
addressTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTextView
)
imageIV
.
setImageResource
(
ad
.
image
)
titleTV
.
text
=
ad
.
title
addressTV
.
text
=
ad
.
address
return
convertView
}
}
\ No newline at end of file
app/src/main/java/com/example/elbuenopeso/models/AdModel.kt
0 → 100644
View file @
8030d4ff
package
com.example.elbuenopeso.models
public
class
AdModel
(
var
title
:
String
,
var
address
:
String
,
var
image
:
Int
)
{
}
\ No newline at end of file
app/src/main/java/com/example/elbuenopeso/ui/dashboard/
Dashboard
Fragment.kt
→
app/src/main/java/com/example/elbuenopeso/ui/dashboard/
Market
Fragment.kt
View file @
8030d4ff
package
com.example.elbuenopeso.ui.dashboard
import
AdAdapter
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.
Tex
tView
import
android.widget.
Lis
tView
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.ViewModelProvider
import
com.example.elbuenopeso.databinding.FragmentDashboardBinding
import
com.example.elbuenopeso.databinding.FragmentMarketBinding
import
com.example.elbuenopeso.models.AdModel
import
com.example.elbuenopeso.R
class
Dashboard
Fragment
:
Fragment
()
{
class
Market
Fragment
:
Fragment
()
{
private
var
_binding
:
Fragment
Dashboard
Binding
?
=
null
private
var
_binding
:
Fragment
Market
Binding
?
=
null
// This property is only valid between onCreateView and
// onDestroyView.
...
...
@@ -22,16 +25,32 @@ class DashboardFragment : Fragment() {
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
{
val
dashboard
ViewModel
=
ViewModelProvider
(
this
)
.
get
(
DashboardViewModel
::
class
.
java
)
val
market
ViewModel
=
ViewModelProvider
(
this
)
[
MarketViewModel
::
class
.
java
]
_binding
=
Fragment
Dashboard
Binding
.
inflate
(
inflater
,
container
,
false
)
_binding
=
Fragment
Market
Binding
.
inflate
(
inflater
,
container
,
false
)
val
root
:
View
=
binding
.
root
val
textView
:
TextView
=
binding
.
textDashboard
dashboardViewModel
.
text
.
observe
(
viewLifecycleOwner
)
{
val
listView
:
ListView
=
binding
.
listView
// seed market items
var
annonces
:
List
<
AdModel
>
=
listOf
<
AdModel
>(
AdModel
(
"Poutre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
),
AdModel
(
"Briques"
,
"2 rue Jean-Michel"
,
R
.
drawable
.
pichu
),
AdModel
(
"Mur en bois"
,
"4 rue Alain-Juju"
,
R
.
drawable
.
pichu
),
AdModel
(
"Maison de pierre"
,
"7 rue Joris Belhomme"
,
R
.
drawable
.
pichu
),
AdModel
(
"Téléphone de Timothé"
,
"8 rue de Timothé"
,
R
.
drawable
.
pichu
),
AdModel
(
"Oridnateur"
,
"10 rue Jean-Charles"
,
R
.
drawable
.
pichu
),
AdModel
(
"Charnières"
,
"22 rue Jeanne-Marie"
,
R
.
drawable
.
pichu
),
AdModel
(
"Porte en marbre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
),
AdModel
(
"Cheminée"
,
"33 rue du Gouvernement"
,
R
.
drawable
.
pichu
),
)
var
adAdapter
:
AdAdapter
=
AdAdapter
(
requireContext
(),
annonces
)
listView
.
adapter
=
adAdapter
/*marketViewModel.text.observe(viewLifecycleOwner) {
textView.text = it
}
}*/
return
root
}
...
...
app/src/main/java/com/example/elbuenopeso/ui/dashboard/
Dashboard
ViewModel.kt
→
app/src/main/java/com/example/elbuenopeso/ui/dashboard/
Market
ViewModel.kt
View file @
8030d4ff
...
...
@@ -4,7 +4,7 @@ import androidx.lifecycle.LiveData
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.ViewModel
class
Dashboard
ViewModel
:
ViewModel
()
{
class
Market
ViewModel
:
ViewModel
()
{
private
val
_text
=
MutableLiveData
<
String
>().
apply
{
value
=
"This is dashboard Fragment"
...
...
app/src/main/res/drawable/pichu.png
0 → 100644
View file @
8030d4ff
89.2 KB
app/src/main/res/layout/activity_test.xml
deleted
100644 → 0
View file @
78f44799
<?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"
tools:context=
".test"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_
dashboard
.xml
→
app/src/main/res/layout/fragment_
market
.xml
View file @
8030d4ff
...
...
@@ -4,18 +4,12 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".ui.dashboard.
Dashboard
Fragment"
>
tools:context=
".ui.dashboard.
Market
Fragment"
>
<TextView
android:id=
"@+id/text_dashboard"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"8dp"
android:textAlignment=
"center"
android:textSize=
"20sp"
app:layout_constraintBottom_toBottomOf=
"parent"
<ListView
android:id=
"@+id/listView"
android:layout_width=
"409dp"
android:layout_height=
"681dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
app/src/main/res/layout/item_listview_ad.xml
0 → 100644
View file @
8030d4ff
<?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"
>
<TextView
android:id=
"@+id/itemListViewTitleView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:text=
"TextView"
android:textSize=
"20sp"
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/itemListViewImageView"
android:layout_width=
"117dp"
android:layout_height=
"94dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:srcCompat=
"@drawable/pichu"
/>
<TextView
android:id=
"@+id/itemListViewTextView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"12dp"
android:text=
"TextView"
app:layout_constraintBottom_toBottomOf=
"@+id/itemListViewImageView"
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/navigation/mobile_navigation.xml
View file @
8030d4ff
...
...
@@ -13,9 +13,9 @@
<fragment
android:id=
"@+id/navigation_dashboard"
android:name=
"com.example.elbuenopeso.ui.dashboard.
Dashboard
Fragment"
android:name=
"com.example.elbuenopeso.ui.dashboard.
Market
Fragment"
android:label=
"@string/title_dashboard"
tools:layout=
"@layout/fragment_
dashboard
"
/>
tools:layout=
"@layout/fragment_
market
"
/>
<fragment
android:id=
"@+id/navigation_notifications"
...
...
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