Skip to content

Commit 69b2a2c

Browse files
authored
πŸ”€ #59 from boostcampwm-2022/feat/community_create_running_post
πŸ› λ§ˆμ΄λŸ°μ—μ„œλ„ λ‚΄ μš΄λ™κΈ°λ‘ ν™”λ©΄ λ‚˜μ˜€λ„λ‘ μˆ˜μ •
2 parents 96d78d3 + 786c615 commit 69b2a2c

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

β€Žpresentation/src/main/java/com/whyranoid/presentation/community/runningpost/CommunityRunningHistoryAdapter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class CommunityRunningHistoryViewHolder(
3939
fun bind(runningHistory: RunningHistoryUiModel) {
4040
// μ•„μ΄ν…œμ΄ μ„ νƒλœ κ°œμ²΄μΈμ§€ 확인
4141

42+
binding.runningHistory = runningHistory
43+
4244
binding.root.setBackgroundColor(Color.TRANSPARENT)
4345

4446
binding.root.setOnClickListener {

β€Žpresentation/src/main/java/com/whyranoid/presentation/myrun/MyRunFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ internal class MyRunFragment : BaseFragment<FragmentMyRunBinding>(R.layout.fragm
9191
}
9292
is UiState.Loading -> {
9393
}
94-
is UiState.Success<List<RunningHistoryUiModel>> -> initRecyclerView(
94+
is UiState.Success<List<RunningHistoryUiModel>> -> handleRunningHistorySuccessState(
9595
runningHistoryListState.value
9696
)
9797

@@ -102,7 +102,7 @@ internal class MyRunFragment : BaseFragment<FragmentMyRunBinding>(R.layout.fragm
102102
}
103103
}
104104

105-
private fun initRecyclerView(runningHistoryList: List<RunningHistoryUiModel>) {
105+
private fun handleRunningHistorySuccessState(runningHistoryList: List<RunningHistoryUiModel>) {
106106
runningHistoryAdapter.submitList(runningHistoryList)
107107
}
108108

β€Žpresentation/src/main/java/com/whyranoid/presentation/myrun/MyRunViewModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class MyRunViewModel @Inject constructor(
3030
getUid()
3131
getNickName()
3232
getProfileImgUri()
33+
getRunningHistoryList()
3334
}
3435

3536
private val _uid = MutableStateFlow(EMPTY_STRING)

β€Žpresentation/src/main/res/layout/fragment_my_run.xml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:tools="http://schemas.android.com/tools">
55

66
<data>
7+
78
<variable
89
name="viewModel"
910
type="com.whyranoid.presentation.myrun.MyRunViewModel" />
@@ -34,16 +35,16 @@
3435
<androidx.constraintlayout.widget.ConstraintLayout
3536
android:layout_width="match_parent"
3637
android:layout_height="0dp"
37-
app:layout_constraintTop_toBottomOf="@id/tool_bar"
38-
app:layout_constraintBottom_toBottomOf="parent">
38+
app:layout_constraintBottom_toBottomOf="parent"
39+
app:layout_constraintTop_toBottomOf="@id/tool_bar">
3940

4041
<androidx.core.widget.NestedScrollView
4142
android:layout_width="match_parent"
4243
android:layout_height="match_parent"
43-
app:layout_constraintTop_toTopOf="parent"
44-
app:layout_constraintStart_toStartOf="parent"
44+
app:layout_constraintBottom_toBottomOf="parent"
4545
app:layout_constraintEnd_toEndOf="parent"
46-
app:layout_constraintBottom_toBottomOf="parent">
46+
app:layout_constraintStart_toStartOf="parent"
47+
app:layout_constraintTop_toTopOf="parent">
4748

4849
<androidx.constraintlayout.widget.ConstraintLayout
4950
android:layout_width="match_parent"
@@ -87,24 +88,24 @@
8788
android:id="@+id/tv_month_indicator"
8889
android:layout_width="wrap_content"
8990
android:layout_height="wrap_content"
90-
app:layout_constraintTop_toBottomOf="@id/iv_profile_image"
91-
app:layout_constraintStart_toStartOf="parent"
9291
android:layout_marginStart="16dp"
9392
android:layout_marginTop="16dp"
9493
android:textAppearance="@style/MoGakRunText.Bold.Medium"
95-
tools:text="11μ›”"/>
94+
app:layout_constraintStart_toStartOf="parent"
95+
app:layout_constraintTop_toBottomOf="@id/iv_profile_image"
96+
tools:text="11μ›”" />
9697

9798
<com.kizitonwose.calendarview.CalendarView
9899
android:id="@+id/calendar_view"
99100
android:layout_width="0dp"
100101
android:layout_height="wrap_content"
101102
android:layout_marginHorizontal="16dp"
102103
android:layout_marginTop="20dp"
103-
app:cv_orientation="horizontal"
104104
app:cv_dayViewResource="@layout/item_calendar_day"
105105
app:cv_hasBoundaries="true"
106-
app:cv_scrollMode="paged"
106+
app:cv_orientation="horizontal"
107107
app:cv_outDateStyle="endOfGrid"
108+
app:cv_scrollMode="paged"
108109
app:layout_constraintEnd_toEndOf="parent"
109110
app:layout_constraintStart_toStartOf="parent"
110111
app:layout_constraintTop_toBottomOf="@id/tv_month_indicator" />
@@ -113,22 +114,25 @@
113114
android:id="@+id/tv_label_my_running_history"
114115
android:layout_width="wrap_content"
115116
android:layout_height="wrap_content"
117+
android:layout_marginTop="16dp"
116118
android:text="@string/my_run_label_my_running_history"
117-
app:layout_constraintTop_toBottomOf="@id/calendar_view"
118119
app:layout_constraintStart_toStartOf="@id/calendar_view"
119-
android:layout_marginTop="16dp"/>
120+
app:layout_constraintTop_toBottomOf="@id/calendar_view" />
120121

121122
<androidx.recyclerview.widget.RecyclerView
122123
android:id="@+id/rv_my_running_history"
123124
android:layout_width="0dp"
124125
android:layout_height="wrap_content"
125126
android:layout_marginHorizontal="16dp"
126127
android:layout_marginTop="12dp"
127-
tools:listitem="@layout/item_running_history"
128+
android:nestedScrollingEnabled="false"
129+
android:orientation="vertical"
130+
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
128131
app:layout_constraintBottom_toBottomOf="parent"
129132
app:layout_constraintEnd_toEndOf="parent"
130133
app:layout_constraintStart_toStartOf="parent"
131-
app:layout_constraintTop_toBottomOf="@id/tv_label_my_running_history" />
134+
app:layout_constraintTop_toBottomOf="@id/tv_label_my_running_history"
135+
tools:listitem="@layout/item_running_history" />
132136

133137
</androidx.constraintlayout.widget.ConstraintLayout>
134138

0 commit comments

Comments
Β (0)