feat: 하단 탭 아이콘 변경

This commit is contained in:
2025-07-07 20:23:23 +09:00
parent ba7b681e48
commit f1958995f6
17 changed files with 22 additions and 46 deletions

View File

@@ -35,7 +35,6 @@ import kr.co.vividnext.sodalive.audio_content.main.v2.home.AudioContentMainTabHo
import kr.co.vividnext.sodalive.audio_content.player.AudioContentPlayerFragment import kr.co.vividnext.sodalive.audio_content.player.AudioContentPlayerFragment
import kr.co.vividnext.sodalive.audio_content.player.AudioContentPlayerService import kr.co.vividnext.sodalive.audio_content.player.AudioContentPlayerService
import kr.co.vividnext.sodalive.audio_content.series.detail.SeriesDetailActivity import kr.co.vividnext.sodalive.audio_content.series.detail.SeriesDetailActivity
import kr.co.vividnext.sodalive.audition.AuditionFragment
import kr.co.vividnext.sodalive.base.BaseActivity import kr.co.vividnext.sodalive.base.BaseActivity
import kr.co.vividnext.sodalive.common.Constants import kr.co.vividnext.sodalive.common.Constants
import kr.co.vividnext.sodalive.common.LoadingDialog import kr.co.vividnext.sodalive.common.LoadingDialog
@@ -310,7 +309,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
} else if (messageId > 0) { } else if (messageId > 0) {
startActivity(Intent(applicationContext, MessageActivity::class.java)) startActivity(Intent(applicationContext, MessageActivity::class.java))
} else if (auditionId > 0) { } else if (auditionId > 0) {
viewModel.clickTab(MainViewModel.CurrentTab.AUDITION)
} }
} catch (_: IllegalStateException) { } catch (_: IllegalStateException) {
} }
@@ -377,14 +375,14 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
private fun setupBottomTabLayout() { private fun setupBottomTabLayout() {
setupTab( setupTab(
binding = binding.tabContent, binding = binding.tabHome,
title = "콘텐츠", title = "",
imageSrc = R.drawable.ic_tabbar_content, imageSrc = R.drawable.ic_tabbar_home,
colorStateList = ContextCompat.getColorStateList( colorStateList = ContextCompat.getColorStateList(
applicationContext, applicationContext,
R.color.color_tabbar_title R.color.color_tabbar_title
), ),
tab = MainViewModel.CurrentTab.CONTENT tab = MainViewModel.CurrentTab.HOME
) )
setupTab( setupTab(
@@ -398,17 +396,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
tab = MainViewModel.CurrentTab.LIVE tab = MainViewModel.CurrentTab.LIVE
) )
setupTab(
binding = binding.tabAudition,
title = "오디션",
imageSrc = R.drawable.ic_tabbar_audition,
colorStateList = ContextCompat.getColorStateList(
applicationContext,
R.color.color_tabbar_title
),
tab = MainViewModel.CurrentTab.AUDITION
)
setupTab( setupTab(
binding = binding.tabMy, binding = binding.tabMy,
title = "마이", title = "마이",
@@ -421,25 +408,20 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
) )
viewModel.currentTab.observe(this) { viewModel.currentTab.observe(this) {
setTabSelected(binding.tabContent, isSelected = false) setTabSelected(binding.tabHome, isSelected = false)
setTabSelected(binding.tabLive, isSelected = false) setTabSelected(binding.tabLive, isSelected = false)
setTabSelected(binding.tabAudition, isSelected = false)
setTabSelected(binding.tabMy, isSelected = false) setTabSelected(binding.tabMy, isSelected = false)
changeFragment(it) changeFragment(it)
when (it) { when (it) {
MainViewModel.CurrentTab.CONTENT -> { MainViewModel.CurrentTab.HOME -> {
setTabSelected(binding.tabContent, isSelected = true) setTabSelected(binding.tabHome, isSelected = true)
} }
MainViewModel.CurrentTab.LIVE -> { MainViewModel.CurrentTab.LIVE -> {
setTabSelected(binding.tabLive, isSelected = true) setTabSelected(binding.tabLive, isSelected = true)
} }
MainViewModel.CurrentTab.AUDITION -> {
setTabSelected(binding.tabAudition, isSelected = true)
}
MainViewModel.CurrentTab.MY -> { MainViewModel.CurrentTab.MY -> {
setTabSelected(binding.tabMy, isSelected = true) setTabSelected(binding.tabMy, isSelected = true)
} }
@@ -490,8 +472,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
if (fragment == null) { if (fragment == null) {
fragment = when (currentTab) { fragment = when (currentTab) {
MainViewModel.CurrentTab.LIVE -> liveFragment MainViewModel.CurrentTab.LIVE -> liveFragment
MainViewModel.CurrentTab.CONTENT -> AudioContentMainTabHomeFragment() MainViewModel.CurrentTab.HOME -> AudioContentMainTabHomeFragment()
MainViewModel.CurrentTab.AUDITION -> AuditionFragment()
MainViewModel.CurrentTab.MY -> MyPageFragment() MainViewModel.CurrentTab.MY -> MyPageFragment()
} }

View File

@@ -33,20 +33,17 @@ class MainViewModel(
private val playbackTrackingRepository: PlaybackTrackingRepository private val playbackTrackingRepository: PlaybackTrackingRepository
) : BaseViewModel() { ) : BaseViewModel() {
enum class CurrentTab { enum class CurrentTab {
@SerializedName("CONTENT") @SerializedName("HOME")
CONTENT, HOME,
@SerializedName("LIVE") @SerializedName("LIVE")
LIVE, LIVE,
@SerializedName("AUDITION")
AUDITION,
@SerializedName("MY") @SerializedName("MY")
MY MY
} }
private val _currentTab = MutableLiveData(CurrentTab.CONTENT) private val _currentTab = MutableLiveData(CurrentTab.HOME)
val currentTab: LiveData<CurrentTab> val currentTab: LiveData<CurrentTab>
get() = _currentTab get() = _currentTab

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/color_bbbbbb" android:state_selected="false" /> <item android:color="@color/color_eeeeee" android:state_selected="false" />
<item android:color="@color/color_3bb9f1" android:state_selected="true" /> <item android:color="@color/color_3bb9f1" android:state_selected="true" />
</selector> </selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_home" android:state_selected="false" />
<item android:drawable="@drawable/ic_home_selected" android:state_selected="true" />
</selector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_tabbar_live_normal" android:state_selected="false" /> <item android:drawable="@drawable/ic_live" android:state_selected="false" />
<item android:drawable="@drawable/ic_tabbar_live_selected" android:state_selected="true" /> <item android:drawable="@drawable/ic_live_selected" android:state_selected="true" />
</selector> </selector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_tabbar_my_normal" android:state_selected="false" /> <item android:drawable="@drawable/ic_my" android:state_selected="false" />
<item android:drawable="@drawable/ic_tabbar_my_selected" android:state_selected="true" /> <item android:drawable="@drawable/ic_my_selected" android:state_selected="true" />
</selector> </selector>

View File

@@ -163,7 +163,7 @@
app:labelVisibilityMode="labeled"> app:labelVisibilityMode="labeled">
<include <include
android:id="@+id/tab_content" android:id="@+id/tab_home"
layout="@layout/item_main_tab" layout="@layout/item_main_tab"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -176,13 +176,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<include
android:id="@+id/tab_audition"
layout="@layout/item_main_tab"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<include <include
android:id="@+id/tab_my" android:id="@+id/tab_my"
layout="@layout/item_main_tab" layout="@layout/item_main_tab"