fix(ui): 홈/메인 문자열 리소스화 및 영·일 번역 추가

This commit is contained in:
2025-11-28 18:40:42 +09:00
parent 6e3edd1e96
commit 2740522f05
9 changed files with 162 additions and 196 deletions

View File

@@ -8,7 +8,6 @@ import android.widget.Toast
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import kr.co.vividnext.sodalive.audio_content.series.SeriesListAdapter
import kr.co.vividnext.sodalive.audio_content.series.detail.SeriesDetailActivity
import kr.co.vividnext.sodalive.base.BaseFragment
import kr.co.vividnext.sodalive.common.Constants
@@ -61,7 +60,7 @@ class SeriesMainDayOfWeekFragment : BaseFragment<FragmentSeriesMainDayOfWeekBind
}
private fun setupDayOfWeekDay() {
val dayOfWeekAdapter = DayOfWeekAdapter(screenWidth = screenWidth) {
val dayOfWeekAdapter = DayOfWeekAdapter(requireContext()) {
adapter.clear()
viewModel.dayOfWeek = it
}
@@ -73,7 +72,7 @@ class SeriesMainDayOfWeekFragment : BaseFragment<FragmentSeriesMainDayOfWeekBind
false
) {
override fun canScrollVertically() = false
override fun canScrollHorizontally() = false
override fun canScrollHorizontally() = true
}
rvDayOfWeek.layoutManager = layoutManager

View File

@@ -1,14 +1,16 @@
package kr.co.vividnext.sodalive.home
import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.databinding.ItemDayOfWeekBinding
import java.util.Calendar
class DayOfWeekAdapter(
private val screenWidth: Int,
private val context: Context,
private val onClickItem: (SeriesPublishedDaysOfWeek) -> Unit,
) : RecyclerView.Adapter<DayOfWeekAdapter.ViewHolder>() {
@@ -20,17 +22,6 @@ class DayOfWeekAdapter(
binding.tvDayOfWeek.text = dayOfWeek.dayOfWeekStr
binding.tvDayOfWeek.isSelected = dayOfWeek.dayOfWeek == selectedDayOfWeek
val lp = binding.tvDayOfWeek.layoutParams
lp.height = screenWidth * 38 / 400
if (dayOfWeek.dayOfWeek == SeriesPublishedDaysOfWeek.RANDOM) {
lp.width = screenWidth * 54 / 400
} else {
lp.width = screenWidth * 38 / 400
}
binding.tvDayOfWeek.layoutParams = lp
binding.root.setOnClickListener {
onClickItem(dayOfWeek.dayOfWeek)
selectedDayOfWeek = dayOfWeek.dayOfWeek
@@ -42,14 +33,14 @@ class DayOfWeekAdapter(
private var selectedDayOfWeek = SeriesPublishedDaysOfWeek.RANDOM
private val dayOfWeekItems = listOf(
DayOfWeek(dayOfWeekStr = "", dayOfWeek = SeriesPublishedDaysOfWeek.MON),
DayOfWeek(dayOfWeekStr = "", dayOfWeek = SeriesPublishedDaysOfWeek.TUE),
DayOfWeek(dayOfWeekStr = "", dayOfWeek = SeriesPublishedDaysOfWeek.WED),
DayOfWeek(dayOfWeekStr = "", dayOfWeek = SeriesPublishedDaysOfWeek.THU),
DayOfWeek(dayOfWeekStr = "", dayOfWeek = SeriesPublishedDaysOfWeek.FRI),
DayOfWeek(dayOfWeekStr = "", dayOfWeek = SeriesPublishedDaysOfWeek.SAT),
DayOfWeek(dayOfWeekStr = "", dayOfWeek = SeriesPublishedDaysOfWeek.SUN),
DayOfWeek(dayOfWeekStr = "랜덤", dayOfWeek = SeriesPublishedDaysOfWeek.RANDOM),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_mon_short), dayOfWeek = SeriesPublishedDaysOfWeek.MON),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_tue_short), dayOfWeek = SeriesPublishedDaysOfWeek.TUE),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_wed_short), dayOfWeek = SeriesPublishedDaysOfWeek.WED),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_thu_short), dayOfWeek = SeriesPublishedDaysOfWeek.THU),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_fri_short), dayOfWeek = SeriesPublishedDaysOfWeek.FRI),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_sat_short), dayOfWeek = SeriesPublishedDaysOfWeek.SAT),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_sun_short), dayOfWeek = SeriesPublishedDaysOfWeek.SUN),
DayOfWeek(dayOfWeekStr = context.getString(R.string.day_random), dayOfWeek = SeriesPublishedDaysOfWeek.RANDOM),
)
// 요일 숫자에 맞춰 배열

