diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterHomeResponse.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterHomeResponse.kt index ea3bce61..5ffe22cf 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterHomeResponse.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterHomeResponse.kt @@ -2,7 +2,6 @@ package kr.co.vividnext.sodalive.chat.character import androidx.annotation.Keep import com.google.gson.annotations.SerializedName -import kr.co.vividnext.sodalive.chat.character.curation.CurationSection import kr.co.vividnext.sodalive.chat.character.recent.RecentCharacter @Keep @@ -11,7 +10,6 @@ data class CharacterHomeResponse( @SerializedName("recentCharacters") val recentCharacters: List, @SerializedName("popularCharacters") val popularCharacters: List, @SerializedName("newCharacters") val newCharacters: List, - @SerializedName("curationSections") val curationSections: List ) @Keep diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabFragment.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabFragment.kt index 6b9a8d3d..637800df 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabFragment.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabFragment.kt @@ -19,7 +19,6 @@ import com.zhpan.indicator.enums.IndicatorStyle import kr.co.vividnext.sodalive.R import kr.co.vividnext.sodalive.base.BaseFragment import kr.co.vividnext.sodalive.base.SodaDialog -import kr.co.vividnext.sodalive.chat.character.curation.CurationSectionAdapter import kr.co.vividnext.sodalive.chat.character.detail.CharacterDetailActivity import kr.co.vividnext.sodalive.chat.character.detail.CharacterDetailActivity.Companion.EXTRA_CHARACTER_ID import kr.co.vividnext.sodalive.chat.character.newcharacters.NewCharactersAllActivity @@ -47,7 +46,6 @@ class CharacterTabFragment : BaseFragment( private lateinit var recentCharacterAdapter: RecentCharacterAdapter private lateinit var popularCharacterAdapter: CharacterAdapter private lateinit var newCharacterAdapter: CharacterAdapter - private lateinit var curationSectionAdapter: CurationSectionAdapter private lateinit var loadingDialog: LoadingDialog override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -65,7 +63,6 @@ class CharacterTabFragment : BaseFragment( setupRecentCharactersRecyclerView() setupPopularCharactersRecyclerView() setupNewCharactersRecyclerView() - setupCurationSectionsRecyclerView() } private fun setupBanner() { @@ -311,62 +308,6 @@ class CharacterTabFragment : BaseFragment( } } - private fun setupCurationSectionsRecyclerView() { - // 큐레이션 섹션 RecyclerView 설정 - curationSectionAdapter = CurationSectionAdapter { - onCharacterClick(it) - } - - - val recyclerView = binding.rvCurationSections - - recyclerView.layoutManager = LinearLayoutManager( - requireContext(), - LinearLayoutManager.VERTICAL, - false - ) - - recyclerView.addItemDecoration(object : RecyclerView.ItemDecoration() { - override fun getItemOffsets( - outRect: Rect, - view: View, - parent: RecyclerView, - state: RecyclerView.State - ) { - super.getItemOffsets(outRect, view, parent, state) - - when (parent.getChildAdapterPosition(view)) { - 0 -> { - outRect.top = 0 - outRect.bottom = 24f.dpToPx().toInt() - } - - curationSectionAdapter.itemCount - 1 -> { - outRect.top = 24f.dpToPx().toInt() - outRect.bottom = 0 - } - - else -> { - outRect.top = 24f.dpToPx().toInt() - outRect.bottom = 24f.dpToPx().toInt() - } - } - } - }) - - recyclerView.adapter = curationSectionAdapter - - // 큐레이션 섹션 LiveData 구독 - viewModel.curationSections.observe(viewLifecycleOwner) { - if (it.isNotEmpty()) { - recyclerView.visibility = View.VISIBLE - curationSectionAdapter.updateSections(it) - } else { - recyclerView.visibility = View.GONE - } - } - } - private fun ensureLoginAndAuth(onAuthed: () -> Unit) { if (SharedPreferenceManager.token.isBlank()) { (requireActivity() as MainActivity).showLoginActivity() diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabViewModel.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabViewModel.kt index 2176de71..6659af58 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabViewModel.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/CharacterTabViewModel.kt @@ -6,7 +6,6 @@ import com.orhanobut.logger.Logger import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.schedulers.Schedulers import kr.co.vividnext.sodalive.base.BaseViewModel -import kr.co.vividnext.sodalive.chat.character.curation.CurationSection import kr.co.vividnext.sodalive.chat.character.recent.RecentCharacter import kr.co.vividnext.sodalive.common.SharedPreferenceManager @@ -40,11 +39,6 @@ class CharacterTabViewModel( val newCharacters: LiveData> get() = _newCharacters - // 큐레이션 섹션 LiveData - private val _curationSections = MutableLiveData>(emptyList()) - val curationSections: LiveData> - get() = _curationSections - fun fetchData() { _isLoading.value = true @@ -60,7 +54,6 @@ class CharacterTabViewModel( _recentCharacters.value = data.recentCharacters _popularCharacters.value = data.popularCharacters _newCharacters.value = data.newCharacters - _curationSections.value = data.curationSections } else { _toastLiveData.value = it.message ?: "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요." diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/curation/CurationSection.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/curation/CurationSection.kt deleted file mode 100644 index ec570077..00000000 --- a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/curation/CurationSection.kt +++ /dev/null @@ -1,12 +0,0 @@ -package kr.co.vividnext.sodalive.chat.character.curation - -import androidx.annotation.Keep -import com.google.gson.annotations.SerializedName -import kr.co.vividnext.sodalive.chat.character.Character - -@Keep -data class CurationSection( - @SerializedName("characterCurationId") val characterCurationId: Long, - @SerializedName("title") val title: String, - @SerializedName("characters") val characters: List -) diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/curation/CurationSectionAdapter.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/curation/CurationSectionAdapter.kt deleted file mode 100644 index 4fff15c2..00000000 --- a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/curation/CurationSectionAdapter.kt +++ /dev/null @@ -1,94 +0,0 @@ -package kr.co.vividnext.sodalive.chat.character.curation - -import android.annotation.SuppressLint -import android.content.Context -import android.graphics.Rect -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import kr.co.vividnext.sodalive.chat.character.CharacterAdapter -import kr.co.vividnext.sodalive.databinding.ItemCurationSectionBinding -import kr.co.vividnext.sodalive.extensions.dpToPx - -class CurationSectionAdapter( - private var sections: List = emptyList(), - private val onCharacterClick: (Long) -> Unit = {} -) : RecyclerView.Adapter() { - - inner class ViewHolder( - private val context: Context, - private val binding: ItemCurationSectionBinding - ) : RecyclerView.ViewHolder(binding.root) { - fun bind(section: CurationSection) { - binding.tvSectionTitle.text = section.title - - // 캐릭터 리스트 설정 - val characterAdapter = CharacterAdapter( - characters = section.characters, - showRanking = false, - onCharacterClick = onCharacterClick - ) - - val recyclerView = binding.rvCharacters - - recyclerView.layoutManager = LinearLayoutManager( - context, - LinearLayoutManager.HORIZONTAL, - false - ) - - recyclerView.addItemDecoration(object : RecyclerView.ItemDecoration() { - override fun getItemOffsets( - outRect: Rect, - view: View, - parent: RecyclerView, - state: RecyclerView.State - ) { - super.getItemOffsets(outRect, view, parent, state) - - when (parent.getChildAdapterPosition(view)) { - 0 -> { - outRect.left = 0 - outRect.right = 8f.dpToPx().toInt() - } - - characterAdapter.itemCount - 1 -> { - outRect.left = 8f.dpToPx().toInt() - outRect.right = 0 - } - - else -> { - outRect.left = 8f.dpToPx().toInt() - outRect.right = 8f.dpToPx().toInt() - } - } - } - }) - - recyclerView.adapter = characterAdapter - } - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder( - parent.context, - ItemCurationSectionBinding.inflate( - LayoutInflater.from(parent.context), - parent, - false - ) - ) - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.bind(sections[position]) - } - - override fun getItemCount(): Int = sections.size - - @SuppressLint("NotifyDataSetChanged") - fun updateSections(newSections: List) { - sections = newSections - notifyDataSetChanged() - } -} diff --git a/app/src/main/res/layout/fragment_character_tab.xml b/app/src/main/res/layout/fragment_character_tab.xml index 219a144f..0398cc93 100644 --- a/app/src/main/res/layout/fragment_character_tab.xml +++ b/app/src/main/res/layout/fragment_character_tab.xml @@ -174,12 +174,5 @@ android:paddingHorizontal="24dp" /> - - -