Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
๐Ÿ“Œ ์ผ๊ธฐ์ž‘์„ฑ ๋‚ ์งœ์„ ํƒ viewPager ์ˆ˜์ • (#103)
Browse files Browse the repository at this point in the history
* [style] string ์ •๋ฆฌ

* [fix] ๋‹ฌ๋ ฅ ์Šค์™€์ดํ”„ ์‹œ Month Text๋ณ€๊ฒฝ
  • Loading branch information
HamBeomJoon authored Aug 14, 2024
1 parent ac903df commit 5415932
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.AlertDialog
import android.view.LayoutInflater
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import androidx.viewpager2.widget.ViewPager2
import com.nabi.domain.model.diary.DiaryDbEntity
import com.nabi.domain.model.diary.DiarySelectInfo
import com.nabi.nabi.R
Expand Down Expand Up @@ -74,8 +75,16 @@ class AddDiarySelectDateFragment :
vpCalendarMonth.adapter = calendarAdapter
vpCalendarMonth.setCurrentItem(Int.MAX_VALUE / 2, false)
vpCalendarMonth.offscreenPageLimit = 1
}

vpCalendarMonth.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)

val calendar = getCalendarForPosition(position)
binding.tvSelectMonth.text = dateEnglishOnlyMonthFormat.format(calendar.time)
}
})
}
updateCurrentMonthText(binding.vpCalendarMonth.currentItem)
}

Expand Down Expand Up @@ -153,7 +162,7 @@ class AddDiarySelectDateFragment :
tempDiary?.diaryTempContent,
selectedDate.diaryEntryDate
)
(requireActivity() as MainActivity).replaceFragment(fragment, false)
(requireActivity() as MainActivity).replaceFragment(fragment, true)
}

private fun updateCalendarMonth(monthDifference: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintVertical_chainStyle="packed"

android:text="๋‹‰๋„ค์ž„ ์„ค์ •"
android:text="@string/text_set_nickname"
android:fontFamily="@font/pretendard_medium"
android:textStyle="bold"
android:textColor="#272727"
Expand All @@ -39,7 +39,7 @@
app:layout_constraintTop_toBottomOf="@id/tv_title"
app:layout_constraintBottom_toTopOf="@id/tv_comment"

android:hint="๋‹‰๋„ค์ž„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”"
android:hint="@string/hint_set_nickname"
android:background="@drawable/selector_edittext_nickname"
android:textColorHint="@color/selector_edittext_nickname_colors"
android:textColor="@color/black"
Expand Down
11 changes: 0 additions & 11 deletions Nabi/presentation/src/main/res/layout/item_search_diary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,5 @@
style="@style/search_result_regular_14px"
android:maxLines="2"
android:ellipsize="end"/>

<!-- <View-->
<!-- android:id="@+id/divider"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="0.5dp"-->

<!-- app:layout_constraintTop_toBottomOf="@id/tv_content"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- android:layout_marginTop="8dp"-->

<!-- android:background="@color/gray2"/>-->

</androidx.constraintlayout.widget.ConstraintLayout>
4 changes: 4 additions & 0 deletions Nabi/presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<string name="text_recent_login">์ตœ๊ทผ์— ์ด์šฉํ–ˆ์–ด์š”!</string>
<string name="text_team_name">Team ๋„ˆ์˜๋น„๋ฐ€์นœ๊ตฌ</string>

<!-- ๋‹‰๋„ค์ž„ ์„ค์ • ํŽ˜์ด์ง€ -->
<string name="text_set_nickname">๋‹‰๋„ค์ž„ ์„ค์ •</string>
<string name="hint_set_nickname">๋‹‰๋„ค์ž„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”</string>

<!-- ๋‹ฌ๋ ฅ -->
<string name="text_week_monday">M</string>
<string name="text_week_tuesday">T</string>
Expand Down

0 comments on commit 5415932

Please sign in to comment.