1
1
package com.example.dongsan2mong.fragment
2
2
3
- import android.content.Context
4
3
import android.os.Bundle
5
4
import android.util.Log
6
5
import android.view.LayoutInflater
@@ -12,12 +11,12 @@ import com.example.dongsan2mong.adapter.HouseInfoDataAdapter
12
11
import com.example.dongsan2mong.data.HouseInfoData
13
12
import com.example.dongsan2mong.databinding.FragmentDibshomeBinding
14
13
import com.example.dongsan2mong.databinding.RowHouseinfoBinding
15
- import com.example.dongsan2mong.event.*
14
+ import com.example.dongsan2mong.event.DataEvent
16
15
import org.greenrobot.eventbus.EventBus
17
16
import org.greenrobot.eventbus.Subscribe
18
17
import org.greenrobot.eventbus.ThreadMode
19
18
20
- class DibshomeFragment : Fragment () {
19
+ class DibshomeFragment : Fragment () {
21
20
22
21
lateinit var binding: FragmentDibshomeBinding
23
22
lateinit var adapter: HouseInfoDataAdapter
@@ -38,7 +37,26 @@ class DibshomeFragment: Fragment() {
38
37
}
39
38
40
39
fun initData () {
41
-
40
+ data.add(
41
+ HouseInfoData (
42
+ type = " 월세" ,
43
+ price = " 2000/40" ,
44
+ space = " 33.05m^2" ,
45
+ area = " 서울특별시 광진구 중곡동 23" ,
46
+ roomNum = " 투룸" ,
47
+ imgURL = " https://dabang-prod-profile-image.s3.amazonaws.com/b20ec5e52785d80bff716f0e5cd97350"
48
+ )
49
+ )
50
+ data.add(
51
+ HouseInfoData (
52
+ type = " 월세" ,
53
+ price = " 500/25" ,
54
+ space = " 19.83m^2" ,
55
+ area = " 서울특별시 광진구 중곡동 23" ,
56
+ roomNum = " 원룸" ,
57
+ imgURL = " https://dabang-prod-profile-image.s3.amazonaws.com/b20ec5e52785d80bff716f0e5cd97350"
58
+ )
59
+ )
42
60
}
43
61
44
62
fun initRecyclerView () {
@@ -59,6 +77,7 @@ class DibshomeFragment: Fragment() {
59
77
binding.recyclerViewDibshome.adapter = adapter
60
78
61
79
}
80
+
62
81
override fun onResume () {
63
82
super .onResume()
64
83
try {
@@ -78,8 +97,7 @@ class DibshomeFragment: Fragment() {
78
97
fun printData (event : DataEvent ) {
79
98
if (event.int == 6 ) {
80
99
Log .d(" dataEvent" , " wishlist to dibshome" )
81
- }
82
- else if (event.int == 8 ) {
100
+ } else if (event.int == 8 ) {
83
101
Log .d(" dataEvent" , " latesthome to dibshome" )
84
102
}
85
103
}
0 commit comments