View File

@@ -6,9 +6,6 @@ import android.graphics.Rect
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.SpannableString
import android.text.Spanned
import android.text.style.ForegroundColorSpan
import android.view.Gravity
import android.view.View
import android.widget.LinearLayout
@@ -199,20 +196,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupLiveView() {
val spSectionTitle = SpannableString(binding.tvLiveTitle.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvLiveTitle.text = spSectionTitle
liveAdapter = HomeLiveAdapter {
if (SharedPreferenceManager.token.isNotBlank()) {
val detailFragment = LiveRoomDetailFragment(
@@ -282,20 +265,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
fun setupSectionCreator() {
val spSectionTitle = SpannableString(binding.tvFamousCreatorTitle.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvFamousCreatorTitle.text = spSectionTitle
creatorRankingAdapter = CreatorRankingAdapter(
onClickItem = {
if (SharedPreferenceManager.token.isNotBlank()) {
@@ -372,20 +341,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupLatestContent() {
val spSectionTitle = SpannableString(binding.tvNewContent.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvNewContent.text = spSectionTitle
latestContentThemeAdapter = HomeContentThemeAdapter {
viewModel.getLatestContentByTheme(theme = it)
}
@@ -583,20 +538,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupOriginalSeries() {
val spSectionTitle = SpannableString(binding.tvSeriesOriginal.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvSeriesOriginal.text = spSectionTitle
originalSeriesAdapter = HomeSeriesAdapter {
if (SharedPreferenceManager.token.isNotBlank()) {
startActivity(
@@ -698,20 +639,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupSeriesDayOfWeek() {
val spSectionTitle = SpannableString(binding.tvSeriesDayOfWeek.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
3,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvSeriesDayOfWeek.text = spSectionTitle
seriesDayOfWeekAdapter = HomeSeriesAdapter {
if (SharedPreferenceManager.token.isNotBlank()) {
startActivity(
@@ -767,7 +694,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
}
val dayOfWeekAdapter = DayOfWeekAdapter(screenWidth = screenWidth) {
val dayOfWeekAdapter = DayOfWeekAdapter(requireContext()) {
viewModel.getDayOfWeekSeriesList(it)
}
@@ -778,7 +705,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
false
) {
override fun canScrollVertically() = false
override fun canScrollHorizontally() = false
override fun canScrollHorizontally() = true
}
rvDayOfWeek.layoutManager = layoutManager
@@ -889,20 +816,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupWeelyChart() {
val spSectionTitle = SpannableString(binding.tvWeeklyChart.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvWeeklyChart.text = spSectionTitle
// 정렬 선택 RecyclerView 설정
val sortAdapter = ContentRankingSortAdapter {
viewModel.getContentRanking(it)
@@ -1009,20 +922,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupRecommendChannel() {
val spSectionTitle = SpannableString(binding.tvRecommendChannel.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvRecommendChannel.text = spSectionTitle
recommendChannelAdapter = HomeRecommendChannelAdapter(
onClickCreatorProfile = {
if (SharedPreferenceManager.token.isNotBlank()) {
@@ -1093,20 +992,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupFreeContent() {
val spSectionTitle = SpannableString(binding.tvFreeContent.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
2,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvFreeContent.text = spSectionTitle
homeFreeContentAdapter = HomeContentAdapter {
if (SharedPreferenceManager.token.isNotBlank()) {
startActivity(
@@ -1168,20 +1053,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun setupPointContent() {
val spSectionTitle = SpannableString(binding.tvPointContent.text)
spSectionTitle.setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
requireContext(),
R.color.color_3bb9f1
)
),
0,
3,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.tvPointContent.text = spSectionTitle
homePointContentAdapter = HomeContentAdapter {
if (SharedPreferenceManager.token.isNotBlank()) {
startActivity(
@@ -1400,7 +1271,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
LivePaymentDialog(
activity = requireActivity(),
layoutInflater = layoutInflater,
title = "유료 라이브 입장",
title = getString(R.string.live_paid_title),
startDateTime = if (hours >= 1) {
dateFormat.format(beginDate)
} else {
@@ -1411,19 +1282,19 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
} else {
null
},
desc = "${it.price}캔을 차감하고\n라이브에 입장 하시겠습니까?",
desc = getString(R.string.live_paid_desc, it.price),
desc2 = if (hours >= 1) {
"라이브를 시작한 지 ${hours}시간 ${mins}분이 지났습니다. 라이브에 입장 후 30분 이내에 라이브가 종료될 수도 있습니다."
getString(R.string.live_paid_warning, hours, mins)
} else {
null
},
confirmButtonTitle = "결제 후 입장",
confirmButtonTitle = getString(R.string.live_paid_confirm),
confirmButtonClick = {
handler.postDelayed({
liveViewModel.enterRoom(roomId, onEnterRoomSuccess)
}, 300)
},
cancelButtonTitle = "취소",
cancelButtonTitle = getString(R.string.cancel),
cancelButtonClick = {}
).show(screenWidth)
}
@@ -1442,12 +1313,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
SodaDialog(
activity = requireActivity(),
layoutInflater = layoutInflater,
title = "본인인증",
desc = "보이스온의 오픈월드 캐릭터톡은\n청소년 보호를 위해 본인인증한\n성인만 이용이 가능합니다.\n" +
"캐릭터톡 서비스를 이용하시려면\n본인인증을 하고 이용해주세요.",
confirmButtonTitle = "본인인증 하러가기",
title = getString(R.string.auth_title),
desc = getString(R.string.auth_desc),
confirmButtonTitle = getString(R.string.auth_go),
confirmButtonClick = { startAuthFlow() },
cancelButtonTitle = "취소",
cancelButtonTitle = getString(R.string.cancel),
cancelButtonClick = {},
descGravity = Gravity.CENTER
).show(screenWidth)

View File

@@ -377,7 +377,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
private fun setupBottomTabLayout() {
setupTab(
binding = binding.tabHome,
title = "",
title = getString(R.string.tab_home),
imageSrc = R.drawable.ic_tabbar_home,
colorStateList = ContextCompat.getColorStateList(
applicationContext,
@@ -388,7 +388,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
setupTab(
binding = binding.tabChat,
title = "채팅",
title = getString(R.string.tab_chat),
imageSrc = R.drawable.ic_tabbar_chat,
colorStateList = ContextCompat.getColorStateList(
applicationContext,
@@ -399,7 +399,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
setupTab(
binding = binding.tabLive,
title = "라이브",
title = getString(R.string.tab_live),
imageSrc = R.drawable.ic_tabbar_live,
colorStateList = ContextCompat.getColorStateList(
applicationContext,
@@ -410,7 +410,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
setupTab(
binding = binding.tabMy,
title = "마이",
title = getString(R.string.tab_my),
imageSrc = R.drawable.ic_tabbar_my,
colorStateList = ContextCompat.getColorStateList(
applicationContext,